Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/grm/src/client/mod.ts>tgClient.AbstractTelegramClient

MTProto API Client for Deno 🦕
Go to Latest
class tgClient.AbstractTelegramClient
Abstract
import { tgClient } from "https://deno.land/x/grm@0.5.1/src/client/mod.ts";
const { AbstractTelegramClient } = tgClient;

Constructors

new
AbstractTelegramClient(
session: string | Session,
apiId: number,
apiHash: string,
clientParams?: TelegramClientParams,
)

Properties

abstract
readonly
parseMode: types.ParseInterface | undefined

Methods

abstract
_getInputDialog(peer: any): Promise<any>
abstract
_getInputNotify(notify: any): Promise<any>
abstract
_getResponseMessage(
req: any,
result: any,
inputChat: any,
):
| Api.TypeMessage
| Map<number, Api.Message>
| (Api.Message | undefined)[]
| undefined
_removeSender(dcId: number)
_switchDC(newDc: number)
abstract
addEventHandler(callback: { (event: any): void; }, event?: any): void
abstract
buildReplyMarkup(buttons:
| Api.TypeReplyMarkup
| undefined
| ButtonLike[][]
, inlineOnly?: boolean
): Api.TypeReplyMarkup | undefined
abstract
checkAuthorization(): Promise<boolean>
abstract
connect(): Promise<void>
abstract
deleteMessages(
entity: Api.TypeEntityLike | undefined,
messageIds: Api.TypeMessageIDLike[],
unnamed 2: { revoke: boolean; },
): Promise<Api.messages.AffectedMessages[]>
abstract
downloadFile(inputLocation: Api.TypeInputFileLocation, fileParams: types.DownloadFileParamsV2): Promise<string | Buffer | undefined>
abstract
downloadMedia(messageOrMedia: Api.Message | Api.TypeMessageMedia, downloadParams?: types.DownloadMediaInterface): Promise<Buffer | string | undefined> | Buffer
abstract
downloadProfilePhoto(entity: Api.TypeEntityLike, downloadProfilePhotoParams: types.DownloadProfilePhotoParams): Promise<string | Buffer | undefined>
abstract
editMessage(entity: Api.TypeEntityLike, editMessageParams: types.EditMessageParams): Promise<Api.Message>
abstract
forwardMessages(entity: Api.TypeEntityLike, forwardMessagesParams: types.ForwardMessagesParams): Promise<Api.Message[]>
getDC(
dcId: number,
downloadDC?,
web?,
): Promise<{ id: number; ipAddress: string; port: number; }>
abstract
getDialogs(params: types.IterDialogsParams): Promise<TotalList<Dialog>>
abstract
getEntity(entity: Api.TypeEntityLike): Promise<Api.TypeEntity>
abstract
getEntity(entity: Api.TypeEntityLike[]): Promise<Api.TypeEntity[]>
abstract
getEntity(entity: any): Promise<Api.TypeEntity>
abstract
getInputEntity(entity: Api.TypeEntityLike): Promise<Api.TypeInputPeer>
abstract
getMe(inputPeer?: boolean): Promise<Api.User | Api.InputPeerUser>
abstract
getMessages(entity: Api.TypeEntityLike | undefined, getMessagesParams: Partial<types.IterMessagesParams>): Promise<TotalList<Api.Message>>
abstract
getParticipants(entity: Api.TypeEntityLike, params: types.IterParticipantsParams): Promise<TotalList<Api.User>>
abstract
getPeerId(peer: Api.TypeEntityLike, addMark?: boolean): Promise<string>
abstract
inlineQuery(
bot: Api.TypeEntityLike,
query: string,
entity?: Api.InputPeerSelf,
offset?: string,
geoPoint?: Api.TypeInputGeoPoint,
): Promise<InlineResults>
abstract
invoke<R extends Api.AnyRequest>(request: R, sender?: MTProtoSender): Promise<R["__response"]>
abstract
isBot(): Promise<boolean | undefined>
abstract
isUserAuthorized(): Promise<boolean>
abstract
iterDialogs(iterDialogsParams: types.IterDialogsParams): AsyncIterable<Dialog>
abstract
iterDownload(iterFileParams: types.IterDownloadFunction): DirectDownloadIter
abstract
iterMessages(entity: Api.TypeEntityLike | undefined, iterParams: Partial<types.IterMessagesParams>): AsyncIterable<Api.Message>
abstract
iterParticipants(entity: Api.TypeEntityLike, params: types.IterParticipantsParams): AsyncIterable<Api.User>
abstract
listEventHandlers(): [any, CallableFunction][]
abstract
markAsRead(
entity: Api.TypeEntityLike,
message?: Api.TypeMessageIDLike | Api.TypeMessageIDLike[],
markAsReadParams?: types.MarkAsReadParams,
): Promise<boolean>
abstract
on(event: any): void
abstract
pinMessage(
entity: Api.TypeEntityLike,
message?: undefined,
pinMessageParams?: types.UpdatePinMessageParams,
): Promise<Api.messages.AffectedHistory>
abstract
pinMessage(
entity: Api.TypeEntityLike,
message: Api.TypeMessageIDLike,
pinMessageParams?: types.UpdatePinMessageParams,
): Promise<Api.Message>
abstract
pinMessage(
entity: Api.TypeEntityLike,
message?: any,
pinMessageParams?: types.UpdatePinMessageParams,
): Promise<Api.Message | Api.messages.AffectedHistory | undefined>
abstract
removeEventHandler(callback: CallableFunction, event: any): void
abstract
sendCode(
apiCredentials: types.ApiCredentials,
phoneNumber: string,
forceSMS?: boolean,
): Promise<{ phoneCodeHash: string; isCodeViaApp: boolean; }>
abstract
sendFile(entity: Api.TypeEntityLike, sendFileParams: types.SendFileInterface): Promise<Api.Message>
abstract
sendMessage(entity: Api.TypeEntityLike, sendMessageParams: types.SendMessageParams): Promise<Api.Message>
abstract
setParseMode(mode:
| "md"
| "markdown"
| "html"
| types.ParseInterface
| undefined
): void
abstract
signInBot(apiCredentials: types.ApiCredentials, authParams: types.BotAuthParams): Promise<Api.TypeUser>
abstract
signInUser(apiCredentials: types.ApiCredentials, authParams: types.UserAuthParams): Promise<Api.TypeUser>
abstract
signInUserWithQrCode(apiCredentials: types.ApiCredentials, authParams: types.QrCodeAuthParams): Promise<Api.TypeUser>
abstract
signInWithPassword(apiCredentials: types.ApiCredentials, authParams: types.UserPasswordAuthParams): Promise<Api.TypeUser>
abstract
start(authParams?: types.UserAuthParams | types.BotAuthParams): Promise<void>
abstract
unpinMessage(
entity: Api.TypeEntityLike,
message?: undefined,
pinMessageParams?: types.UpdatePinMessageParams,
): Promise<Api.messages.AffectedHistory>
abstract
unpinMessage(
entity: Api.TypeEntityLike,
message: Api.TypeMessageIDLike,
pinMessageParams?: types.UpdatePinMessageParams,
): Promise<undefined>
abstract
unpinMessage(
entity: Api.TypeEntityLike,
message?: any,
unpinMessageParams?: types.UpdatePinMessageParams,
): Promise<Api.Message | Api.messages.AffectedHistory | undefined>
abstract
updateTwoFaSettings(unnamed 0: types.TwoFaParams): Promise<void>
abstract
uploadFile(fileParams: types.UploadFileParams): Promise<Api.InputFile | Api.InputFileBig>

Static Properties

readonly
events