/** * MTKruto - Cross-runtime JavaScript library for building Telegram clients * Copyright (C) 2023-2026 Roj * * This file is part of MTKruto. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ import { Api } from "../2_tl.js"; import { type Animation, type BlockedUserList, type ChatActionType, type FileSource, FileType, type ID, type InlineQueryResult, type InputChecklistItem, type InputMedia, type InputPollMedia, type InputPollOption, type InputRichText, type Message, type MessageAnimation, type MessageAudio, type MessageChecklist, type MessageContact, type MessageCounters, type MessageDice, type MessageDocument, type MessageEntity, type MessageGetter, type MessageInvoice, type MessageList, type MessageLivePhoto, type MessageLocation, type MessagePhoto, type MessagePoll, type MessageReactionList, type MessageRichText, type MessageSticker, type MessageText, type MessageVenue, type MessageVideo, type MessageVideoNote, type MessageViewer, type MessageVoice, type MiniAppInfo, type ParseMode, type Poll, type PriceTag, type Reaction, type ReportResult, type RichText, type SavedChats, type Sticker, type SummarizedText, type TextToTranslate, type TranslatedText, type Update, type UsernameResolver, type VoiceTranscription } from "../3_types.js"; import type { AddReactionParams, DeleteMessagesParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageRichTextParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageTextParams, ForwardMessagesParams, GetBlockedUsersParams, GetHistoryParams, GetMessageReactionsParams, GetSavedChatsParams, GetSavedMessagesParams, OpenMiniAppParams, PinMessageParams, ReportEphemeralMessageParams, SaveDraftParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChatActionParams, SendChecklistParams as SendChecklistParams, SendContactParams, SendDiceParams, SendDocumentParams, SendInvoiceParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendRichTextDraftParams, SendRichTextParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetReactionsParams, StartBotParams, StopPollParams, SummarizeTextParams, TranslateTextParams, UnpinMessageParams, UnpinMessagesParams } from "./0_params.js"; import type { UpdateProcessor } from "./0_update_processor.js"; import type { C as C_ } from "./1_types.js"; import type { FileManager } from "./2_file_manager.js"; interface C extends C_ { fileManager: FileManager; } declare const messageManagerUpdates: readonly ["updateNewMessage", "updateNewChannelMessage", "updateNewEphemeralMessage", "updateEditEphemeralMessage", "updateDeleteEphemeralMessages", "updateEditMessage", "updateNewScheduledMessage", "updateEditChannelMessage", "updateBotNewBusinessMessage", "updateBotEditBusinessMessage", "updateBotDeleteBusinessMessage", "updateDeleteMessages", "updateDeleteChannelMessages", "updateDeleteScheduledMessages", "updateTranscribedAudio", "updateUserTyping", "updateChatUserTyping", "updateChannelUserTyping", "updateBotGuestChatQuery"]; type MessageManagerUpdate = Api.Types[(typeof messageManagerUpdates)[number]]; export declare class MessageManager implements UpdateProcessor { #private; constructor(c: C); getMessages(chatId: ID, messageIds: number[]): Promise; getMessageWithReply(chatId: ID, messageId: number): Promise; getMessage(chatId: ID, messageId: number): Promise; static parseText(text: string, entities: MessageEntity[], parseMode: ParseMode, isEmptyAllowed?: boolean): [string, MessageEntity[]]; parseText(text_: string, params?: { parseMode?: ParseMode; entities?: MessageEntity[]; }, isEmptyAllowed?: boolean): [string, Api.MessageEntity[] | undefined]; updatesToMessages(chatId: ID, updates: Api.Updates, businessConnectionId?: string): Promise; constructMessage(message_: Api.Message | Api.EphemeralMessage, r?: boolean, business?: { connectionId: string; replyToMessage?: Api.Message; }, messageGetter?: MessageGetter): Promise; forwardMessages(from: ID, to: ID, messageIds: number[], params?: ForwardMessagesParams): Promise; getHistory(chatId: ID, params?: GetHistoryParams): Promise; usernameResolver: UsernameResolver; sendMessageDraft(chatId: ID, draftId: number, text: string, params?: SendMessageDraftParams): Promise; sendRichTextDraft(chatId: ID, draftId: number, richText: InputRichText, params?: SendRichTextDraftParams): Promise; sendMessage(chatId: ID, text: string, params?: SendMessageParams): Promise; sendRichText(chatId: ID, richText: InputRichText, params?: SendRichTextParams): Promise; inputRichTextToInputRichMessage(richText: InputRichText, peer?: Api.InputPeer): Promise; sendVenue(chatId: ID, latitude: number, longitude: number, title: string, address: string, params?: SendVenueParams): Promise; sendContact(chatId: ID, firstName: string, number: string, params?: SendContactParams): Promise; sendDice(chatId: ID, params?: SendDiceParams): Promise; sendLocation(chatId: ID, latitude: number, longitude: number, params?: SendLocationParams): Promise; sendVideoNote(chatId: ID, audio: FileSource, params?: SendVideoNoteParams): Promise; sendAudio(chatId: ID, audio: FileSource, params?: SendAudioParams): Promise; sendVoice(chatId: ID, voice: FileSource, params?: SendVoiceParams): Promise; sendAnimation(chatId: ID, animation: FileSource, params?: SendAnimationParams): Promise; sendVideo(chatId: ID, video: FileSource, params?: SendVideoParams): Promise; sendDocument(chatId: ID, document: FileSource, params?: SendDocumentParams): Promise; sendSticker(chatId: ID, sticker: FileSource, params?: SendStickerParams): Promise; sendPhoto(chatId: ID, photo: FileSource, params?: SendPhotoParams): Promise; sendLivePhoto(chatId: ID, photo: FileSource, video: FileSource, params?: SendPhotoParams): Promise; resolveFileId(maybeFileId: string, expectedFileType: FileType | FileType[]): { id: bigint; access_hash: bigint; file_reference: Uint8Array; } | null; sendPoll(chatId: ID, question: string, options: InputPollOption[], params?: SendPollParams): Promise; resolvePollMedia(peer: Api.InputPeer, media: InputPollMedia): Promise; sendChecklist(chatId: ID, title: string, items: InputChecklistItem[], params?: SendChecklistParams): Promise; editMessageReplyMarkup(chatId: ID, messageId: number, params?: EditMessageReplyMarkupParams): Promise; editEphemeralMessageReplyMarkup(chatId: ID, receiverUserId: ID, messageId: number, params?: EditMessageReplyMarkupParams): Promise; editInlineMessageReplyMarkup(inlineMessageId: string, params?: EditMessageReplyMarkupParams): Promise; editMessageText(chatId: ID, messageId: number, text: string, params?: EditMessageTextParams): Promise; editEphemeralMessageText(chatId: ID, receiverUserId: ID, messageId: number, text: string, params?: EditMessageTextParams): Promise; editMessageRichText(chatId: ID, messageId: number, richText: InputRichText, params?: EditInlineMessageRichTextParams): Promise; editMessageCaption(chatId: ID, messageId: number, params?: EditMessageCaptionParams): Promise; editEphemeralMessageCaption(chatId: ID, receiverUserId: ID, messageId: number, params?: EditMessageCaptionParams): Promise; editInlineMessageText(inlineMessageId: string, text: string, params?: EditInlineMessageTextParams): Promise; editInlineMessageCaption(inlineMessageId: string, params?: EditInlineMessageCaptionParams): Promise; editMessageMedia(chatId: ID, messageId: number, media: InputMedia, params?: EditMessageMediaParams): Promise; editEphemeralMessageMedia(chatId: ID, receiverUserId: ID, messageId: number, media: InputMedia, params?: EditMessageMediaParams): Promise; editInlineMessageMedia(inlineMessageId: string, media: InputMedia, params?: EditInlineMessageMediaParams): Promise; editInlineMessageRichText(inlineMessageId: string, richText: InputRichText, params?: EditInlineMessageRichTextParams): Promise; deleteMessages(chatId: ID, messageIds: number[], params?: DeleteMessagesParams): Promise; deleteEphemeralMessage(chatId: ID, receiverUserId: ID, messageId: number): Promise; deleteScheduledMessages(chatId: ID, messageIds: number[]): Promise; deleteScheduledMessage(chatId: ID, messageId: number): Promise; sendScheduledMessages(chatId: ID, messageIds: number[]): Promise; sendScheduledMessage(chatId: ID, messageId: number): Promise; deleteChatMemberMessages(chatId: ID, memberId: ID): Promise; pinMessage(chatId: ID, messageId: number, params?: PinMessageParams): Promise; unpinMessage(chatId: ID, messageId: number, params?: UnpinMessageParams): Promise; unpinMessages(chatId: ID, params?: UnpinMessagesParams): Promise; setReactions(chatId: ID, messageId: number, reactions: Reaction[], params?: SetReactionsParams): Promise; addReaction(chatId: ID, messageId: number, reaction: Reaction, params?: AddReactionParams): Promise; removeReaction(chatId: ID, messageId: number, reaction: Reaction): Promise; removeUserReaction(chatId: ID, messageId: number, userId: ID): Promise; removeUserReactions(chatId: ID, userId: ID): Promise; clearRecentReactions(): Promise; canHandleUpdate(update: Api.Update): update is MessageManagerUpdate; handleUpdate(update: MessageManagerUpdate): Promise; sendChatAction(chatId: ID, action: ChatActionType, params?: SendChatActionParams): Promise; searchMessages(params?: SearchMessagesParams): Promise; blockUser(userId: ID): Promise; unblockUser(userId: ID): Promise; getBlockedUsers(params?: GetBlockedUsersParams): Promise; setChatStickerSet(chatId: ID, setName: string): Promise; deleteChatStickerSet(chatId: ID): Promise; stopPoll(chatId: ID, messageId: number, params?: StopPollParams): Promise; editMessageLiveLocation(chatId: ID, messageId: number, latitude: number, longitude: number, params?: EditMessageLiveLocationParams): Promise; editInlineMessageLiveLocation(inlineMessageId: string, latitude: number, longitude: number, params?: EditMessageLiveLocationParams): Promise; sendInvoice(chatId: ID, title: string, description: string, payload: string, currency: string, prices: PriceTag[], params?: SendInvoiceParams): Promise; sendMediaGroup(chatId: ID, media: InputMedia[], params?: SendMediaGroupParams): Promise; readMessages(chatId: ID, untilMessageId: number): Promise; startBot(botId: ID, params?: StartBotParams): Promise; transcribeVoice(chatId: ID, messageId: number): Promise; resolveMessageLink(link: string): Promise; static parseMessageLink(link: string): [ID, number] | null; openMiniApp(botId: ID, chatId: ID, params?: OpenMiniAppParams): Promise; getSavedMessages(chatId: ID, params?: GetSavedMessagesParams): Promise; getSavedChats(params?: GetSavedChatsParams): Promise; getMessageReactions(chatId: ID, messageId: number, params?: GetMessageReactionsParams): Promise; setDefaultReaction(reaction: Reaction): Promise; clearDrafts(): Promise; summarizeText(chatId: ID, messageId: number, params?: SummarizeTextParams): Promise; answerGuestQuery(id: string, result_: InlineQueryResult): Promise; viewMessages(chatId: ID, messageIds: number[]): Promise; viewMessage(chatId: ID, messageId: number): Promise; getMessagesCounters(chatId: ID, messageIds: number[]): Promise; getMessageCounters(chatId: ID, messageId: number): Promise; translateTexts(toLanguage: string, texts: TextToTranslate[], params?: TranslateTextParams): Promise; translateText(toLanguage: string, text: TextToTranslate, params?: TranslateTextParams): Promise; translateMessages(toLanguage: string, chatId: ID, messageIds: number[], params?: TranslateTextParams): Promise; translateMessage(toLanguage: string, chatId: ID, messageId: number, params?: TranslateTextParams): Promise; getRichText(chatId: ID, messageId: number): Promise; getScheduledMessages(chatId: ID): Promise; getFavoriteStickers(): Promise; addStickerToFavorites(fileId: string): Promise; removeStickerFromFavorites(fileId: string): Promise; addStickerToRecents(fileId: string): Promise; removeStickerFromRecents(fileId: string): Promise; clearRecentStickers(): Promise; getRecentStickers(): Promise; getSavedAnimations(): Promise; saveAnimation(fileId: string): Promise; unsaveAnimation(fileId: string): Promise; getMessageReadDate(chatId: ID, messageId: number): Promise; getMessageViewers(chatId: ID, messageId: number): Promise; sendScreenshotNotification(chatId: ID, replyToMessageId: number): Promise; saveDraft(chatId: ID, text: string, params?: SaveDraftParams): Promise; saveRichTextDraft(chatId: ID, richText: InputRichText, params?: SaveDraftParams): Promise; reportEphemeralMessage(chatId: ID, messageId: number, params?: ReportEphemeralMessageParams): Promise; } export {}; //# sourceMappingURL=3_message_manager.d.ts.map