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

x/mtkruto/client/5_client.ts>Context

Cross-runtime JavaScript library for building Telegram clients
Latest
interface Context
import { type Context } from "https://deno.land/x/mtkruto@0.6.2/client/5_client.ts";

Properties

client: Client

The client that received the update.

optional
me: User

The currently signed in user.

optional
msg: Message

Resolves to message, editedMessage, or the message field of callbackQuery.

optional
chat: ChatP

Resolves to msg?.chat.

optional
from: User

Resolves to the from field of message, editedMessage, callbackQuery, or inlineQuery.

optional
senderChat: ChatP

Resolves to msg?.senderChat.

toJSON: () => Update
reply: (text: string, params?: Omit<SendMessageParams, "replyTo" | "businessConnectionId"> & ReplyParams) => Promise<MessageText>

Context-aware alias for client.sendMessage().

replyPoll: (
question: string,
options: [string, string, ...string[]],
params?: Omit<SendPollParams, "replyTo" | "businessConnectionId"> & ReplyParams,
) => Promise<MessagePoll>

Context-aware alias for client.sendPoll().

replyPhoto: (photo: FileSource, params?: Omit<SendPhotoParams, "replyTo" | "businessConnectionId"> & ReplyParams) => Promise<MessagePhoto>

Context-aware alias for client.sendPhoto().

replyMediaGroup: (media: InputMedia[], params?: Omit<SendMediaGroupParams, "replyTo" | "businessConnectionId"> & ReplyParams) => Promise<Message[]>

Context-aware alias for client.sendMediaGroup().

replyInvoice: (
title: string,
description: string,
payload: string,
currency: string,
prices: PriceTag[],
params?: Omit<SendInvoiceParams, "replyTo" | "businessConnectionId"> & ReplyParams,
) => Promise<MessageInvoice>

Context-aware alias for client.sendInvoice().

replyDocument: (document: FileSource, params?: Omit<SendDocumentParams, "replyTo" | "businessConnectionId"> & ReplyParams) => Promise<MessageDocument>

Context-aware alias for client.sendDocument().

replySticker: (sticker: FileSource, params?: Omit<SendStickerParams, "replyTo" | "businessConnectionId"> & ReplyParams) => Promise<MessageSticker>

Context-aware alias for client.sendSticker().

replyLocation: (
latitude: number,
longitude: number,
params?: Omit<SendLocationParams, "replyTo" | "businessConnectionId"> & ReplyParams,
) => Promise<MessageLocation>

Context-aware alias for client.sendLocation().

replyDice: (params?: Omit<SendDiceParams, "replyTo" | "businessConnectionId"> & ReplyParams) => Promise<MessageDice>

Context-aware alias for client.sendDice().

replyVenue: (
latitude: number,
longitude: number,
title: string,
address: string,
params?: Omit<SendVenueParams, "replyTo" | "businessConnectionId"> & ReplyParams,
) => Promise<MessageVenue>

Context-aware alias for client.sendVenue().

replyContact: (
firstName: string,
number: string,
params?: Omit<SendContactParams, "replyTo" | "businessConnectionId"> & ReplyParams,
) => Promise<MessageContact>

Context-aware alias for client.sendContact().

replyVideo: (video: FileSource, params?: Omit<SendVideoParams, "replyTo" | "businessConnectionId"> & ReplyParams) => Promise<MessageVideo>

Context-aware alias for client.sendVideo().

replyAnimation: (animation: FileSource, params?: Omit<SendAnimationParams, "replyTo" | "businessConnectionId"> & ReplyParams) => Promise<MessageAnimation>

Context-aware alias for client.sendAnimation().

replyVoice: (voice: FileSource, params?: Omit<SendVoiceParams, "replyTo" | "businessConnectionId"> & ReplyParams) => Promise<MessageVoice>

Context-aware alias for client.sendVoice().

replyAudio: (audio: FileSource, params?: Omit<SendAudioParams, "replyTo" | "businessConnectionId"> & ReplyParams) => Promise<MessageAudio>

Context-aware alias for client.sendAudio().

replyVideoNote: (videoNote: FileSource, params?: Omit<SendVideoNoteParams, "replyTo" | "businessConnectionId"> & ReplyParams) => Promise<MessageVideoNote>

Context-aware alias for client.sendPoll().

delete: () => Promise<void>

Context-aware alias for client.deleteMessage().

forward: (to: ID, params?: ForwardMessagesParams) => Promise<this["msg"]>

Context-aware alias for client.forwardMessage().

pin: (params?: PinMessageParams) => Promise<void>

Context-aware alias for client.pinMessage().

unpin: (params?: PinMessageParams) => Promise<void>

Context-aware alias for client.unpinMessage().

banSender: (params?: BanChatMemberParams) => Promise<void>

Context-aware alias for client.banChatMember().

kickSender: () => Promise<void>

Context-aware alias for client.kickChatMember().

setSenderRights: (params?: SetChatMemberRightsParams) => Promise<void>

Context-aware alias for client.setChatMemberRights().

getChatAdministrators: () => Promise<ChatMember[]>

Context-aware alias for client.getChatAdministrators().

react: (reactions: Reaction[], params?: SetReactionsParams) => Promise<void>

Context-aware alias for client.setReactions().

