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

x/mtkruto/client/3_message_manager.ts>MessageManager

Cross-runtime JavaScript library for building Telegram clients
Latest
class MessageManager
import { MessageManager } from "https://deno.land/x/mtkruto@0.6.3/client/3_message_manager.ts";

Constructors

new
MessageManager(c: C)

Properties

usernameResolver: UsernameResolver

Methods

addChatMember(
chatId: ID,
userId: ID,
)
addChatMembers(chatId: ID, userIds: ID[])
addReaction(
chatId: ID,
messageId: number,
reaction: Reaction,
)
approveJoinRequest(chatId: ID, userId: ID)
banChatMember(
chatId: ID,
memberId: ID,
)
blockUser(userId: ID)
constructMessage(
message_: Api.Message,
r?: boolean,
business?: { connectionId: string; replyToMessage?: Api.Message; },
)
declineJoinRequest(chatId: ID, userId: ID)
deleteChatMemberMessages(chatId: ID, memberId: ID)
deleteChatPhoto(chatId: number)
deleteMessages(
chatId: ID,
messageIds: number[],
)
deleteScheduledMessage(chatId: ID, messageId: number)
deleteScheduledMessages(chatId: ID, messageIds: number[])
editInlineMessageLiveLocation(
inlineMessageId: string,
latitude: number,
longitude: number,
)
editInlineMessageMedia(
inlineMessageId: string,
media: InputMedia,
)
editInlineMessageText(
inlineMessageId: string,
text: string,
)
editMessageLiveLocation(
chatId: ID,
messageId: number,
latitude: number,
longitude: number,
)
editMessageMedia(
chatId: ID,
messageId: number,
media: InputMedia,
)
editMessageReplyMarkup(
chatId: ID,
messageId: number,
)
editMessageText(
chatId: ID,
messageId: number,
text: string,
)
forwardMessages(
from: ID,
to: ID,
messageIds: number[],
)
getHistory(chatId: ID, params?: GetHistoryParams)
getMessage(chatId: ID, messageId: number)
getMessages(chatId: ID, messageIds: number[])
getMessageWithReply(chatId: ID, messageId: number)
handleUpdate(update: MessageManagerUpdate): Promise<Update | null>
joinChat(chatId: ID)
leaveChat(chatId: ID)
parseText(text_: string, params?: { parseMode?: ParseMode; entities?: MessageEntity[]; })
pinMessage(
chatId: ID,
messageId: number,
)
readMessages(chatId: ID, untilMessageId: number)
removeReaction(
chatId: ID,
messageId: number,
reaction: Reaction,
)
resolveFileId(maybeFileId: string, expectedFileType: FileType | FileType[])
searchMessages(
chatId: ID,
query: string,
)
sendAnimation(
chatId: ID,
animation: FileSource,
)
sendAudio(
chatId: ID,
audio: FileSource,
params?: SendAudioParams,
)
sendContact(
chatId: ID,
firstName: string,
number: string,
)
sendDice(chatId: ID, params?: SendDiceParams)
sendDocument(
chatId: ID,
document: FileSource,
)
sendInvoice(
chatId: ID,
title: string,
description: string,
payload: string,
currency: string,
prices: PriceTag[],
)
sendLocation(
chatId: ID,
latitude: number,
longitude: number,
)
sendMediaGroup(
chatId: ID,
media: InputMedia[],
)
sendMessage(
chatId: ID,
text: string,
)
sendPhoto(
chatId: ID,
photo: FileSource,
params?: SendPhotoParams,
)
sendPoll(
chatId: ID,
question: string,
options: [string | PollOption, string | PollOption, ...(string | PollOption)[]],
params?: SendPollParams,
)
sendScheduledMessage(chatId: ID, messageId: number)
sendScheduledMessages(chatId: ID, messageIds: number[])
sendSticker(
chatId: ID,
sticker: FileSource,
)
sendVenue(
chatId: ID,
latitude: number,
longitude: number,
title: string,
address: string,
params?: SendVenueParams,
)
sendVideo(
chatId: ID,
video: FileSource,
params?: SendVideoParams,
)
sendVoice(
chatId: ID,
voice: FileSource,
params?: SendVoiceParams,
)
setAvailableReactions(chatId: ID, availableReactions: "none" | "all" | Reaction[])
setChatMemberRights(
chatId: ID,
memberId: ID,
)
setChatPhoto(
chatId: number,
photo: FileSource,
): Promise<void>
setChatStickerSet(chatId: ID, setName: string)
setReactions(
chatId: ID,
messageId: number,
reactions: Reaction[],
)
startBot(botId: ID, params?: StartBotParams)
stopPoll(
chatId: ID,
messageId: number,
params?: StopPollParams,
)
unbanChatMember(chatId: ID, memberId: ID)
unblockUser(userId: ID)
unpinMessage(
chatId: ID,
messageId: number,
)
unpinMessages(chatId: ID)

Static Methods

canHandleUpdate(update: Api.Update): update is MessageManagerUpdate
parseText(
text: string,
entities: MessageEntity[],
parseMode: ParseMode,
): [string, MessageEntity[]]