class tgClient.AbstractTelegramClient
extends TelegramBaseClient
Abstract
import { tgClient } from "https://deno.land/x/grm@0.5.2/src/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: , 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: Api.Message | 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<Api.Message>abstract
forwardMessages(entity: Api.TypeEntityLike, forwardMessagesParams: types.ForwardMessagesParams): Promise<Api.Message[]>getDC(): Promise<{ id: number; ipAddress: string; port: number; }>
dcId: number,
downloadDC?,
web?,
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,
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): DirectDownloadIterabstract
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,
abstract
on(event: any): voidabstract
pinMessage(): Promise<Api.messages.AffectedHistory>abstract
pinMessage(entity: Api.TypeEntityLike,
message: Api.TypeMessageIDLike,
pinMessageParams?: types.UpdatePinMessageParams,
abstract
pinMessage(): Promise<Api.Message | Api.messages.AffectedHistory | undefined>abstract
removeEventHandler(callback: CallableFunction, event: any): voidabstract
sendCode(apiCredentials: types.ApiCredentials,
phoneNumber: string,
forceSMS?: 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
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(): Promise<Api.messages.AffectedHistory>abstract
unpinMessage(entity: Api.TypeEntityLike,
message: Api.TypeMessageIDLike,
pinMessageParams?: types.UpdatePinMessageParams,
abstract
unpinMessage(): 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>