sendChatAction: (action: ChatAction, params?: { messageThreadId?: number; }) => Promise<void>

Context-aware alias for client.sendChatAction().

editInlineMessageText: (text: string, params?: EditMessageParams) => Promise<void>

Context-aware alias for client.editInlineMessageText().

editInlineMessageLiveLocation: (
latitude: number,
longitude: number,
) => Promise<void>

Context-aware alias for client.editInlineMessageLiveLocation().

editInlineMessageReplyMarkup: (params?: EditMessageReplyMarkupParams) => Promise<void>

Context-aware alias for client.editInlineMessageReplyMarkup().

editMessageText: (
messageId: number,
text: string,
) => Promise<MessageText>

Context-aware alias for client.editMessageText().

editMessageLiveLocation: (
messageId: number,
latitude: number,
longitude: number,
) => Promise<MessageLocation>

Context-aware alias for client.editMessageLiveLocation().

editMessageReplyMarkup: (messageId: number, params?: EditMessageReplyMarkupParams) => Promise<Message>

Context-aware alias for client.editMessageReplyMarkup().

answerCallbackQuery: (params?: AnswerCallbackQueryParams) => Promise<void>

Context-aware alias for client.answerCallbackQuery().

answerInlineQuery: (results: InlineQueryResult[], params?: AnswerInlineQueryParams) => Promise<void>

Context-aware alias for client.answerInlineQuery().

getMessage: (messageId: number) => Promise<Message | null>

Context-aware alias for client.getMessage().

getMessages: (messageIds: number[]) => Promise<Message[]>

Context-aware alias for client.getMessages().

forwardMessage: (
to: ID,
messageId: number,
) => Promise<Message>

Context-aware alias for client.forwardMessage().

forwardMessages: (
to: ID,
messageIds: number[],
) => Promise<Message[]>

Context-aware alias for client.forwardMessages().

deleteMessage: (messageId: number, params?: DeleteMessagesParams) => Promise<void>

Context-aware alias for client.deleteMessage().

deleteMessages: (messageIds: number[], params?: DeleteMessagesParams) => Promise<void>

Context-aware alias for client.deleteMessages().

pinMessage: (messageId: number, params?: PinMessageParams) => Promise<void>

Context-aware alias for client.pinMessage().

unpinMessage: (messageId: number) => Promise<void>

Context-aware alias for client.unpinMessage().

unpinMessages: () => Promise<void>

Context-aware alias for client.unpinMessages().

setAvailableReactions: (availableReactions: "none" | "all" | Reaction[]) => Promise<void>

Context-aware alias for client.setAvailableReactions().

addReaction: (
messageId: number,
reaction: Reaction,
) => Promise<void>

Context-aware alias for client.addReaction().

removeReaction: (messageId: number, reaction: Reaction) => Promise<void>

Context-aware alias for client.removeReaction().

setReactions: (
messageId: number,
reactions: Reaction[],
) => Promise<void>

Context-aware alias for client.setReactions().

setChatPhoto: (photo: FileSource, params?: SetChatPhotoParams) => Promise<void>

Context-aware alias for client.setChatPhoto().

deleteChatPhoto: () => Promise<void>

Context-aware alias for client.deleteChatPhoto().

banChatMember: (memberId: ID, params?: BanChatMemberParams) => Promise<void>

Context-aware alias for client.banChatMember().

unbanChatMember: (memberId: ID) => Promise<void>

Context-aware alias for client.unbanChatMember().

kickChatMember: (memberId: ID) => Promise<void>

Context-aware alias for client.kickChatMember().

setChatMemberRights: (memberId: ID, params?: SetChatMemberRightsParams) => Promise<void>

Context-aware alias for client.setChatMemberRights().

deleteChatMemberMessages: (userId: ID) => Promise<void>

Context-aware alias for client.deleteChatMemberMessages().

searchMessages: (query: string, params?: SearchMessagesParams) => Promise<Message[]>

Context-aware alias for client.searchMessages().

setBoostsRequiredToCircumventRestrictions: (boosts: number) => Promise<void>

Context-aware alias for client.setBoostsRequiredToCircumventRestrictions().

leave: () => Promise<void>

Context-aware alias for client.leaveChat().

block: () => Promise<void>

Context-aware alias for client.blockUser().

unblock: () => Promise<void>

Context-aware alias for client.unblockUser().

getChatMember: (userId: ID) => Promise<ChatMember>

Context-aware alias for client.getChatMember().

getChatMembers: (params?: GetChatMembersParams) => Promise<ChatMember[]>

Context-aware alias for client.getChatMember().

setChatStickerSet: (setName: string) => Promise<void>

Context-aware alias for client.setChatStickerSet().

deleteChatStickerSet: () => Promise<void>

Context-aware alias for client.deleteChatStickerSet().

getBusinessConnection: () => Promise<BusinessConnection>

Context-aware alias for client.getBusinessConnection().

answerPreCheckoutQuery: (ok: boolean, params?: AnswerPreCheckoutQueryParams) => Promise<void>

Context-aware alias for client.answerPreCheckoutQuery().

approveJoinRequest: () => Promise<void>

Context-aware alias for client.approveJoinRequest().

declineJoinRequest: () => Promise<void>

Context-aware alias for client.declineJoinRequest().

Methods

read(): Promise<void>

Context-aware alias for client.readMessages().