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