/** * 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; /** * Change slow mode in a group. User-only. * * @method ch * @param chatId The identifier of the group to change slow mode in. * @param duration New slow mode duration. */ abstract setSlowMode(chatId: ID, duration: SlowModeDuration): Promise; /** * Show the general forum topic. * * @method ch * @param chatId The identifier of a chat. */ abstract showGeneralTopic(chatId: ID): Promise; /** * Show the member list of a group to non-admins. User-only. * * @method ch * @param chatId The identifier of the group. */ abstract showMemberList(chatId: ID): Promise; /** * Transfer the ownership of a chat. User-only. * * @method ch * @param chatId The identifier of a chat. * @param userId The identifier of the new owner. * @param password The password of the current account. */ abstract transferChatOwnership(chatId: ID, userId: ID, password: string): Promise; /** * Unarchive a single chat. User-only. * * @method ch * @param chatId The identifier of a chat. */ abstract unarchiveChat(chatId: ID): Promise; /** * Unarchive multiple chats. User-only. * * @method ch * @param chatIds The identifiers of the chats to unarchive. */ abstract unarchiveChats(chatIds: ID[]): Promise; /** * Unban a member from a chat. * * @method ch * @param chatId The identifier of a chat. Must be a supergroup. * @param memberId The identifier of the member. */ abstract unbanChatMember(chatId: ID, memberId: ID): Promise; /** * Unpin a forum topic. * * @method ch * @param chatId The identifier of a chat. * @param topicId The identifier of the topic. */ abstract unpinTopic(chatId: ID, topicId: number): Promise; /** * Answer a callback query. Bot-only. * * @method cq * @param id ID of the callback query to answer. */ abstract answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise; /** * Send a callback query. User-only. * * @method cq * @param botId The identifier of the bot to send the callback query to. * @param messageId The identifier of the message that includes a button responsible for the callback query question. * @param question The callback query's question. * @returns The bot's answer to the callback query. * @cache */ abstract sendCallbackQuery(botId: ID, messageId: number, question: CallbackQueryQuestion): Promise; /** * Answer an inline query. Bot-only. * * @method iq * @param id The identifier of the inline query to answer. * @param results The results to answer with. */ abstract answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise; /** * Send an inline query. User-only. * * @method iq * @param botId The identifier of a bot to send the inline query to. * @param chatId The identifier of the chat from which the inline query is sent. * @returns The bot's answer to the inline query. * @cache */ abstract sendInlineQuery(botId: ID, chatId: ID, params?: SendInlineQueryParams): Promise; /** * Get the bot's commands in the given scope and/or language. Bot-only. * * @method bo * @returns The current bot's commands in the specified language. */ abstract getMyCommands(params?: GetMyCommandsParams): Promise; /** * Get the bot's description in the given language. Bot-only. * * @method bo * @returns The current bot's description in the specified language. */ abstract getMyDescription(params?: { languageCode?: string; }): Promise; /** * Get the bot's name in the given language. Bot-only. * * @method bo * @returns The current bot's name in the specified language. */ abstract getMyName(params?: { languageCode?: string; }): Promise; /** * Get the bot's short description in the given language. Bot-only. * * @method bo * @returns The current bot's short description in the specified language. */ abstract getMyShortDescription(params?: { languageCode?: string; }): Promise; /** * Set the bot's commands in the given scope and/or language. Bot-only. * * @method bo * @param commands The commands to set. */ abstract setMyCommands(commands: BotCommand[], params?: SetMyCommandsParams): Promise; /** * Set the bot's description in the given language. Bot-only. * * @method bo */ abstract setMyDescription(params?: { description?: string; languageCode?: string; }): Promise; /** * Set the bot's name in the given language. Bot-only. * * @method bo */ abstract setMyName(params?: { name?: string; languageCode?: string; }): Promise; /** * Set the bot's short description in the given language. Bot-only. * * @method bo */ abstract setMyShortDescription(params?: { shortDescription?: string; languageCode?: string; }): Promise; /** * Make a reaction to a message. * * @method re * @param chatId The identifier of the chat which the message belongs to. * @param messageId The identifier of the message to add the reaction to. * @param reaction The reaction to add. */ abstract addReaction(chatId: ID, messageId: number, reaction: Reaction, params?: AddReactionParams): Promise; /** * Clear recent reactions. User-only. * * @method re */ abstract clearRecentReactions(): Promise; /** * Undo a reaction made to a message. * * @method re * @param chatId The identifier of the chat which the message belongs to. * @param messageId The identifier of the message which the reaction was made to. * @param reaction The reaction to remove. */ abstract removeReaction(chatId: ID, messageId: number, reaction: Reaction): Promise; /** * Undo a reaction by another user. * * @method re * @param chatId The identifier of the chat which the message belongs to. * @param messageId The identifier of the message which the reaction was made to. * @param userId The identifier of the user who made the reaction. */ abstract removeUserReaction(chatId: ID, messageId: number, userId: ID): Promise; /** * Undo recent reactions to messages made by another user. * * @method re * @param chatId The identifier of the chat which the messages belong to. * @param userId The identifier of the user who made the reactions. */ abstract removeUserReactions(chatId: ID, userId: ID): Promise; /** * Change reactions made to a message. * * @method re * @param chatId The identifier of the chat which the message belongs to. * @param messageId The identifier of the message to add the reaction to. * @param reactions The new reactions. */ abstract setReactions(chatId: ID, messageId: number, reactions: Reaction[], params?: SetReactionsParams): Promise; /** * Add multiple stories to highlights. User-only. * * @method st * @param chatId The identifier of a chat. * @param storyIds The identifiers of the stories to add to highlights. */ abstract addStoriesToHighlights(chatId: ID, storyIds: number[]): Promise; /** * Add a single story to highlights. User-only. * * @method st * @param chatId The identifier of a chat. * @param storyId The identifier of the story to add to highlights. */ abstract addStoryToHighlights(chatId: ID, storyId: number): Promise; /** * Create a story. User-only. * * @method st * @param content The content of the story. * @returns The created story. */ abstract createStory(chatId: ID, content: InputStoryContent, params?: CreateStoryParams): Promise; /** * Delete multiple stories. User-only. * * @method st * @param chatId The identifier of a chat. * @param storyIds The identifiers of the stories to delete. */ abstract deleteStories(chatId: ID, storyIds: number[]): Promise; /** * Delete a single story. User-only. * * @method st * @param chatId The identifier of a chat. * @param storyId The identifier of the story to delete. */ abstract deleteStory(chatId: ID, storyId: number): Promise; /** * Retrieve multiple stories. User-only. * * @method st * @param chatId The identifier of a chat. * @param storyIds The identifiers of the stories to retrieve. * @returns The retrieved stories. */ abstract getStories(chatId: ID, storyIds: number[]): Promise; /** * Retrieve a single story. User-only. * * @method st * @param chatId The identifier of a chat. * @param storyId The identifier of the story to retrieve. * @returns The retrieved story. */ abstract getStory(chatId: ID, storyId: number): Promise; /** * Remove multiple stories from highlights. User-only. * * @method st * @param chatId The identifier of a chat. * @param storyIds The identifiers of the stories to remove from highlights. */ abstract removeStoriesFromHighlights(chatId: ID, storyIds: number[]): Promise; /** * Remove a single story from highlights. User-only. * * @method st * @param chatId The identifier of a chat. * @param storyId The identifier of the story to remove from highlights. */ abstract removeStoryFromHighlights(chatId: ID, storyId: number): Promise; /** * Report multiple stories. User-only. * * @method st * @param chatId The identifier of a chat that posted the stories. * @param storyIds The identifiers of the stories to report. */ abstract reportStories(chatId: ID, storyIds: number[], params?: ReportStoryParams): Promise; /** * Report a single story. User-only. * * @method st * @param chatId The identifier of a chat that posted the story. * @param storyId The identifier of the story to report. */ abstract reportStory(chatId: ID, storyId: number, params?: ReportStoryParams): Promise; /** * Add multiple stories to an album. User-only. * * @method sa * @param chatId The identifier of the chat including the album. * @param albumId The identifier of an album. * @param storyIds The identifiers of the stories to add. */ abstract addStoriesToAlbum(chatId: ID, albumId: number, storyIds: number[]): Promise; /** * Add a single story to an album. User-only. * * @method sa * @param chatId The identifier of the chat including the album. * @param albumId The identifier of an album. * @param storyId The identifier of the story to add. */ abstract addStoryToAlbum(chatId: ID, albumId: number, storyId: number): Promise; /** * Create a story album. User-only. * * @method sa * @param chatId The identifier of the chat to create the album in. * @param name The name of the album. * @param storyIds The initial stories inside the album. */ abstract createStoryAlbum(chatId: ID, name: string, storyIds: number[]): Promise; /** * Get stories inside an album. User-only. * * @method sa * @param chatId The identifier of the chat including albums. * @param albumId The identifier of an album. */ abstract getStoriesInAlbum(chatId: ID, albumId: number): Promise; /** * Get story albums in a chat. User-only. * * @method sa * @param chatId The identifier of a chat including albums. */ abstract getStoryAlbums(chatId: ID): Promise; /** * Remove multiple stories from an album. User-only. * * @method sa * @param chatId The identifier of the chat including the album. * @param albumId The identifier of an album. * @param storyIds The identifiers of the stories to remove. */ abstract removeStoriesFromAlbum(chatId: ID, albumId: number, storyIds: number[]): Promise; /** * Remove a single story from an album. User-only. * * @method sa * @param chatId The identifier of the chat including the album. * @param albumId The identifier of an album. * @param storyId The identifier of the story to remove. */ abstract removeStoryFromAlbum(chatId: ID, albumId: number, storyId: number): Promise; /** * Reorder stories in an album. User-only. * * @method sa * @param chatId The identifier of the chat including the album. * @param albumId The identifier of an album. * @param storyIds The new order of stories. */ abstract reorderStoriesInAlbum(chatId: ID, albumId: number, storyIds: number[]): Promise; /** * Set the name of a story album. User-only. * * @method sa * @param chatId The identifier of the chat including the album. * @param albumId The identifier of the album to rename. * @param name The new name of the album. */ abstract setStoryAlbumName(chatId: ID, albumId: number, name: string): Promise; /** * Get network statistics. This might not always be available. * * @method ns */ abstract getNetworkStatistics(): Promise; /** * Download a live stream segment. User-only. * * @method vc * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat. * @param channelId Stream channel ID. * @param scale Stream channel scale. * @param timestamp Millisecond timestamp of the chunk to download. */ abstract downloadLiveStreamSegment(id: string, channelId: number, scale: number, timestamp: number, params?: DownloadLiveStreamSegmentParams): Promise; /** * Get live stream channels. User-only. * * @method vc * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat. */ abstract getLiveStreamChannels(id: string): Promise; /** * Get a video chat. User-only. * * @method vc * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat. * @cache */ abstract getVideoChat(id: string): Promise; /** * Join a live stream. User-only. * * @method vc * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat. */ abstract joinLiveStream(id: string): Promise; /** * Join a video chat. User-only. * * @method vc * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat. * @param params_ WebRTC connection parameters. * @returns Parameters to be passed to the used WebRTC library. */ abstract joinVideoChat(id: string, params_: string, params?: JoinVideoChatParams): Promise; /** * Leave a video chat. User-only. * * @method vc * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat. */ abstract leaveVideoChat(id: string): Promise; /** * Schedule a video chat. User-only. * * @method vc * @param chatId The identifier of a chat to schedule the video chat in. * @param startAt A point in time in the future when the video chat will be started. * @returns The scheduled video chat. */ abstract scheduleVideoChat(chatId: ID, startAt: number, params?: ScheduleVideoChatParams): Promise; /** * Start a video chat. User-only. * * @method vc * @param chatId The identifier of a chat to start the video chat in. * @returns The started video chat. */ abstract startVideoChat(chatId: ID, params?: StartVideoChatParams): Promise; /** * Answer a pre-checkout query. Bot-only. * * @method pa * @param preCheckoutQueryId The identifier of the pre-checkout query. * @param ok Whether the checkout is going to be processed. */ abstract answerPreCheckoutQuery(preCheckoutQueryId: string, ok: boolean, params?: AnswerPreCheckoutQueryParams): Promise; /** * Get the star balance of a chat. * * @method pa * @param chatId The identifier of the chat to get the star balance for. */ abstract getStarBalance(chatId: ID): Promise; /** * Get star transactions. * * @method pa * @param chatId The identifier of the chat to get star transactions for. */ abstract getStarTransactions(chatId: ID, params?: GetStarTransactionsParams): Promise; /** * Get the TON balance of a chat. * * @method pa * @param chatId The identifier of the chat to get the TON balance for. */ abstract getTonBalance(chatId: ID): Promise; /** * Refund a star payment. Bot-only. * * @method pa * @param userId The identifier of the user that was charged. * @param telegramPaymentChargeId The identifier of the charge. */ abstract refundStarPayment(userId: ID, telegramPaymentChargeId: string): Promise; /** * Add a contact. User-only. * * @method co * @param userId The identifier of the user to add as contact. * @param firstName The contact's first name. */ abstract addContact(userId: ID, firstName: string, params?: AddContactParams): Promise; /** * Delete a single contact. User-only. * * @method co * @param userId The identifier of the contact to delete. */ abstract deleteContact(userId: ID): Promise; /** * Delete multiple contacts. User-only. * * @method co * @param userIds The identifiers of contacts to delete. */ abstract deleteContacts(userIds: ID[]): Promise; /** * Get contacts. User-only. * * @method co */ abstract getContacts(): Promise; /** * Set a contact note. * * @method co * @param userId The identifier of the user to update the note for. */ abstract setContactNote(userId: ID, params?: SetContactNoteParams): Promise; /** * Get translations. User-only. * * @method ta * @cache */ abstract getTranslations(params?: GetTranslationsParams): Promise; /** * Craft gifts. * * @method gf * @param gifts The gifts to craft. */ abstract craftGifts(gifts: InputGift[]): Promise; /** * Get gifts claimed by a user or a channel. User-only. * * @method gf * @param chatId The identifier of a user or a channel to get gifts for. */ abstract getClaimedGifts(chatId: ID, params?: GetClaimedGiftsParams): Promise; /** * Get a gift using its slug. * * @method gf * @param slug The slug of a gift. */ abstract getGift(slug: string): Promise; /** * Get available gifts. * * @method gf */ abstract getGifts(): Promise; /** * Gift a Telegram Premium subscription. Bot-only. * * @method gf * @param userId The identifier of a user to gift the Telegram Premium subscription to. * @param duration The duration of the subscription. */ abstract giftPremiumSubscription(userId: ID, duration: PremiumSubscriptionDuration, params?: GiftPremiumSubscriptionParams): Promise; /** * Sell a gift. * * @method gf * @param gift The gift to sell. */ abstract sellGift(gift: InputGift): Promise; /** * Send a gift. * * @method gf * @param chatId The identifier of a user or a channel to send the gift to. * @param giftId The identifier of the gift to send. */ abstract sendGift(chatId: ID, giftId: string, params?: SendGiftParams): Promise; /** * Transfer a gift. User-only. * * @method gf * @param chatId The identifier of a chat to transfer the gift to. * @param gift The gift to transfer. */ abstract transferGift(chatId: ID, gift: InputGift): Promise; /** * Add gifts to a gift collection. User-only. * * @method gc * @param chatId The identifier of the chat that includes the gift collection. * @param collectionId The identifier of a gift collection. * @param gifts The gifts to add to the collection. */ abstract addGiftsToCollection(chatId: ID, collectionId: number, gifts: InputGift[]): Promise; /** * Create a gift collection. User-only. * * @method gc * @param chatId The identifier of a chat to create the gift collection in. * @param name The name of the collection. * @param gifts The collection's initial gifts. */ abstract createGiftCollection(chatId: ID, name: string, gifts: InputGift[]): Promise; /** * Delete a gift collection. User-only. * * @method gc * @param chatId The identifier of the chat that includes the gift collection. * @param collectionId The identifier of a gift collection. */ abstract deleteGiftCollection(chatId: ID, collectionId: number): Promise; /** * Get gift collections of a chat. User-only. * * @method gc * @param chatId The identifier of a chat to get gift collections for. */ abstract getGiftCollections(chatId: ID): Promise; /** * Remove gifts from a gift collection. User-only. * * @method gc * @param chatId The identifier of the chat that includes the gift collection. * @param collectionId The identifier of a gift collection. * @param gifts The gifts to remove from the collection. */ abstract removeGiftsFromCollection(chatId: ID, collectionId: number, gifts: InputGift[]): Promise; /** * Reorder gifts in a gift collection. User-only. * * @method gc * @param chatId The identifier of the chat that includes the gift collection. * @param collectionId The identifier of a gift collection. * @param gifts The new order of gifts. */ abstract reorderGiftsInCollection(chatId: ID, collectionId: number, gifts: InputGift[]): Promise; /** * Set the name of a gift collection. User-only. * * @method gc * @param chatId The identifier of the chat that includes the gift collection. * @param collectionId The identifier of a gift collection. * @param name The gift collection's new name. */ abstract setGiftCollectionName(chatId: ID, collectionId: number, name: string): Promise; /** * End a takeout session. User-only. * * @method to * @param takeoutId The identifier of a takeout session. */ abstract endTakeoutSession(takeoutId: string, params?: EndTakeoutSessionParams): Promise; /** * Get left channels. User-only. * * @method to * @param takeoutId The identifier of a takeout session. */ abstract getLeftChannels(takeoutId: string, params?: GetLeftChannelsParams): Promise; /** * Start a takeout session. User-only. * * @method to * @returns The identifier of the takeout session. */ abstract startTakeoutSession(params?: StartTakeoutSessionParams): Promise; /** * Add a sticker to a sticker set. * * @method ss * @param slug The slug of the sticker set or its link. * @param sticker The sticker to add. */ abstract addStickerToStickerSet(slug: string, sticker: InputSticker, params?: AddStickerToStickerSetParams): Promise; /** * Change the position of a sticker in its set. * * @method ss * @param fileId The identifier of the sticker. * @param position The new position of the sticker. */ abstract changeStickerPositionInStickerSet(fileId: string, position: number): Promise; /** * Check the availability of a sticker set slug. * * @method ss * @param slug The slug of the sticker set or its link. * @returns Whether the slug is available. */ abstract checkStickerSetSlug(slug: string): Promise; /** * Create a sticker set. * * @method ss * @param name The sticker set's name. * @param slug The sticker set's slug. * @param stickers The initial stickers of the set. */ abstract createStickerSet(name: string, slug: string, stickers: InputSticker[], params?: CreateStickerSetParams): Promise; /** * Delete a sticker set. * * @method ss * @param slug The slug of the sticker set or its link. */ abstract deleteStickerSet(slug: string): Promise; /** * Get a dice sticker set. * * @method ss * @param emoji The emoji of the dice. */ abstract getDiceStickerSet(emoji: string): Promise; /** * Get a sticker set. * * @method ss * @param slug The slug of the sticker set or its link. */ abstract getStickerSet(slug: string): Promise; /** * Remove a sticker from its set. * * @method ss * @param fileId The identifier of the sticker. */ abstract removeStickerFromStickerSet(fileId: string): Promise; /** * Replace a sticker's emoji. * * @method ss * @param fileId The identifier of the sticker. * @param emoji The new emoji to use for the sticker. */ abstract replaceStickerEmoji(fileId: string, emoji: string): Promise; /** * Replace a sticker in a sticker set. * * @method ss * @param currentStickerFileId The identifier of the current sticker. * @param newSticker The new sticker to use. */ abstract replaceStickerInStickerSet(currentStickerFileId: string, newSticker: InputSticker, params?: ReplaceStickerInStickerSetParams): Promise; /** * Set a custom emoji as a sticker set's thumbnail. * * @method ss * @param slug The slug of the sticker set or its link. * @param customEmojiId The identifier of the custom emoji to use as thumbnail. */ abstract setCustomEmojiAsStickerSetThumbnail(slug: string, customEmojiId: string): Promise; /** * Set a sticker set's thumbnail. * * @method ss * @param slug The slug of the sticker set or its link. * @param thumbnail The new thumbnail of the sticker set. */ abstract setStickerSetThumbnail(slug: string, thumbnail: FileSource): Promise; /** * Set the title of a sticker set. * * @method ss * @param slug The slug of the sticker set or its link. * @param title The sticker set's new title. */ abstract setStickerSetTitle(slug: string, title: string): Promise; /** * Suggest a sticker set slug from its title. * * @method ss * @param title A title of a sticker set. * @returns The suggested slug. */ abstract suggestStickerSetSlug(title: string): Promise; /** * Set the access settings of a managed bot. Bot-only. * * @method mb * @param userId The identifier of the bot user. */ abstract getManagedBotAccessSettings(userId: ID): Promise; /** * Get the token of a managed bot. Bot-only. * * @method mb * @param userId The identifier of the bot user. * @returns The managed bot's token. */ abstract getManagedBotToken(userId: ID): Promise; /** * Revoke the token of a managed bot. Bot-only. * * @method mb * @param userId The identifier of the bot user. * @returns The managed bot's new token. */ abstract revokeManagedBotToken(userId: ID): Promise; /** * Set the access settings of a managed bot. Bot-only. * * @method mb * @param userId The identifier of the bot user. * @param isAccessRestricted Whether access is restricted to specific users. */ abstract setManagedBotAccessSettings(userId: ID, isAccessRestricted: boolean, params?: SetManagedBotAccessSettingsParams): Promise; /** * Answer a guest query. Bot-only. * * @method gq * @param id The identifier of the guest query to answer. * @returns The identifier of the sent message. */ abstract answerGuestQuery(id: string, result: InlineQueryResult): Promise; /** * Accept a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. */ abstract acceptSecretChat(id: number): Promise; /** * End a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. */ abstract endSecretChat(id: number, params?: EndSecretChatParams): Promise; /** * Request a secret chat. User-only. * * @method sc * @param chatId The identifier of a chat. */ abstract requestSecretChat(chatId: ID): Promise; /** * Send an animation to a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. * @param animation The animation to send. */ abstract sendSecretAnimation(id: number, animation: FileSource, params?: SendSecretAnimationParams): Promise; /** * Send an audio file to a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. * @param audio The audio file to send. */ abstract sendSecretAudio(id: number, audio: FileSource, params?: SendSecretAudioParams): Promise; /** * Send a cancel typing action to a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. */ abstract sendSecretCancelTypingAction(id: number): Promise; /** * Send a contact to a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. * @param firstName The contact's first name. * @param phoneNumber The contact's phone number. */ abstract sendSecretContact(id: number, firstName: string, phoneNumber: string, params?: SendSecretContactParams): Promise; /** * Send a document to a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. * @param document The document to send. */ abstract sendSecretDocument(id: number, document: FileSource, params?: SendSecretDocumentParams): Promise; /** * Send a location to a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. * @param latitude The location's latitude. * @param longitude The location's longitude. */ abstract sendSecretLocation(id: number, latitude: number, longitude: number, params?: SendSecretLocationParams): Promise; /** * Send a message to a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. * @param text The message's text. */ abstract sendSecretMessage(id: number, text: string, params?: SendSecretMessageParams): Promise; /** * Send a photo to a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. * @param photo The photo to send. */ abstract sendSecretPhoto(id: number, photo: FileSource, params?: SendSecretPhotoParams): Promise; /** * Send a secret chat screenshot notification. User-only. * * @method sc * @param id The identifier of the secret chat. * @param messageIds Identifiers of messages. */ abstract sendSecretScreenshotNotification(id: number, messageIds: string[]): Promise; /** * Send a sticker to a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. * @param sticker The sticker to send. */ abstract sendSecretSticker(id: number, sticker: FileSource | Sticker, params?: SendSecretStickerParams): Promise; /** * Send a typing action to a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. */ abstract sendSecretTypingAction(id: number): Promise; /** * Send a venue to a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. * @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. */ abstract sendSecretVenue(id: number, latitude: number, longitude: number, title: string, address: string, params?: SendSecretVenueParams): Promise; /** * Send a video to a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. * @param video The video to send. */ abstract sendSecretVideo(id: number, video: FileSource, params?: SendSecretVideoParams): Promise; /** * Send a video note to a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. * @param videoNote The video note to send. */ abstract sendSecretVideoNote(id: number, videoNote: FileSource, params?: SendSecretVideoNoteParams): Promise; /** * Send a voice message to a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. * @param voice The voice message to send. */ abstract sendSecretVoice(id: number, voice: FileSource, params?: SendSecretVoiceParams): Promise; } //# sourceMappingURL=1_client_generic.d.ts.map