class tgClient.AbstractTelegramClient
extends TelegramBaseClient
Abstract
import { tgClient } from "https://deno.land/x/grm@0.5.4/mod.ts";
const { AbstractTelegramClient } = tgClient;
Constructors
Methods
abstract
_getInputDialog(peer: any): Promise<any>abstract
_getInputNotify(notify: any): Promise<any>abstract
_getResponseMessage(req: any,
result: any,
inputChat: any,
_removeSender(dcId: number)
_switchDC(newDc: number)
abstract
addEventHandler(callback: { (event: any): void; }, event?: any): voidabstract
buildReplyMarkup(buttons: Api.TypeMarkupLike | undefined, inlineOnly?: boolean): Api.TypeReplyMarkup | undefinedabstract
checkAuthorization(): Promise<boolean>abstract
connect(): Promise<void>abstract
deleteMessages(entity: Api.TypeEntityLike | undefined,
messageIds: Api.TypeMessageIDLike[],
unnamed 2: { revoke: boolean; },
abstract
downloadFile(inputLocation: Api.TypeInputFileLocation, fileParams: types.DownloadFileParamsV2): Promise<string | Buffer | undefined>abstract
downloadMedia(messageOrMedia: any | Api.TypeMessageMedia, downloadParams?: types.DownloadMediaInterface): Promise<Buffer | string | undefined> | Bufferabstract
downloadProfilePhoto(entity: Api.TypeEntityLike, downloadProfilePhotoParams: types.DownloadProfilePhotoParams): Promise<string | Buffer | undefined>abstract
editMessage(entity: Api.TypeEntityLike, editMessageParams: types.EditMessageParams): Promise<any>abstract
forwardMessages(entity: Api.TypeEntityLike, forwardMessagesParams: types.ForwardMessagesParams): Promise<any[]>getDC(): Promise<{ id: number; ipAddress: string; port: number; }>
dcId: number,
downloadDC?,
web?,
abstract
getDialogs(params: types.IterDialogsParams): Promise<TotalList<any>>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<any>>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,
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<any>abstract
iterDownload(iterFileParams: types.IterDownloadFunction): AsyncIterable<any>abstract
iterMessages(entity: Api.TypeEntityLike | undefined, iterParams: Partial<types.IterMessagesParams>): AsyncIterable<any>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,
abstract
on(event: any): voidabstract
pinMessage(entity: Api.TypeEntityLike,
message?: undefined,
pinMessageParams?: types.UpdatePinMessageParams,
abstract
pinMessage(entity: Api.TypeEntityLike,
message: Api.TypeMessageIDLike,
pinMessageParams?: types.UpdatePinMessageParams,
abstract
pinMessage(entity: Api.TypeEntityLike,
message?: any,
pinMessageParams?: types.UpdatePinMessageParams,
abstract
removeEventHandler(callback: CallableFunction, event: any): voidabstract
sendCode(apiCredentials: types.ApiCredentials,
phoneNumber: string,
forceSMS?: boolean,
abstract
sendFile(entity: Api.TypeEntityLike, sendFileParams: types.SendFileInterface): Promise<any>abstract
sendMessage(entity: Api.TypeEntityLike, sendMessageParams: types.SendMessageParams): Promise<any>abstract
setParseMode(mode: | "md"
| "markdown"
| "html"
| types.ParseInterface
| undefined
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,
abstract
unpinMessage(entity: Api.TypeEntityLike,
message: Api.TypeMessageIDLike,
pinMessageParams?: types.UpdatePinMessageParams,
abstract
unpinMessage(entity: Api.TypeEntityLike,
message?: any,
unpinMessageParams?: types.UpdatePinMessageParams,
abstract
updateTwoFaSettings(unnamed 0: types.TwoFaParams): Promise<void>abstract
uploadFile(fileParams: types.UploadFileParams): Promise<Api.InputFile | Api.InputFileBig>