/**
* 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, Audio, AuthorizationSession, AvailableReactions, Birthday, BlockedUserList, BotAccessSettings, BotCommand, BotTokenCheckResult, BusinessAwayMessageSchedule, BusinessConnection, CallbackQueryAnswer, CallbackQueryQuestion, Chat, ChatActionType, ChatJoinResult, ChatListItem, ChatMember, ChatP, ChatPChannel, ChatPGroup, ChatPPrivate, ChatPSupergroup, ChatSettings, ClaimedGifts, CodeCheckResult, Community, CommunityP, ConnectedWebsite, Country, EmojiStatus, FailedInvitation, FileSource, Gift, GiftCollection, GiftPrivacy, ID, InactiveChat, InlineQueryAnswer, InlineQueryResult, InputBusinessRecipients, InputChecklistItem, InputEmojiStatus, InputGift, InputMedia, InputPollOption, InputPrivacyRule, 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, NewChatPrivacy, NotificationSettings, PasswordCheckResult, Poll, PollVoterList, PremiumSubscriptionDuration, PriceTag, PrivacyRule, PrivacySettingKey, ProfilePhotoList, Reaction, RecentActionsEntry, ReportReason, ReportResult, ResolvedInviteLink, RichText, SavedChats, SavedNotificationSound, SecretChat, SlowModeDuration, StarAmount, StarTransactionList, Sticker, StickerSet, StickerSetP, Story, StoryAlbum, SummarizedText, TextToTranslate, Timezone, TonTransactionList, Topic, TopicList, TopicListItem, TranslatedText, Translation, User, VideoChat, VideoChatActive, VideoChatScheduled, VoiceTranscription } from "../3_types.js";
import type { AddBotToAttachmentsMenuParams, AddChatMemberParams, AddChatToCommunityParams, AddContactParams, AddMusicToProfileParams, AddReactionParams, AddSavedNotificationSoundParams, AddStickerToStickerSetParams, AllowUnpaidMessagesFromUserParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, BoostChatParams, CheckUsernameParams, CreateChannelParams, CreateCommunityParams, CreateGroupParams, CreateInviteLinkParams, CreateStickerSetParams, CreateStoryParams, CreateSupergroupParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteAccountParams, DeleteMessageParams, DeleteMessagesParams, DeleteMyCommandsParams, DisallowUnpaidMessagesFromUserParams, DownloadLiveStreamSegmentParams, DownloadParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageRichTextParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageRichTextParams, EditMessageTextParams, EditStoryParams, EditTopicParams, EnableSignaturesParams, EndSecretChatParams, EndTakeoutSessionParams, ForwardMessagesParams, GetAdministeredChatsParams, GetBlockedUsersParams, GetChatMembersParams, GetChatsParams, GetClaimedGiftsParams, GetCommonChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetLeftChannelsParams, GetLinkPreviewParams, GetMessageReactionsParams, GetMyCommandsParams, GetMyDescriptionParams, GetMyNameParams, GetMyShortDescriptionParams, GetPollVotersParams, GetProfileMusicParams, GetProfilePhotosParams, GetRecentActionsParams, GetSavedChatsParams, GetSavedMessagesParams, GetStarTransactionsParams, GetStoriesInAlbumParams, GetTonTransactionsParams, GetTopicsParams, GetTranslationsParams, GiftPremiumSubscriptionParams, InvokeParams, JoinVideoChatParams, MarkAllMentionsAsReadParams, OpenChatParams, OpenMiniAppParams, PinMessageParams, PromoteChatMemberParams, RemoveProfilePhotoParams, ReplaceStickerInStickerSetParams, ReportChatParams, ReportEphemeralMessageParams, ReportStoryParams, ResolveUsernameParams, SaveDraftParams, SaveRichTextDraftParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChatActionParams, 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, SetBusinessAwayMessageParams, SetBusinessIntroParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams, SetContactNoteParams, SetEmojiStatusParams, SetLocationParams, SetManagedBotAccessSettingsParams, SetMyCommandsParams, SetMyDescriptionParams, SetMyNameParams, SetMyShortDescriptionParams, SetNameColorParams, SetNotificationSettingsParams, SetPersonalChannelParams, SetProfileColorParams, SetReactionsParams, SetStickerSetThumbnailParams, SetWorkingHoursParams, SignInParams, SignUpParams, 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 {
/**
* Connect the client.
*
* @method cn
*/
abstract connect(): Promise;
/**
* Disconnect the client.
*
* @method cn
*/
abstract disconnect(): Promise;
/**
* Start the client. Same as calling {@link ClientGeneric.connect} followed by {@link ClientGeneric.signIn}.
*
* @method cn
*/
abstract start(params?: SignInParams): Promise;
/**
* Check whether a bot token is valid.
*
* @param botToken The bot token to check
* @returns The result of the check.
* @method au
*/
abstract checkBotToken(botToken: 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 au
*/
abstract checkCode(code: string): Promise;
/**
* Check whether a password entered by the user is the same as the account's password.
*
* @param password The password to check.
* @returns The result of the check.
* @method au
*/
abstract checkPassword(password: string): Promise;
/**
* Export the auth string for the current authorization session.
*
* @method au
*/
abstract exportAuthString(): Promise;
/**
* Import an auth string.
*
* @param authString The auth string to import.
* @method au
*/
abstract importAuthString(authString: string): Promise;
/**
* Send a user verification code.
*
* @param phoneNumber The phone number to send the code to.
* @method au
*/
abstract sendCode(phoneNumber: 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.
* 2. Reconnects the client to the appropriate DC in case of MIGRATE_X errors.
*
* @method au
*/
abstract signIn(params?: SignInParams): Promise;
/**
* Sign out.
*
* @method au
*/
abstract signOut(): Promise;
/**
* Sign up.
*
* @method au
* @param firstName The first name to use for the account that is to be created.
* @returns The user identifier of the new account.
*/
abstract signUp(firstName: string, params?: SignUpParams): 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.
* @method ll
*/
abstract getInputChannel(id: ID): Promise;
/**
* Get a chat's inputPeer. Useful when calling API functions directly.
*
* @param id The identifier of a chat.
* @method ll
*/
abstract getInputPeer(id: ID): Promise;
/**
* Get a user's inputUser. Useful when calling API functions directly.
*
* @param id The identifier of the user.
* @method ll
*/
abstract getInputUser(id: ID): Promise;
/**
* Invoke a low-level function.
*
* @param function_ The function to invoke.
* @method ll
*/
abstract invoke ? Api.ReturnType : T["_"] extends keyof Api.Functions ? Api.ReturnType extends never ? Api.ReturnType : never : never>(function_: T, params?: InvokeParams): 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;
/**
* Add music to profile. User-only.
*
* @method ac
* @param fileId The identifier of the audio file to add to profile.
*/
abstract addMusicToProfile(fileId: string, params?: AddMusicToProfileParams): Promise;
/**
* Add a saved notification sound. User-only.
*
* @method ac
* @param sound The sound file to add.
*/
abstract addSavedNotificationSound(sound: FileSource, params?: AddSavedNotificationSoundParams): Promise;
/**
* Allow a bot to set custom emoji status. User-only.
*
* @param botId The user identifier of the bot.
* @method ac
*/
abstract allowBotToSetCustomEmojiStatus(botId: ID): Promise;
/**
* Allow unpaid messages from a user. User-only.
*
* @method ac
* @param userId The identifier of the user.
*/
abstract allowUnpaidMessagesFromUser(userId: ID, params?: AllowUnpaidMessagesFromUserParams): 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;
/**
* Clear recent emoji statuses. User-only.
*
* @method ac
*/
abstract clearRecentEmojiStatuses(): Promise;
/**
* Delete the current account. User-only.
*
* @method ac
* @param reason The reason for the deletion.
*/
abstract deleteAccount(reason: string, params?: DeleteAccountParams): Promise;
/**
* Disable sponsored messages on the current user. User-only.
*
* @method ac
*/
abstract disableSponsoredMessages(): Promise;
/**
* Disallow a bot to set custom emoji status. User-only.
*
* @param botId The user identifier of the bot.
* @method ac
*/
abstract disallowBotToSetCustomEmojiStatus(botId: ID): Promise;
/**
* Disallow unpaid messages from a user. User-only.
*
* @method ac
* @param userId The identifier of the user.
*/
abstract disallowUnpaidMessagesFromUser(userId: ID, params?: DisallowUnpaidMessagesFromUserParams): 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 application configuration. User-only.
*
* @method ac
*/
abstract getApplicationConfiguration(): Promise;
/**
* Get app support. User-only.
*
* @method ac
*/
abstract getAppSupport(): Promise;
/**
* Get app support name. User-only.
*
* @method ac
*/
abstract getAppSupportName(): Promise;
/**
* Get whether new chats from unknown users are archived and muted. User-only.
*
* @method ac
* @returns Whether new chats from unknown users are archived and muted.
*/
abstract getArchiveAndMuteNewChatsFromUnknownUsers(): 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 gift privacy setting. User-only.
*
* @method ac
* @returns The current gift privacy setting.
*/
abstract getGiftPrivacy(): Promise;
/**
* Get information on the currently authorized user.
*
* @method ac
* @returns Information on the currently authorized user.
*/
abstract getMe(): Promise;
/**
* Get new chat privacy setting. User-only.
*
* @method ac
* @returns The current new chat privacy setting.
*/
abstract getNewChatPrivacy(): Promise;
/**
* Get owned bots. User-only.
*
* @method ac
*/
abstract getOwnedBots(): Promise;
/**
* Get the user account password's hint.
*
* @method ac
*/
abstract getPasswordHint(): Promise;
/**
* Get a privacy setting. User-only.
*
* @param key The key of the privacy setting.
* @method ac
*/
abstract getPrivacySetting(key: PrivacySettingKey): Promise;
/**
* Get a user's profile music. User-only.
*
* @method ac
* @param userId The identifier of the user whose profile music should be fetched.
*/
abstract getProfileMusic(userId: ID, params?: GetProfileMusicParams): 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 read date privacy. User-only.
*
* @method ac
* @returns Whether read dates are visible.
*/
abstract getReadDatePrivacy(): Promise;
/**
* Get recent emoji statuses. User-only.
*
* @method ac
*/
abstract getRecentEmojiStatuses(): Promise;
/**
* Get saved notification sounds. User-only.
*
* @method ac
*/
abstract getSavedNotificationSounds(): 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 current user's business away message. User-only.
*
* @method ac
*/
abstract removeBusinessAwayMessage(): Promise;
/**
* Remove the business greeting message. User-only.
*
* @method ac
*/
abstract removeBusinessGreetingMessage(): Promise;
/**
* Remove the business intro. User-only.
*
* @method ac
*/
abstract removeBusinessIntro(): 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 music from profile. User-only.
*
* @method ac
* @param fileId The identifier of the audio file to remove from profile.
*/
abstract removeMusicFromProfile(fileId: string): 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 a saved notification sound. User-only.
*
* @method ac
* @param fileId The file identifier of the sound to remove.
*/
abstract removeSavedNotificationSound(fileId: string): 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;
/**
* Reset notification settings. User-only.
*
* @method ac
*/
abstract resetNotificationSettings(): 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;
/**
* Send a custom request. Bot-only.
*
* @method ac
* @param method The name of the method.
* @param params The parameters of the method.
*/
abstract sendCustomRequest(method: string, params: string): 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 whether new chats from unknown users should be archived and muted. User-only.
*
* @method ac
* @param value Whether new chats from unknown users should be archived and muted.
*/
abstract setArchiveAndMuteNewChatsFromUnknownUsers(value: boolean): Promise;
/**
* Set the birthday of the current user. User-only.
*
* @method ac
*/
abstract setBirthday(params?: SetBirthdayParams): Promise;
/**
* Set the current user's business away message. User-only.
*
* @method ac
* @param shortcutId The identifier of the quick reply shortcut to send.
* @param schedule The schedule on which to send the away message.
* @param recipients The recipients to send the away message to.
*/
abstract setBusinessAwayMessage(shortcutId: number, schedule: BusinessAwayMessageSchedule, recipients: InputBusinessRecipients, params?: SetBusinessAwayMessageParams): Promise;
/**
* Set the business greeting message. User-only.
*
* @method ac
* @param shortcutId The identifier of the quick reply shortcut to send.
* @param recipients The recipients to send the greeting message to.
* @param inactivityDayCount Inactivity day count.
*/
abstract setBusinessGreetingMessage(shortcutId: number, recipients: InputBusinessRecipients, inactivityDayCount: number): Promise;
/**
* Set the business intro. User-only.
*
* @method ac
* @param title The title of the intro.
* @param description The description of the intro.
*/
abstract setBusinessIntro(title: string, description: string, params?: SetBusinessIntroParams): 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 default message TTL. User-only.
*
* @method ac
* @param ttl The default message TTL in seconds.
*/
abstract setDefaultMessageTtl(ttl: number): 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 gift privacy setting. User-only.
*
* @method ac
* @param value The gift privacy setting to set.
*/
abstract setGiftPrivacy(value: GiftPrivacy): 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 new chat privacy setting. User-only.
*
* @method ac
* @param value The new chat privacy setting to set.
*/
abstract setNewChatPrivacy(value: NewChatPrivacy): Promise;
/**
* Set the personal channel of the current user. User-only.
*
* @method ac
*/
abstract setPersonalChannel(params?: SetPersonalChannelParams): Promise;
/**
* Set a privacy setting. User-only.
*
* @param key The key of the privacy setting.
* @param rules The rules to set.
* @method ac
*/
abstract setPrivacySetting(key: PrivacySettingKey, rules: InputPrivacyRule[]): 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 read date privacy. User-only.
*
* @method ac
* @param value Whether read dates should be visible.
*/
abstract setReadDatePrivacy(value: boolean): 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 an ephemeral message.
*
* @method ms
* @param chatId The identifier of the chat which the message belongs to.
* @param receiverUserId The identifier of the user who received the ephemeral message.
* @param messageId The identifier of the message to delete.
*/
abstract deleteEphemeralMessage(chatId: ID, receiverUserId: ID, messageId: number): 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. User-only.
*
* @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. User-only.
*
* @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 ephemeral message's caption. Bot-only.
*
* @method ms
* @param chatId The identifier of the chat which the message belongs to.
* @param receiverUserId The identifier of the user who received the ephemeral message.
* @param messageId The identifier of the message.
* @returns The edited message.
*/
abstract editEphemeralMessageCaption(chatId: ID, receiverUserId: ID, messageId: number, params?: EditMessageCaptionParams): Promise;
/**
* Edit an ephemeral message's media. Bot-only.
*
* @method ms
* @param chatId The identifier of the chat which the message belongs to.
* @param receiverUserId The identifier of the user who received the ephemeral message.
* @param messageId The identifier of the message.
* @param media The message's new media.
* @returns The edited message.
*/
abstract editEphemeralMessageMedia(chatId: ID, receiverUserId: ID, messageId: number, media: InputMedia, params?: EditMessageMediaParams): Promise;
/**
* Edit an ephemeral message's reply markup. Bot-only.
*
* @method ms
* @param chatId The identifier of the chat which the message belongs to.
* @param receiverUserId The identifier of the user who received the ephemeral message.
* @param messageId The identifier of the message.
* @returns The edited message.
*/
abstract editEphemeralMessageReplyMarkup(chatId: ID, receiverUserId: ID, messageId: number, params?: EditMessageReplyMarkupParams): Promise;
/**
* Edit an ephemeral message's text. Bot-only.
*
* @method ms
* @param chatId The identifier of the chat which the message belongs to.
* @param receiverUserId The identifier of the user who received the ephemeral message.
* @param messageId The identifier of the message.
* @param text The new text of the message.
* @returns The edited text message.
*/
abstract editEphemeralMessageText(chatId: ID, receiverUserId: ID, messageId: number, text: string, params?: EditMessageTextParams): 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. Bot-only.
*
* @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. User-only.
*
* @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;
/**
* Report an ephemeral message. User-only.
*
* @method ms
* @param chatId The identifier of the chat.
* @param messageId The identifier of the message.
*/
abstract reportEphemeralMessage(chatId: ID, messageId: number, params?: ReportEphemeralMessageParams): Promise;
/**
* Report a message reaction. User-only.
*
* @method ms
* @param chatId The identifier of the chat including the messages.
* @param messageId The identifier of the message.
* @param reactionActorId The identifier of the chat that made the reaction.
*/
abstract reportReaction(chatId: ID, messageId: number, reactionActorId: ID): 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;
/**
* Save a message draft. User-only.
*
* @method ms
* @param chatId The identifier of a chat.
* @param text The text of the draft.
*/
abstract saveDraft(chatId: ID, text: string, params?: SaveDraftParams): Promise;
/**
* Save a rich text message draft. User-only.
*
* @method ms
* @param chatId The identifier of a chat.
* @param text The text of the draft.
*/
abstract saveRichTextDraft(chatId: ID, richText: InputRichText, params?: SaveRichTextDraftParams): 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?: SendChatActionParams): 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. User-only.
*
* @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. User-only.
*
* @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, void, unknown>;
/**
* 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. User-only.
*
* @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. User-only.
*
* @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;
/**
* Boost a chat. User-only.
*
* @method ch
* @param chatId The identifier of the chat to boost.
*/
abstract boostChat(chatId: ID, params?: BoostChatParams): 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;
/**
* Delete revoked invite links. User-only.
*
* @method ch
* @param chatId The identifier of the chat.
* @param userId The user identifier of a chat admin.
*/
abstract deleteRevokedInviteLinks(chatId: ID, userId: ID): Promise;
/**
* Delete a forum topic.
*
* @method ch
* @param chatId The identifier of the chat.
* @param topicId The identifier of the topic.
*/
abstract deleteTopic(chatId: ID, topicId: number): 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