/**
* 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 type { Api, Mtproto } from "../2_tl.js";
import type { AlbumStoryList, Animation, AppSupport, AuthorizationSession, AvailableReactions, Birthday, BlockedUserList, BotAccessSettings, BotCommand, BotTokenCheckResult, BusinessConnection, CallbackQueryAnswer, CallbackQueryQuestion, Chat, ChatActionType, ChatListItem, ChatMember, ChatP, ChatPChannel, ChatPGroup, ChatPPrivate, ChatPSupergroup, ChatSettings, ClaimedGifts, CodeCheckResult, ConnectedWebsite, Country, FailedInvitation, FileSource, Gift, GiftCollection, ID, InactiveChat, InlineQueryAnswer, InlineQueryResult, InputChecklistItem, InputEmojiStatus, InputGift, InputMedia, InputPollOption, InputRichText, InputSticker, InputStoryContent, InviteLink, JoinRequest, LeftChannelList, LinkPreview, LiveStreamChannel, Message, MessageAnimation, MessageAudio, MessageChecklist, MessageContact, MessageCounters, MessageDice, MessageDocument, MessageInvoice, MessageList, MessageLivePhoto, MessageLocation, MessagePhoto, MessagePoll, MessageReactionList, MessageRichText, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageViewer, MessageVoice, MiniAppInfo, NetworkStatistics, PasswordCheckResult, Poll, PollVoterList, PremiumSubscriptionDuration, PriceTag, ProfilePhotoList, Reaction, ReportReason, RichText, SavedChats, SecretChat, SlowModeDuration, StarAmount, StarTransactionList, Sticker, StickerSet, Story, StoryAlbum, StoryReportResult, SummarizedText, TextToTranslate, Timezone, Topic, TopicList, TopicListItem, TranslatedText, Translation, User, VideoChat, VideoChatActive, VideoChatScheduled, VoiceTranscription } from "../3_types.js";
import type { AddBotToAttachmentsMenuParams, AddChatMemberParams, AddContactParams, AddReactionParams, AddStickerToStickerSetParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, CheckUsernameParams, CreateChannelParams, CreateGroupParams, CreateInviteLinkParams, CreateStickerSetParams, CreateStoryParams, CreateSupergroupParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteAccountParams, DeleteMessageParams, DeleteMessagesParams, DownloadLiveStreamSegmentParams, DownloadParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageRichTextParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageRichTextParams, EditMessageTextParams, EditTopicParams, EnableSignaturesParams, EndSecretChatParams, EndTakeoutSessionParams, ForwardMessagesParams, GetBlockedUsersParams, GetChatMembersParams, GetChatsParams, GetClaimedGiftsParams, GetCommonChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetLeftChannelsParams, GetLinkPreviewParams, GetMessageReactionsParams, GetMyCommandsParams, GetPollVotersParams, GetProfilePhotosParams, GetSavedChatsParams, GetSavedMessagesParams, GetStarTransactionsParams, GetTopicsParams, GetTranslationsParams, GiftPremiumSubscriptionParams, InvokeParams, JoinVideoChatParams, MarkAllMentionsAsReadParams, OpenChatParams, OpenMiniAppParams, PinMessageParams, PromoteChatMemberParams, RemoveProfilePhotoParams, ReplaceStickerInStickerSetParams, ReportChatParams, ReportStoryParams, ResolveUsernameParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChecklistParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInlineQueryParams, SendInvoiceParams, SendLivePhotoParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendRichTextDraftParams, SendRichTextParams, SendSecretAnimationParams, SendSecretAudioParams, SendSecretContactParams, SendSecretDocumentParams, SendSecretLocationParams, SendSecretMessageParams, SendSecretPhotoParams, SendSecretStickerParams, SendSecretVenueParams, SendSecretVideoNoteParams, SendSecretVideoParams, SendSecretVoiceParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetBirthdayParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams, SetContactNoteParams, SetEmojiStatusParams, SetLocationParams, SetManagedBotAccessSettingsParams, SetMyCommandsParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetReactionsParams, SetWorkingHoursParams, SignInParams, StartBotParams, StartTakeoutSessionParams, StartVideoChatParams, StopPollParams, SummarizeTextParams, TranslateTextParams, UnpinMessageParams, UnpinMessagesParams, UpdateChecklistParams, UpdateProfileParams, UpdateProfilePhotoParams, UpdateProfileVideoParams } from "./0_params.js";
/** A generic MTKruto client. */
export declare abstract class ClientGeneric {
abstract connect(): Promise;
abstract disconnect(): Promise;
abstract start(params?: SignInParams): Promise;
abstract invoke ? Api.ReturnType : T["_"] extends keyof Api.Functions ? Api.ReturnType extends never ? Api.ReturnType : never : never>(function_: T, params?: InvokeParams): Promise;
/**
* Send a user verification code.
*
* @param phoneNumber The phone number to send the code to.
* @method ac
*/
abstract sendCode(phoneNumber: string): Promise;
/**
* Check if a code entered by the user was the same as the verification code.
*
* @param code A code entered by the user.
* @method ac
*/
abstract checkCode(code: string): Promise;
/**
* Get the user account password's hint.
*
* @method ac
*/
abstract getPasswordHint(): Promise;
/**
* Check whether a password entered by the user is the same as the account's one.
*
* @param password The password to check.
* @returns The result of the check.
* @method ac
*/
abstract checkPassword(password: string): Promise;
/**
* Check whether a bot token is valid.
*
* @param botToken The bot token to check
* @returns The result of the check.
* @method ac
*/
abstract checkBotToken(botToken: string): Promise;
/**
* Signs in using the provided parameters if not already signed in.
* If no parameters are provided, the credentials will be prompted in runtime.
*
* Notes:
* 1. Requires the `apiId` and `apiHash` parameters to be passed when constructing the client.
* 3. Reconnects the client to the appropriate DC in case of MIGRATE_X errors.
*/
abstract signIn(params?: SignInParams): Promise;
abstract signOut(): Promise;
abstract exportAuthString(): Promise;
abstract importAuthString(authString: string): Promise;
/**
* Get a chat's inputPeer. Useful when calling API functions directly.
*
* @param id The identifier of a chat.
*/
abstract getInputPeer(id: ID): Promise;
/**
* Get a channel or a supergroup's inputChannel. Useful when calling API functions directly.
*
* @param id The identifier of the channel or the supergroup.
*/
abstract getInputChannel(id: ID): Promise;
/**
* Get a user's inputUser. Useful when calling API functions directly.
*
* @param id The identifier of the user.
*/
abstract getInputUser(id: ID): Promise;
/**
* Add a bot to the attachments menu. User-only.
*
* @method ac
* @param botId The identifier of the bot to add to the attachments menu.
*/
abstract addBotToAttachmentsMenu(botId: ID, params?: AddBotToAttachmentsMenuParams): Promise;
/**
* Block a user. User-only.
*
* @method ac
* @param userId The identifier of the user to block.
*/
abstract blockUser(userId: ID): Promise;
/**
* Check the availability of a username. User-only.
*
* @method ac
* @param username The username to check.
* @returns Whether the username is available.
*/
abstract checkUsername(username: string, params?: CheckUsernameParams): Promise;
/**
* Delete the current account. User-only.
*
* @method ac
* @param reason The reason of the deletion.
*/
abstract deleteAccount(reason: string, params?: DeleteAccountParams): Promise;
/**
* Disable sponsored messages on the current user. User-only.
*
* @method ac
*/
abstract disableSponsoredMessages(): Promise;
/**
* Disconnect a connected website. User-only.
*
* @method ac
* @param id The identifier of a connected website.
*/
abstract disconnectConnectedWebsite(id: string): Promise;
/**
* Disconnect all connected websites. User-only.
*
* @method ac
*/
abstract disconnectConnectedWebsites(): Promise;
/**
* Enable sponsored messages on the current user. User-only.
*
* @method ac
*/
abstract enableSponsoredMessages(): Promise;
/**
* Get the current account's TTL. User-only.
*
* @method ac
* @returns The current account's TTL in days.
*/
abstract getAccountTtl(): Promise;
/**
* Get app support. User-only.
*
* @method ac
*/
abstract getAppSupport(): Promise;
/**
* Get app support name. User-only.
*
* @method ac
*/
abstract getAppSupportName(): Promise;
/**
* Get the authorization sessions. User-only.
*
* @method ac
*/
abstract getAuthorizationSessions(): Promise;
/**
* Get blocked users. User-only.
*
* @method ac
*/
abstract getBlockedUsers(params?: GetBlockedUsersParams): Promise;
/**
* Get a business connection. Bot-only.
*
* @method ac
* @param id The identifier of the business connection.
* @cache
*/
abstract getBusinessConnection(id: string): Promise;
/**
* Get connected websites. User-only.
*
* @method ac
*/
abstract getConnectedWebsites(): Promise;
/**
* Get countries. User-only.
*
* @method ac
*/
abstract getCountries(languageCode: string): Promise;
/**
* Get the country code for the current user based on its IP address. User-only.
*
* @method ac
*/
abstract getCountryCode(): Promise;
/**
* Get information on the currently authorized user.
*
* @method ac
* @returns Information on the currently authorized user.
*/
abstract getMe(): Promise;
/**
* Get owned bots. User-only.
*
* @method ac
*/
abstract getOwnedBots(): Promise;
/**
* Get the profile photos of a user.
*
* @method ac
* @param userId The identifier of a user.
*/
abstract getProfilePhotos(userId: ID, params?: GetProfilePhotosParams): Promise;
/**
* Get timezones. User-only.
*
* @method ac
*/
abstract getTimezones(): Promise;
/**
* Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
*
* @method ac
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
* @param username The username to hide.
*/
abstract hideUsername(id: ID, username: string): Promise;
/**
* Hide all usernames from a supergroup or a channel's profile. User-only.
*
* @method ac
* @param id A supergroup ID or a channel ID.
* @returns Whether any username was hidden.
*/
abstract hideUsernames(id: ID): Promise;
/**
* Pause the business bot in a chat. User-only.
*
* @method ac
* @param chatId The identifier of a chat.
*/
abstract pauseBusinessBotConnection(chatId: ID): Promise;
/**
* Remove an authorization session. User-only.
*
* @method ac
* @param id The identifier of the authorization session to remove.
*/
abstract removeAuthorizationSession(id: string): Promise;
/**
* Remove all authorization sessions except for the current one. User-only.
*
* @method ac
*/
abstract removeAuthorizationSessions(): Promise;
/**
* Remove a bot from the attachments menu. User-only.
*
* @method ac
* @param botId The identifier of the bot to remove from the attachments menu.
*/
abstract removeBotFromAttachmentsMenu(botId: ID): Promise;
/**
* Remove the emoji status of a channel. User-only.
*
* @method ac
* @param chatId The identifier of a channel.
*/
abstract removeChannelEmojiStatus(chatId: ID): Promise;
/**
* Remove the current account's emoji status. User-only.
*
* @method ac
*/
abstract removeEmojiStatus(): Promise;
/**
* Remove the profile video of the current user or a bot managed by the current user.
*
* @method ac
*/
abstract removeProfilePhoto(params?: RemoveProfilePhotoParams): Promise;
/**
* Remove the emoji status of a bot's user. Bot-only.
*
* @method ac
* @param userId The identifier of a user of the bot.
*/
abstract removeUserEmojiStatus(userId: ID): Promise;
/**
* Remove the current account's username. User-only.
*
* @method ac
*/
abstract removeUsername(): Promise;
/**
* Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
*
* @method ac
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
* @param order The new order to use.
* @returns Whether the order was changed.
*/
abstract reorderUsernames(id: ID, order: string[]): Promise;
/**
* Resolve a phone number. User-only.
*
* @method ac
* @param phoneNumber The phone number to resolve.
*/
abstract resolvePhoneNumber(phoneNumber: string): Promise;
/**
* Resolve a username.
*
* @method ac
* @param username The username to resolve.
*/
abstract resolveUsername(username: string, params?: ResolveUsernameParams): Promise;
/**
* Resume the business bot in a chat. User-only.
*
* @method ac
* @param chatId The identifier of a chat.
*/
abstract resumeBusinessBotConnection(chatId: ID): Promise;
/**
* Set the current account's TTL. User-only.
*
* @method ac
* @param dayCount The current account's TTL in days.
*/
abstract setAccountTtl(dayCount: number): Promise;
/**
* Set the birthday of the current user. User-only.
*
* @method ac
*/
abstract setBirthday(params?: SetBirthdayParams): Promise;
/**
* Set the emoji status of a channel. User-only.
*
* @method ac
* @param chatId The identifier of a channel.
* @param emojiStatus The emoji or gift to set as the new emoji status.
*/
abstract setChannelEmojiStatus(chatId: ID, emojiStatus: InputEmojiStatus, params?: SetEmojiStatusParams): Promise;
/**
* Set the list of close friends. User-only.
*
* @method ac
* @param userIds The identifiers of users to set as close friends.
*/
abstract setCloseFriends(userIds: ID[]): Promise;
/**
* Set the current account's emoji status. User-only.
*
* @method ac
* @param emojiStatus The emoji or gift to set as the new emoji status.
*/
abstract setEmojiStatus(emojiStatus: InputEmojiStatus, params?: SetEmojiStatusParams): Promise;
/**
* Set the current account's online status. User-only.
*
* @method ac
* @param isOnline The new online status.
*/
abstract setIsOnline(isOnline: boolean): Promise;
/**
* Set the location of the current user. User-only.
*
* @method ac
*/
abstract setLocation(params?: SetLocationParams): Promise;
/**
* Set the name color of the current user. User-only.
*
* @method ac
* @param color The identifier of the color to set.
*/
abstract setNameColor(color: number, params?: SetNameColorParams): Promise;
/**
* Set the personal channel of the current user. User-only.
*
* @method ac
*/
abstract setPersonalChannel(params?: SetPersonalChannelParams): Promise;
/**
* Set the profile color of the current user. User-only.
*
* @method ac
* @param color The identifier of the color to set.
*/
abstract setProfileColor(color: number, params?: SetProfileColorParams): Promise;
/**
* Set the emoji status of a bot's user. Bot-only.
*
* @method ac
* @param userId The identifier of a user of the bot.
* @param emojiStatus The emoji or gift to set as the new emoji status.
*/
abstract setUserEmojiStatus(userId: ID, emojiStatus: InputEmojiStatus, params?: SetEmojiStatusParams): Promise;
/**
* Set the username of the current account. User-only.
*
* @method ac
* @param username The username to set.
*/
abstract setUsername(username: string): Promise;
/**
* Set the working hours of the current user. User-only.
*
* @method ac
*/
abstract setWorkingHours(params?: SetWorkingHoursParams): Promise;
/**
* Show a username in the current account, a bot account, a supergroup, or a channel's profile. User-only.
*
* @method ac
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
* @param username The username to show.
*/
abstract showUsername(id: ID, username: string): Promise;
/**
* Suggest a birthday. User-only.
*
* @method ac
* @param userId The identifier of the user to suggest a birthday for.
* @param birthday The birthday to suggest.
*/
abstract suggestBirthday(userId: ID, birthday: Birthday): Promise;
/**
* Unblock a user. User-only.
*
* @method ac
* @param userId The identifier of the user to unblock.
*/
abstract unblockUser(userId: ID): Promise;
/**
* Update the profile of the current user. At least one parameter must be specified. User-only.
*
* @method ac
*/
abstract updateProfile(params?: UpdateProfileParams): Promise;
/**
* Update the profile photo of the current user or a bot managed by the current user.
*
* @method ac
* @param photo The photo to set as profile photo.
*/
abstract updateProfilePhoto(photo: FileSource, params?: UpdateProfilePhotoParams): Promise;
/**
* Update the profile video of the current user or a bot managed by the current user.
*
* @method ac
* @param video The video to set as profile video.
*/
abstract updateProfileVideo(video: FileSource, params?: UpdateProfileVideoParams): Promise;
/**
* Add a sticker to favorites. User-only.
*
* @method ms
* @param fileId The file identifier of the sticker.
*/
abstract addStickerToFavorites(fileId: string): Promise;
/**
* Add a sticker to recents. User-only.
*
* @method ms
* @param fileId The file identifier of the sticker.
*/
abstract addStickerToRecents(fileId: string): Promise;
/**
* Clear all message drafts. User-only.
*
* @method ms
*/
abstract clearDrafts(): Promise;
/**
* Clear recent stickers. User-only.
*
* @method ms
*/
abstract clearRecentStickers(): Promise;
/**
* Delete all messages sent by a specific member of a chat. User-only.
*
* @method ms
* @param chatId The identifier of a chat. Must be a supergroup.
* @param memberId The identifier of the member.
*/
abstract deleteChatMemberMessages(chatId: ID, memberId: ID): Promise;
/**
* Delete a single message.
*
* @method ms
* @param chatId The identifier of the chat which the message belongs to.
* @param messageId The identifier of the message to delete.
*/
abstract deleteMessage(chatId: ID, messageId: number, params?: DeleteMessageParams): Promise;
/**
* Delete multiple messages.
*
* @method ms
* @param chatId The identifier of the chat which the message belongs to.
* @param messageIds The identifiers of the messages to delete.
*/
abstract deleteMessages(chatId: ID, messageIds: number[], params?: DeleteMessagesParams): Promise;
/**
* Delete a scheduled message.
*
* @method ms
* @param chatId The identifier of a chat.
* @param messageId The identifier of the scheduled message to delete.
*/
abstract deleteScheduledMessage(chatId: ID, messageId: number): Promise;
/**
* Delete multiple scheduled messages.
*
* @method ms
* @param chatId The identifier of a chat.
* @param messageIds The identifiers of the scheduled messages to delete.
*/
abstract deleteScheduledMessages(chatId: ID, messageIds: number[]): Promise;
/**
* Edit an inline message's caption. Bot-only.
*
* @method ms
* @param inlineMessageId The identifier of the inline message.
*/
abstract editInlineMessageCaption(inlineMessageId: string, params?: EditInlineMessageCaptionParams): Promise;
/**
* Edit an inline message's live location. Bot-only.
*
* @method ms
* @param inlineMessageId The identifier of the inline message.
* @param latitude The new latitude.
* @param longitude The new longitude.
* @returns The edited location message.
*/
abstract editInlineMessageLiveLocation(inlineMessageId: string, latitude: number, longitude: number, params?: EditMessageLiveLocationParams): Promise;
/**
* Edit an inline message's media.
*
* @method ms
* @param inlineMessageId The identifier of the inline message.
* @param media The new media of the message.
*/
abstract editInlineMessageMedia(inlineMessageId: string, media: InputMedia, params?: EditInlineMessageMediaParams): Promise;
/**
* Edit an inline message's reply markup. Bot-only.
*
* @method ms
* @param inlineMessageId The identifier of the inline message.
*/
abstract editInlineMessageReplyMarkup(inlineMessageId: string, params?: EditMessageReplyMarkupParams): Promise;
/**
* Edit an inline message's rich text. Bot-only.
*
* @method ms
* @param inlineMessageId The identifier of the inline message.
* @param richText The new rich text of the message.
*/
abstract editInlineMessageRichText(inlineMessageId: string, richText: InputRichText, params?: EditInlineMessageRichTextParams): Promise;
/**
* Edit an inline message's text. Bot-only.
*
* @method ms
* @param inlineMessageId The identifier of the inline message.
* @param text The new text of the message.
*/
abstract editInlineMessageText(inlineMessageId: string, text: string, params?: EditInlineMessageTextParams): Promise;
/**
* Edit a message's caption.
*
* @method ms
* @param chatId The identifier of the chat which the message belongs to.
* @param messageId The identifier of the message.
* @returns The edited message.
*/
abstract editMessageCaption(chatId: ID, messageId: number, params?: EditMessageCaptionParams): Promise;
/**
* Edit a message's live location.
*
* @method ms
* @param chatId The identifier of the chat which the message belongs to.
* @param messageId The identifier of the message.
* @param latitude The new latitude.
* @param longitude The new longitude.
* @returns The edited location message.
*/
abstract editMessageLiveLocation(chatId: ID, messageId: number, latitude: number, longitude: number, params?: EditMessageLiveLocationParams): Promise;
/**
* Edit a message's media.
*
* @method ms
* @param chatId The identifier of the chat which the message belongs to.
* @param messageId The identifier of the message.
* @param media The new media of the message.
* @returns The edited message.
*/
abstract editMessageMedia(chatId: ID, messageId: number, media: InputMedia, params?: EditMessageMediaParams): Promise;
/**
* Edit a message's reply markup.
*
* @method ms
* @param chatId The identifier of the chat which the message belongs to.
* @param messageId The identifier of the message.
* @returns The edited message.
*/
abstract editMessageReplyMarkup(chatId: ID, messageId: number, params?: EditMessageReplyMarkupParams): Promise;
/**
* Edit a message's rich text.
*
* @method ms
* @param chatId The identifier of the chat which the message belongs to.
* @param messageId The identifier of the message.
* @param richText The new rich text of the message.
* @returns The edited rich text message.
*/
abstract editMessageRichText(chatId: ID, messageId: number, richText: InputRichText, params?: EditMessageRichTextParams): Promise;
/**
* Edit a message's text.
*
* @method ms
* @param chatId The identifier of the chat which the message belongs to.
* @param messageId The identifier of the message.
* @param text The new text of the message.
* @returns The edited text message.
*/
abstract editMessageText(chatId: ID, messageId: number, text: string, params?: EditMessageTextParams): Promise;
/**
* Forward a single message.
*
* @method ms
* @param from The identifier of a chat to forward the message from.
* @param to The identifier of a chat to forward the message to.
* @param messageId The identifier of the message to forward.
* @returns The forwarded message.
*/
abstract forwardMessage(from: ID, to: ID, messageId: number, params?: ForwardMessagesParams): Promise;
/**
* Forward multiple messages.
*
* @method ms
* @param from The identifier of a chat to forward the messages from.
* @param to The identifier of a chat to forward the messages to.
* @param messageIds The identifiers of the messages to forward.
* @returns The forwarded messages.
*/
abstract forwardMessages(from: ID, to: ID, messageIds: number[], params?: ForwardMessagesParams): Promise;
/**
* Get favorite stickers. User-only.
*
* @method ms
*/
abstract getFavoriteStickers(): Promise;
/**
* Get the link preview for a message that is about to be sent. User-only.
*
* @method ms
* @param text The message's text.
*/
abstract getLinkPreview(text: string, params?: GetLinkPreviewParams): Promise;
/**
* Retrieve a single message.
*
* @method ms
* @param chatId The identifier of a chat.
* @param messageId The identifier of the message to retrieve.
* @example ```ts
* const message = await client.getMessage("@MTKruto", 212);
* ```
* @returns The retrieved message.
* @cache
*/
abstract getMessage(chatId: ID, messageId: number): Promise;
/**
* Get the counters of a single message. User-only.
*
* @method ms
* @param chatId The identifier of the chat including the message.
* @param messageId The identifier of the message.
*/
abstract getMessageCounters(chatId: ID, messageId: number): Promise;
/**
* Get a list of reactions made to a message. User-only.
*
* @method ms
* @param chatId The identifier of a chat.
* @param messageId The identifier of the message.
*/
abstract getMessageReactions(chatId: ID, messageId: number, params?: GetMessageReactionsParams): Promise;
/**
* Get a message's read date. User-only.
*
* @method ms
* @param chatId The identifier of a chat.
* @param messageId The identifier of the message.
*/
abstract getMessageReadDate(chatId: ID, messageId: number): Promise;
/**
* Retrieve multiple messages.
*
* @method ms
* @param chatId The identifier of a chat to retrieve the messages from.
* @param messageIds The identifiers of the messages to retrieve.
* @example ```ts
* const messages = await client.getMessages("@MTKruto", [210, 212]);
* ```
* @returns The retrieved messages.
* @cache
*/
abstract getMessages(chatId: ID, messageIds: number[]): Promise;
/**
* Get the counters of multiple messages. User-only.
*
* @method ms
* @param chatId The identifier of the chat including the messages.
* @param messageIds The identifiers of the messages.
*/
abstract getMessagesCounters(chatId: ID, messageIds: number[]): Promise;
/**
* Get a message's viewers. User-only.
*
* @method ms
* @param chatId The identifier of a chat.
* @param messageId The identifier of the message.
* @returns The message's viewers.
*/
abstract getMessageViewers(chatId: ID, messageId: number): Promise;
/**
* Get a progress ID that can be passed to relevant send* methods to receive upload progress updates for them.
*
* @method ms
* @cache
*/
abstract getProgressId(): Promise;
/**
* Get recent stickers. User-only.
*
* @method ms
*/
abstract getRecentStickers(): Promise;
/**
* Get a message's full rich text. User-only.
*
* @method ms
* @param chatId The identifier of the chat including the message.
* @param messageId The identifier of the message.
*/
abstract getRichText(chatId: ID, messageId: number): Promise;
/**
* Get saved animations. User-only.
*
* @method ms
*/
abstract getSavedAnimations(): Promise;
/**
* Get a list of saved chats.
*
* @method ms
*/
abstract getSavedChats(params?: GetSavedChatsParams): Promise;
/**
* Get messages saved from a specific chat.
*
* @method ms
* @param chatId The identifier of a chat.
*/
abstract getSavedMessages(chatId: ID, params?: GetSavedMessagesParams): Promise;
/**
* Get the scheduled messages of a chat. User-only.
*
* @method ms
* @param chatId The identifier of the chat including the scheduled messages.
*/
abstract getScheduledMessages(chatId: ID): Promise;
/**
* Open a mini app. User-only.
*
* @method ms
* @param botId The identifier of a bot with the mini app.
* @param chatId The identifier of the chat from which the mini app is opened.
* @cache
*/
abstract openMiniApp(botId: ID, chatId: ID, params?: OpenMiniAppParams): Promise;
/**
* Pin a message in a chat.
*
* @method ms
* @param chatId The identifier of a chat.
* @param messageId The identifier of the message.
*/
abstract pinMessage(chatId: ID, messageId: number, params?: PinMessageParams): Promise;
/**
* Mark messages as read. User-only.
*
* @method ms
* @param chatId The identifier of the chat which the messages belong to.
* @param untilMessageId The identifier of the message that will be marked as read, along with any other unread messages before it.
*/
abstract readMessages(chatId: ID, untilMessageId: number): Promise;
/**
* Remove a sticker from favorites. User-only.
*
* @method ms
* @param fileId The file identifier of the sticker.
*/
abstract removeStickerFromFavorites(fileId: string): Promise;
/**
* Remove a sticker from recents. User-only.
*
* @method ms
* @param fileId The file identifier of the sticker.
*/
abstract removeStickerFromRecents(fileId: string): Promise;
/**
* Retrieve a message using its link.
*
* @method ms
* @param link A message link.
* @example ```ts
* const message = await client.resolveMessageLink("https://t.me/MTKruto/212");
* ```
* @returns The message that was linked to.
*/
abstract resolveMessageLink(link: string): Promise;
/**
* Save an animation. User-only.
*
* @method ms
* @param fileId The file identifier of the animation.
*/
abstract saveAnimation(fileId: string): Promise;
/**
* Search for messages. User-only.
*
* @method ms
*/
abstract searchMessages(params?: SearchMessagesParams): Promise;
/**
* Send an animation.
*
* @method ms
* @param chatId The identifier of a chat to send the animation to.
* @param animation The animation to send.
* @returns The sent animation.
*/
abstract sendAnimation(chatId: ID, animation: FileSource, params?: SendAnimationParams): Promise;
/**
* Send an audio file.
*
* @method ms
* @param chatId The identifier of a chat to send the audio file to.
* @param audio The audio to send.
* @returns The sent audio file.
*/
abstract sendAudio(chatId: ID, audio: FileSource, params?: SendAudioParams): Promise;
/**
* Send a chat action.
*
* @method ms
* @param chatId The identifier of a chat to send the chat action to.
* @param action The chat action.
*/
abstract sendChatAction(chatId: ID, action: ChatActionType, params?: {
messageThreadId?: number;
}): Promise;
/**
* Send a checklist.
*
* @method ms
* @param chatId The identifier of a chat to send the checklist to.
* @param title The checklist's title.
* @param items The checklist's items.
* @returns The sent checklist.
*/
abstract sendChecklist(chatId: ID, title: string, items: InputChecklistItem[], params?: SendChecklistParams): Promise;
/**
* Send a contact.
*
* @method ms
* @param chatId The identifier of a chat to send the contact to.
* @param firstName The contact's first name.
* @param phoneNumber The contact's phone number.
* @returns The sent contact.
*/
abstract sendContact(chatId: ID, firstName: string, phoneNumber: string, params?: SendContactParams): Promise;
/**
* Send a dice.
*
* @method ms
* @param chatId The identifier of a chat to send the dice to.
* @returns The sent dice.
*/
abstract sendDice(chatId: ID, params?: SendDiceParams): Promise;
/**
* Send a document.
*
* @method ms
* @param chatId The identifier of a chat to send the document to.
* @param document The document to send.
* @returns The sent document.
*/
abstract sendDocument(chatId: ID, document: FileSource, params?: SendDocumentParams): Promise;
/**
* Send an invoice. Bot-only.
*
* @method ms
* @param chatId The identifier of a chat to send the invoice to.
* @param title The invoice's title.
* @param description The invoice's description.
* @param payload The invoice's payload.
* @param currency The invoice's currency.
* @param prices The invoice's price tags.
* @returns The sent invoice.
*/
abstract sendInvoice(chatId: ID, title: string, description: string, payload: string, currency: string, prices: PriceTag[], params?: SendInvoiceParams): Promise;
/**
* Send a live photo.
*
* @method ms
* @param chatId The identifier of a chat to send the photo to.
* @param photo The photo to send.
* @param video The video version of the photo.
* @returns The sent live photo.
*/
abstract sendLivePhoto(chatId: ID, photo: FileSource, video: FileSource, params?: SendLivePhotoParams): Promise;
/**
* Send a location.
*
* @method ms
* @param chatId The identifier of a chat to send the location to.
* @param latitude The location's latitude.
* @param longitude The location's longitude.
* @returns The sent location.
*/
abstract sendLocation(chatId: ID, latitude: number, longitude: number, params?: SendLocationParams): Promise;
/**
* Send a media group.
*
* @method ms
* @param chatId The identifier of a chat to send the media group to.
* @param media The media to include in the media group. Animations are not allowed. All of them must be of the same media type, but an exception is that photos and videos can be mixed.
* @returns The sent messages.
*/
abstract sendMediaGroup(chatId: ID, media: InputMedia[], params?: SendMediaGroupParams): Promise;
/**
* Send a text message.
*
* @method ms
* @param chatId The identifier of a chat to send the message to.
* @param text The message's text.
* @returns The sent text message.
*/
abstract sendMessage(chatId: ID, text: string, params?: SendMessageParams): Promise;
/**
* Stream a drafted text message. Bot-only.
*
* @method ms
* @param chatId The identifier of a chat to send the message to.
* @param draftId The identifier of the draft.
* @param text The message's text.
*/
abstract sendMessageDraft(chatId: ID, draftId: number, text: string, params?: SendMessageDraftParams): Promise;
/**
* Send a photo.
*
* @method ms
* @param chatId The identifier of a chat to send the photo to.
* @param photo The photo to send.
* @returns The sent photo.
*/
abstract sendPhoto(chatId: ID, photo: FileSource, params?: SendPhotoParams): Promise;
/**
* Send a poll.
*
* @method ms
* @param chatId The identifier of a chat to send the poll to.
* @param question The poll's question.
* @param options The poll's options.
* @returns The sent poll.
*/
abstract sendPoll(chatId: ID, question: string, options: InputPollOption[], params?: SendPollParams): Promise;
/**
* Send a rich text message.
*
* @method ms
* @param chatId The identifier of a chat to send the message to.
* @param richText The message's rich text.
* @returns The sent rich text message.
*/
abstract sendRichText(chatId: ID, richText: InputRichText, params?: SendRichTextParams): Promise;
/**
* Stream a drafted rich text message. Bot-only.
*
* @method ms
* @param chatId The identifier of a chat to send the message to.
* @param draftId The identifier of the draft.
* @param richText The message's rich text.
*/
abstract sendRichTextDraft(chatId: ID, draftId: number, richText: InputRichText, params?: SendRichTextDraftParams): Promise;
/**
* Send a scheduled message before its schedule.
*
* @method ms
* @param chatId The identifier of a chat.
* @param messageId The identifier of the scheduled message to send.
*/
abstract sendScheduledMessage(chatId: ID, messageId: number): Promise;
/**
* Send multiple scheduled messages before their schedule.
*
* @method ms
* @param chatId The identifier of a chat.
* @param messageIds The identifiers of the scheduled messages to send.
*/
abstract sendScheduledMessages(chatId: ID, messageIds: number[]): Promise;
/**
* Send a screenshot notification. User-only.
*
* @method ms
* @param chatId The identifier of a chat.
* @param replyToMessageId The identifier of the message.
*/
abstract sendScreenshotNotification(chatId: ID, replyToMessageId: number): Promise;
/**
* Send a sticker.
*
* @method ms
* @param chatId The identifier of a chat to send the sticker to.
* @param sticker The sticker to send.
* @returns The sent sticker.
*/
abstract sendSticker(chatId: ID, sticker: FileSource, params?: SendStickerParams): Promise;
/**
* Send a venue.
*
* @method ms
* @param chatId The identifier of a chat to send the venue to.
* @param latitude The latitude of the venue.
* @param longitude The longitude of the venue.
* @param title The title of the venue.
* @param address The written address of the venue.
* @returns The sent venue.
*/
abstract sendVenue(chatId: ID, latitude: number, longitude: number, title: string, address: string, params?: SendVenueParams): Promise;
/**
* Send a video.
*
* @method ms
* @param chatId The identifier of a chat to send the video to.
* @param video The video to send.
* @returns The sent video.
*/
abstract sendVideo(chatId: ID, video: FileSource, params?: SendVideoParams): Promise;
/**
* Send a video note.
*
* @method ms
* @param chatId The identifier of a chat to send the video note to.
* @param videoNote The video note to send.
* @returns The sent video note.
*/
abstract sendVideoNote(chatId: ID, videoNote: FileSource, params?: SendVideoNoteParams): Promise;
/**
* Send a voice message.
*
* @method ms
* @param chatId The identifier of a chat to send the voice message to.
* @param voice The voice to send.
* @returns The sent voice message.
*/
abstract sendVoice(chatId: ID, voice: FileSource, params?: SendVoiceParams): Promise;
/**
* Set a reaction as default. User-only.
*
* @method ms
* @param reaction The reaction to set as default.
*/
abstract setDefaultReaction(reaction: Reaction): Promise;
/**
* Start a bot. User-only.
*
* @method ms
* @param botId The identifier of the bot to start.
* @returns The start message.
*/
abstract startBot(botId: number, params?: StartBotParams): Promise;
/**
* Stop a poll.
*
* @method ms
* @param chatId The chat that includes the poll.
* @param messageId The identifier of the poll's message.
* @returns The new state of the poll.
*/
abstract stopPoll(chatId: ID, messageId: number, params?: StopPollParams): Promise;
/**
* Summarize a message's text. User-only.
*
* @method ms
* @param chatId The identifier of a chat.
* @param messageId The identifier of a message.
*/
abstract summarizeText(chatId: ID, messageId: number, params?: SummarizeTextParams): Promise;
/**
* Transcribe a voice message. User-only.
*
* @method ms
* @param chatId The identifier of the chat which the message belongs to.
* @param messageId The identifier of the message.
* @cache
*/
abstract transcribeVoice(chatId: ID, messageId: number): Promise;
/**
* Translate a single text. User-only.
*
* @method ms
* @param toLanguage The code of the language to translate into.
* @param chatId The identifier of the chat including the message.
* @param messageId The identifier of the message to translate.
*/
abstract translateMessage(toLanguage: string, chatId: ID, messageId: number, params?: TranslateTextParams): Promise;
/**
* Translate multiple texts. User-only.
*
* @method ms
* @param toLanguage The code of the language to translate into.
* @param chatId The identifier of the chat including the messages.
* @param messageIds The identifiers of the messages to translate.
*/
abstract translateMessages(toLanguage: string, chatId: ID, messageIds: number[], params?: TranslateTextParams): Promise;
/**
* Translate a single text. User-only.
*
* @method ms
* @param toLanguage The code of the language to translate into.
* @param text The text to translate.
*/
abstract translateText(toLanguage: string, text: TextToTranslate, params?: TranslateTextParams): Promise;
/**
* Translate multiple texts. User-only.
*
* @method ms
* @param toLanguage The code of the language to translate into.
* @param texts The texts to translate.
*/
abstract translateTexts(toLanguage: string, texts: TextToTranslate[], params?: TranslateTextParams): Promise;
/**
* Unpin a pinned message.
*
* @method ms
* @param chatId The identifier of a chat.
* @param messageId The identifier of the message.
*/
abstract unpinMessage(chatId: ID, messageId: number, params?: UnpinMessageParams): Promise;
/**
* Unpin all pinned messages.
*
* @method ms
* @param chatId The identifier of a chat.
*/
abstract unpinMessages(chatId: ID, params?: UnpinMessagesParams): Promise;
/**
* Unsave an animation. User-only.
*
* @method ms
* @param fileId The file identifier of the animation.
*/
abstract unsaveAnimation(fileId: string): Promise;
/**
* View a single message. User-only.
*
* @method ms
* @param chatId The identifier of the chat including the message.
* @param messageId The identifier of the message.
*/
abstract viewMessage(chatId: ID, messageId: number): Promise;
/**
* View multiple messages. User-only.
*
* @method ms
* @param chatId The identifier of the chat including the messages.
* @param messageIds The identifiers of the messages.
*/
abstract viewMessages(chatId: ID, messageIds: number[]): Promise;
/**
* Add an option to a poll. User-only.
*
* @method pl
* @param chatId The identifier of the chat that includes the poll.
* @param messageId The identifier of the message that includes the poll.
* @param option The option to add.
*/
abstract addPollOption(chatId: ID, messageId: number, option: InputPollOption): Promise;
/**
* Get poll voters. User-only.
*
* @method pl
* @param chatId The identifier of the chat that includes the poll.
* @param messageId The identifier of the message that includes the poll.
*/
abstract getPollVoters(chatId: ID, messageId: number, params?: GetPollVotersParams): Promise;
/**
* Remove an option from a poll. User-only.
*
* @method pl
* @param chatId The identifier of the chat that includes the poll.
* @param messageId The identifier of the message that includes the poll.
* @param optionIndex The index of the option to remove.
*/
abstract removePollOption(chatId: ID, messageId: number, optionIndex: number): Promise;
/**
* Retract a vote. User-only.
*
* @method pl
* @param chatId The identifier of the chat that includes the poll.
* @param messageId The identifier of the message that includes the poll.
*/
abstract retractVote(chatId: ID, messageId: number): Promise;
/**
* Cast a vote. User-only.
*
* @method pl
* @param chatId The identifier of the chat that includes the poll.
* @param messageId The identifier of the message that includes the poll.
* @param optionIndexes The indexes of the options to cast for.
*/
abstract vote(chatId: ID, messageId: number, optionIndexes: number[]): Promise;
/**
* Add items to a checklist. User-only.
*
* @param chatId The identifier of a chat.
* @param messageId The identifier of the checklist message.
* @param items The items to add.
* @method cl
*/
abstract addToChecklist(chatId: ID, messageId: number, items: InputChecklistItem[]): Promise;
/**
* Check a single item of a checklist. User-only.
*
* @param chatId The identifier of a chat.
* @param messageId The identifier of the checklist message.
* @param item The identifier of the item to check.
* @method cl
*/
abstract checkChecklistItem(chatId: ID, messageId: number, item: number): Promise;
/**
* Check multiple items of a checklist. User-only.
*
* @param chatId The identifier of a chat.
* @param messageId The identifier of the checklist message.
* @param items The identifiers of the items to check.
* @method cl
*/
abstract checkChecklistItems(chatId: ID, messageId: number, items: number[]): Promise;
/**
* Uncheck a single item of a checklist. User-only.
*
* @param chatId The identifier of a chat.
* @param messageId The identifier of the checklist message.
* @param item The identifier of the item to uncheck.
* @method cl
*/
abstract uncheckChecklistItem(chatId: ID, messageId: number, item: number): Promise;
/**
* Uncheck multiple items of a checklist. User-only.
*
* @param chatId The identifier of a chat.
* @param messageId The identifier of the checklist message.
* @param items The identifiers of the items to uncheck.
* @method cl
*/
abstract uncheckChecklistItems(chatId: ID, messageId: number, items: number[]): Promise;
/**
* Update a checklist. User-only.
*
* @param chatId The identifier of a chat.
* @param messageId The identifier of the checklist message.
* @method cl
*/
abstract updateChecklist(chatId: ID, messageId: number, params?: UpdateChecklistParams): Promise;
/**
* Download a file.
*
* @method fs
* @param fileId The identifier of the file to download.
* @example ```ts
* for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
* await outFile.write(chunk);
* }
* ```
* @returns A generator yielding the contents of the file.
* @cache file
*/
abstract download(fileId: string, params?: DownloadParams): AsyncGenerator;
/**
* Download a chunk of a file.
*
* @method fs
* @param fileId The identifier of a file.
* @example ```ts
* const chunk = await client.downloadChunk(fileId, { chunkSize: 256 * 1024 });
* ```
* @returns The downloaded chunk.
* @cache file
*/
abstract downloadChunk(fileId: string, params?: DownloadParams): Promise;
/**
* Get custom emoji documents for download.
*
* @method fs
* @param id Identifier of one or more custom emojis.
* @returns The custom emoji documents.
* @cache
*/
abstract getCustomEmojiStickers(id: string | string[]): Promise;
/**
* Add a single user to a chat.
*
* @method ch
* @param chatId The identifier of a chat to add the user to.
* @param userId The identifier of the user to add to the chat.
* @returns An array of FailedInvitation that has at most a length of 1. If empty, it means that the user was added.
*/
abstract addChatMember(chatId: ID, userId: ID, params?: AddChatMemberParams): Promise;
/**
* Add multiple users at once to a channel or a supergroup.
*
* @method ch
* @param chatId The identifier of the channel or supergroup to add the users to.
* @param userIds The identifiers of the users to add to the channel or supergroup.
* @returns An array of FailedInvitation that has at most a length that is the same as that of the parameter userIds. If empty, it means that all the provided users were added.
*/
abstract addChatMembers(chatId: ID, userIds: ID[]): Promise;
/**
* Approve a join request.
*
* @method ch
* @param chatId The identifier of a chat with the join request.
* @param userId The user who made the join request.
*/
abstract approveJoinRequest(chatId: ID, userId: ID): Promise;
/**
* Approve all join requests. User-only.
*
* @method ch
* @param chatId The identifier of a chat with the join requests.
*/
abstract approveJoinRequests(chatId: ID, params?: ApproveJoinRequestsParams): Promise;
/**
* Archive a single chat. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
*/
abstract archiveChat(chatId: ID): Promise;
/**
* Archive multiple chats. User-only.
*
* @method ch
* @param chatIds The identifiers of the chats to archive.
*/
abstract archiveChats(chatIds: ID[]): Promise;
/**
* Ban a member from a chat.
*
* @method ch
* @param chatId The identifier of a chat.
* @param memberId The identifier of the member.
*/
abstract banChatMember(chatId: ID, memberId: ID, params?: BanChatMemberParams): Promise;
/**
* Close a chat previously opened by openChat.
*
* @method ch
* @param chatId The identifier of a chat to close.
*/
abstract closeChat(chatId: ID): Promise;
/**
* Close a forum topic.
*
* @method ch
* @param chatId The identifier of a chat.
* @param topicId The identifier of the topic.
*/
abstract closeTopic(chatId: ID, topicId: number): Promise;
/**
* Create a channel. User-only.
*
* @method ch
* @param title The title of the channel.
* @returns The created channel.
*/
abstract createChannel(title: string, params?: CreateChannelParams): Promise;
/**
* Create a group. User-only.
*
* @method ch
* @param title The title of the group.
* @returns The created group.
*/
abstract createGroup(title: string, params?: CreateGroupParams): Promise;
/**
* Create an invite link.
*
* @method ch
* @param chatId The identifier of a chat to create the invite link for.
* @returns The newly created invite link.
*/
abstract createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise;
/**
* Create a supergroup. User-only.
*
* @method ch
* @param title The title of the supergroup.
* @returns The created supergroup.
*/
abstract createSupergroup(title: string, params?: CreateSupergroupParams): Promise;
/**
* Create a forum topic.
*
* @method ch
* @param chatId The identifier of a chat.
* @param title The title of the topic.
* @returns The created topic.
*/
abstract createTopic(chatId: ID, title: string, params?: CreateTopicParams): Promise;
/**
* Decline a join request.
*
* @method ch
* @param chatId The identifier of a chat with the join request.
* @param userId The user who made the join request.
*/
abstract declineJoinRequest(chatId: ID, userId: ID): Promise;
/**
* Decline all join requests. User-only.
*
* @method ch
* @param chatId The identifier of a chat with the join requests.
*/
abstract declineJoinRequests(chatId: ID, params?: DeclineJoinRequestsParams): Promise;
/**
* Delete a chat. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
*/
abstract deleteChat(chatId: ID): Promise;
/**
* Delete a chat's photo.
*
* @method ch
* @param chatId The identifier of a chat.
*/
abstract deleteChatPhoto(chatId: ID): Promise;
/**
* Delete a chat's sticker set.
*
* @method ch
* @param chatId The identifier of a chat. Must be a supergroup.
*/
abstract deleteChatStickerSet(chatId: ID): Promise;
/**
* Disable automatic anti-spam in a group. User-only.
*
* @method ch
* @param chatId The identifier of the group.
*/
abstract disableAntispam(chatId: ID): Promise;
/**
* Disable business bots in a private chat. User-only.
*
* @method ch
* @param chatId The identifier of the private chat to disable business bots in.
*/
abstract disableBusinessBots(chatId: ID): Promise;
/**
* Disable chat history for new members. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
*/
abstract disableChatHistoryForNewMembers(chatId: ID): Promise;
/**
* Disable join requests in a chat. User-only.
*
* @method ch
* @param chatId The identifier of a chat. Must be a channel or a supergroup.
*/
abstract disableJoinRequests(chatId: ID): Promise;
/**
* Disable sharing in a chat. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
*/
abstract disableSharing(chatId: ID): Promise;
/**
* Disable post signatures in a channel. User-only.
*
* @method ch
* @param chatId The identifier of the channel.
*/
abstract disableSignatures(chatId: ID): Promise;
/**
* Disable slow mode in a group. User-only.
*
* @method ch
* @param chatId The identifier of the group to disable slow mode in.
*/
abstract disableSlowMode(chatId: ID): Promise;
/**
* Disable topics in a group. User-only.
*
* @method ch
* @param chatId The identifier of the group.
*/
abstract disableTopics(chatId: ID): Promise;
/**
* Edit a forum topic.
*
* @method ch
* @param chatId The identifier of a chat.
* @param topicId The identifier of the topic.
* @param title The new title of the topic.
* @returns The new topic.
*/
abstract editTopic(chatId: ID, topicId: number, title: string, params?: EditTopicParams): Promise;
/**
* Enable automatic anti-spam in a group. User-only.
*
* @method ch
* @param chatId The identifier of the group.
*/
abstract enableAntispam(chatId: ID): Promise;
/**
* Enable business bots in a private chat. User-only.
*
* @method ch
* @param chatId The identifier of the private chat to enable business bots in.
*/
abstract enableBusinessBots(chatId: ID): Promise;
/**
* Enable chat history for new members. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
*/
abstract enableChatHistoryForNewMembers(chatId: ID): Promise;
/**
* Enable join requests in a chat. User-only.
*
* @method ch
* @param chatId The identifier of a chat. Must be a channel or a supergroup.
*/
abstract enableJoinRequests(chatId: ID): Promise;
/**
* Enable sharing in a chat. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
*/
abstract enableSharing(chatId: ID): Promise;
/**
* Enable post signatures in a channel. User-only.
*
* @method ch
* @param chatId The identifier of the channel.
*/
abstract enableSignatures(chatId: ID, params?: EnableSignaturesParams): Promise;
/**
* Enable topics in a group. User-only.
*
* @method ch
* @param chatId The identifier of the group.
* @param isShownAsTabs Whether topics should be displayed as tabs.
*/
abstract enableTopics(chatId: ID, isShownAsTabs: boolean): Promise;
/**
* Get a chat.
*
* @method ch
* @cache
*/
abstract getChat(chatId: ID): Promise;
/**
* Get the administrators of a chat.
*
* @method ch
* @param chatId The identifier of a chat.
* @returns The chat's administrators.
*/
abstract getChatAdministrators(chatId: ID): Promise;
/**
* Get information on a user's chat membership.
*
* @method ch
* @param chatId The identifier of a chat.
* @param userId The identifier of the user.
*/
abstract getChatMember(chatId: ID, userId: ID): Promise;
/**
* Get the members of a chat.
*
* @method ch
* @param chatId The identifier of a chat.
*/
abstract getChatMembers(chatId: ID, params?: GetChatMembersParams): Promise;
/**
* Get a partial chat.
*
* @method ch
* @cache
*/
abstract getChatP(chatId: ID): Promise;
/**
* Get chats from a chat list. User-only.
*
* @method ch
*/
abstract getChats(params?: GetChatsParams): Promise;
/**
* Get the settings of a chat. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
*/
abstract getChatSettings(chatId: ID): Promise;
/**
* Get common chats between a user and the current one. User-only.
*
* @method ch
* @param userId The identifier of the user to get the common chats with them.
*/
abstract getCommonChats(userId: ID, params?: GetCommonChatsParams): Promise;
/**
* Get the invite links created for a chat. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
* @returns The invite links created for the chat. This might be a subset of the results if they were less than `limit`. The parameters `afterDate` and `afterInviteLink` can be used for pagination.
*/
abstract getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise;
/**
* Get discussion chat suggestions. User-only.
*
* @method ch
*/
abstract getDiscussionChatSuggestions(): Promise;
/**
* Get chat history. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
*/
abstract getHistory(chatId: ID, params?: GetHistoryParams): Promise;
/**
* Get inactive chats. User-only.
*
* @method ch
* @returns A list of inactive chats the current user is a member of.
*/
abstract getInactiveChats(): Promise;
/**
* Get pending join requests in a chat. User-only.
*
* @method ch
* @param chatId The identifier of a chat with the join requests.
*/
abstract getJoinRequests(chatId: ID, params?: GetJoinRequestsParams): Promise;
/**
* Get the count of online members in a chat. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
* @returns The count of online members in the chat.
*/
abstract getOnlineCount(chatId: ID): Promise;
/**
* Get pinned chats from a chat list. User-only.
*
* @method ch
* @param from The chat list to get the pinned chats from. Defaults to main.
*/
abstract getPinnedChats(from?: "archived" | "main"): Promise;
/**
* Get recommended channels. User-only.
*
* @method ch
* @returns A list of recommended channels.
*/
abstract getRecommendedChannels(): Promise;
/**
* Get similar bots. User-only.
*
* @method ch
* @param chatId The identifier of a bot to get similar bots for.
* @returns A list of similar bots.
*/
abstract getSimilarBots(chatId: ID): Promise;
/**
* Get similar channels. User-only.
*
* @method ch
* @param chatId The identifier of a channel to get similar channels for.
* @returns A list of similar channels.
*/
abstract getSimilarChannels(chatId: ID): Promise;
/**
* Get a topic of a forum chat by its identifier. User-only.
*
* @method ch
* @param chatId The identifier of the chat.
* @param topicId The identifier of the topic.
*/
abstract getTopic(chatId: ID, topicId: number): Promise;
/**
* Get the topics of a forum chat. User-only.
*
* @method ch
* @param chatId The identifier of the chat.
*/
abstract getTopics(chatId: ID, params?: GetTopicsParams): Promise;
/**
* Get topics of a forum chat by their identifiers. User-only.
*
* @method ch
* @param chatId The identifier of the chat.
* @param topicIds The identifiers of the topics.
*/
abstract getTopicsById(chatId: ID, topicIds: number[]): Promise;
/**
* Hide the general forum topic.
*
* @method ch
* @param chatId The identifier of a chat.
*/
abstract hideGeneralTopic(chatId: ID): Promise;
/**
* Hide the member list of a group to non-admins. User-only.
*
* @method ch
* @param chatId The identifier of the group.
*/
abstract hideMemberList(chatId: ID): Promise;
/**
* Join a chat. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
*/
abstract joinChat(chatId: ID): Promise;
/**
* Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
*
* @method ch
* @param chatId The identifier of a chat. Must be a supergroup.
* @param memberId The identifier of the member.
*/
abstract kickChatMember(chatId: ID, memberId: ID): Promise;
/**
* Leave a chat.
*
* @method ch
* @param chatId The identifier of a chat.
*/
abstract leaveChat(chatId: ID): Promise;
/**
* Mark all mentions in a chat as read. User-only.
*
* @method ch
* @param chatId The identifier of the chat.
*/
abstract markAllMentionsAsRead(chatId: ID, params?: MarkAllMentionsAsReadParams): Promise;
/**
* Mark a chat as read. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
*/
abstract markChatAsRead(chatId: ID): Promise;
/**
* Mark a chat as unread. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
*/
abstract markChatAsUnread(chatId: ID): Promise;
/**
* Open a chat.
*
* @method ch
* @param chatId The identifier of a chat to open.
*/
abstract openChat(chatId: ID, params?: OpenChatParams): Promise;
/**
* Pin a forum topic.
*
* @method ch
* @param chatId The identifier of a chat.
* @param topicId The identifier of the topic.
*/
abstract pinTopic(chatId: ID, topicId: number): Promise;
/**
* Promote a chat member.
*
* @method ch
* @param chatId The identifier of a chat.
* @param userId The identifier of the user to promote.
*/
abstract promoteChatMember(chatId: ID, userId: ID, params?: PromoteChatMemberParams): Promise;
/**
* Reopen a forum topic.
*
* @method ch
* @param chatId The identifier of a chat.
* @param topicId The identifier of the topic.
*/
abstract reopenTopic(chatId: ID, topicId: number): Promise;
/**
* Report a chat. User-only.
*
* @method ch
* @param chatId The identifier of a chat to report.
* @param reason The reason of the report.
*/
abstract reportChat(chatId: ID, reason: ReportReason, params?: ReportChatParams): Promise;
/**
* Set a chat's available reactions. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
* @param availableReactions The new available reactions.
*/
abstract setAvailableReactions(chatId: ID, availableReactions: AvailableReactions): Promise;
/**
* Set the number of boosts required to circumvent a chat's default restrictions. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
* @param boosts The number of boosts required to circumvent its restrictions.
*/
abstract setBoostsRequiredToCircumventRestrictions(chatId: ID, boosts: number): Promise;
/**
* Change the description of a chat.
*
* @method ch
* @param chatId The identifier of a chat.
* @param description The new description.
*/
abstract setChatDescription(chatId: ID, description: string): Promise;
/**
* Set the rights of a chat member.
*
* @method ch
* @param chatId The identifier of a chat. Must be a supergroup.
* @param memberId The identifier of the member.
*/
abstract setChatMemberRights(chatId: ID, memberId: ID, params?: SetChatMemberRightsParams): Promise;
/**
* Change the tag of a chat member.
*
* @method ch
* @param chatId The identifier of a chat.
* @param userId The identifier of the user that is a member of the chat.
*/
abstract setChatMemberTag(chatId: ID, userId: ID, params?: SetChatMemberTagParams): Promise;
/**
* Set a chat's photo.
*
* @method ch
* @param chatId The identifier of a chat.
* @param photo A photo to set as the chat's photo.
*/
abstract setChatPhoto(chatId: ID, photo: FileSource, params?: SetChatPhotoParams): Promise;
/**
* Set a chat's sticker set.
*
* @method ch
* @param chatId The identifier of a chat. Must be a supergroup.
* @param setName The name of the set.
*/
abstract setChatStickerSet(chatId: ID, setName: string): Promise;
/**
* Change the title of a chat.
*
* @method ch
* @param chatId The identifier of a chat.
* @param title The new title.
*/
abstract setChatTitle(chatId: ID, title: string): Promise;
/**
* Set the default send as chat of a chat. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
* @param sendAs The new default send as chat.
*/
abstract setDefaultSendAs(chatId: ID, sendAs: ID): Promise;
/**
* Set a channel's discussion chat. User-only.
*
* @method ch
* @param chatId The identifier of a channel.
* @param discussionChatId The identifier of a chat to use as discussion for the channel.
*/
abstract setDiscussionChat(chatId: ID, discussionChatId: ID): Promise;
/**
* Set the time to live of the messages of a chat. User-only.
*
* @method ch
* @param chatId The identifier of a chat.
* @param messageTtl The time to live of the messages in seconds.
*/
abstract setMessageTtl(chatId: ID, messageTtl: number): Promise