/** * 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 { DC } from "../3_transport.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, ParseMode, 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"; import type { WorkerRequest } from "./0_worker_request.js"; import type { ClientGeneric } from "./1_client_generic.js"; import { type InvokeErrorHandler } from "./1_invoke_middleware.js"; import type { WorkerResponse } from "./1_worker_response.js"; import type { Context } from "./4_context.js"; import { Composer } from "./5_composer.js"; export interface ClientDispatcherParams { /** The storage provider to use. Defaults to memory storage. */ storage?: "memory" | "indexeddb" | "denokv"; /** App's API ID from [my.telegram.org/apps](https://my.telegram.org/apps). Required if no account was previously authorized. */ apiId?: number; /** App's API hash from [my.telegram.org/apps](https://my.telegram.org/apps). Required if no account was previously authorized. */ apiHash?: string; /** A parse mode to use when the `parseMode` parameter is not specified when sending or editing messages. Defaults to `ParseMode.None`. */ parseMode?: ParseMode; /** The app_version parameter to be passed to initConnection. It is recommended that this parameter is changed if users are authorized. Defaults to _MTKruto_. */ appVersion?: string; /** The device_version parameter to be passed to initConnection. The default varies by the current runtime. */ deviceModel?: string; /** The client's language to be used for fetching translations. Defaults to the runtime's language or `"en"`. */ language?: string; /** The client's platform to be used for fetching translations. Defaults to an empty string. */ platform?: string; /** The system_lang_code parameter to be passed to initConnection. Defaults to the runtime's language or `"en"`. */ systemLangCode?: string; /** The system_version parameter to be passed to initConnection. The default varies by the current runtime. */ systemVersion?: string; /** Whether to use default handlers. Defaults to `true`. */ defaultHandlers?: boolean; /** Whether outgoing messages should be sent as high-level updates. Outgoing bot business messages will never be sent. Defaults to `false`. */ outgoingMessages?: boolean; /** Whether to guarantee that order-sensitive updates are delivered at least once before delivering next ones. Useful mainly for clients providing a user interface à la Telegram Desktop. Defaults to `false`. */ guaranteeUpdateDelivery?: boolean; /** Whether to ignore updates received while the client was not running. Defaults to `true` for bots and `false` for users. */ dropPendingUpdates?: boolean; /** * Whether to persist cache to the provided storage, and not memory. Defaults to `false`. * * Explicitly setting this option to `true` is highly recommended if: * * - User accounts are authorized. * - Less memory usage is demanded. * - The client does not usually have a large uptime. * * When the provided storage takes advantage of memory, nothing changes, even if set to `true`. */ persistCache?: boolean; /** Whether to disable receiving updates. UpdateConnectionState and UpdateAuthorizationState will always be received. Defaults to `false`. */ disableUpdates?: boolean; /** An auth string to automatically import. Can be overridden by a later importAuthString call. */ authString?: string; /** The first DC to connect to. This is commonly used to decide whether to connect to test or production servers. It is not necessarily the DC that the client will directly connect to or is currently connected to. Defaults to the default initial DC. */ initialDc?: DC; } export declare class ClientDispatcher extends Composer implements ClientGeneric { #private; constructor(worker: Worker | MessagePort, id: string); /** @internal */ handleResponse(response: WorkerResponse): Promise; get id(): string; init(params?: ClientDispatcherParams): Promise; connect(): Promise; disconnect(): Promise; start(params?: SignInParams): Promise; /** @internal */ handleInvokeError(request: WorkerRequest): Promise; /** * Invokes a function waiting and returning its reply. * Requires the client to be connected. * * @param function_ The function to invoke. */ invoke: { ? Api.ReturnType : T["_"] extends keyof Api.Functions ? Api.ReturnType extends never ? Api.ReturnType : never : never>(function_: T, params?: InvokeParams): Promise; use: (handler: InvokeErrorHandler>) => void; }; /** * Send a user verification code. * * @param phoneNumber The phone number to send the code to. * @method ac */ 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 */ checkCode(code: string): Promise; /** * Get the user account password's hint. * * @method ac */ 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 */ 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 */ 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. */ signIn(params?: SignInParams): Promise; signOut(): Promise; exportAuthString(): Promise; importAuthString(authString: string): Promise; /** * Get a chat's inputPeer. Useful when calling API functions directly. * * @param id The identifier of a chat. */ 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. */ getInputChannel(id: ID): Promise; /** * Get a user's inputUser. Useful when calling API functions directly. * * @param id The identifier of the user. */ 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. */ addBotToAttachmentsMenu(botId: ID, params?: AddBotToAttachmentsMenuParams): Promise; /** * Block a user. User-only. * * @method ac * @param userId The identifier of the user to block. */ 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. */ checkUsername(username: string, params?: CheckUsernameParams): Promise; /** * Delete the current account. User-only. * * @method ac * @param reason The reason of the deletion. */ deleteAccount(reason: string, params?: DeleteAccountParams): Promise; /** * Disable sponsored messages on the current user. User-only. * * @method ac */ disableSponsoredMessages(): Promise; /** * Disconnect a connected website. User-only. * * @method ac * @param id The identifier of a connected website. */ disconnectConnectedWebsite(id: string): Promise; /** * Disconnect all connected websites. User-only. * * @method ac */ disconnectConnectedWebsites(): Promise; /** * Enable sponsored messages on the current user. User-only. * * @method ac */ enableSponsoredMessages(): Promise; /** * Get the current account's TTL. User-only. * * @method ac * @returns The current account's TTL in days. */ getAccountTtl(): Promise; /** * Get app support. User-only. * * @method ac */ getAppSupport(): Promise; /** * Get app support name. User-only. * * @method ac */ getAppSupportName(): Promise; /** * Get the authorization sessions. User-only. * * @method ac */ getAuthorizationSessions(): Promise; /** * Get blocked users. User-only. * * @method ac */ getBlockedUsers(params?: GetBlockedUsersParams): Promise; /** * Get a business connection. Bot-only. * * @method ac * @param id The identifier of the business connection. * @cache */ getBusinessConnection(id: string): Promise; /** * Get connected websites. User-only. * * @method ac */ getConnectedWebsites(): Promise; /** * Get countries. User-only. * * @method ac */ getCountries(languageCode: string): Promise; /** * Get the country code for the current user based on its IP address. User-only. * * @method ac */ getCountryCode(): Promise; /** * Get information on the currently authorized user. * * @method ac * @returns Information on the currently authorized user. */ getMe(): Promise; /** * Get owned bots. User-only. * * @method ac */ getOwnedBots(): Promise; /** * Get the profile photos of a user. * * @method ac * @param userId The identifier of a user. */ getProfilePhotos(userId: ID, params?: GetProfilePhotosParams): Promise; /** * Get timezones. User-only. * * @method ac */ 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. */ 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. */ hideUsernames(id: ID): Promise; /** * Pause the business bot in a chat. User-only. * * @method ac * @param chatId The identifier of a chat. */ pauseBusinessBotConnection(chatId: ID): Promise; /** * Remove an authorization session. User-only. * * @method ac * @param id The identifier of the authorization session to remove. */ removeAuthorizationSession(id: string): Promise; /** * Remove all authorization sessions except for the current one. User-only. * * @method ac */ 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. */ removeBotFromAttachmentsMenu(botId: ID): Promise; /** * Remove the emoji status of a channel. User-only. * * @method ac * @param chatId The identifier of a channel. */ removeChannelEmojiStatus(chatId: ID): Promise; /** * Remove the current account's emoji status. User-only. * * @method ac */ removeEmojiStatus(): Promise; /** * Remove the profile video of the current user or a bot managed by the current user. * * @method ac */ 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. */ removeUserEmojiStatus(userId: ID): Promise; /** * Remove the current account's username. User-only. * * @method ac */ 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. */ reorderUsernames(id: ID, order: string[]): Promise; /** * Resolve a phone number. User-only. * * @method ac * @param phoneNumber The phone number to resolve. */ resolvePhoneNumber(phoneNumber: string): Promise; /** * Resolve a username. * * @method ac * @param username The username to resolve. */ resolveUsername(username: string, params?: ResolveUsernameParams): Promise; /** * Resume the business bot in a chat. User-only. * * @method ac * @param chatId The identifier of a chat. */ resumeBusinessBotConnection(chatId: ID): Promise; /** * Set the current account's TTL. User-only. * * @method ac * @param dayCount The current account's TTL in days. */ setAccountTtl(dayCount: number): Promise; /** * Set the birthday of the current user. User-only. * * @method ac */ 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. */ 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. */ 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. */ setEmojiStatus(emojiStatus: InputEmojiStatus, params?: SetEmojiStatusParams): Promise; /** * Set the current account's online status. User-only. * * @method ac * @param isOnline The new online status. */ setIsOnline(isOnline: boolean): Promise; /** * Set the location of the current user. User-only. * * @method ac */ 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. */ setNameColor(color: number, params?: SetNameColorParams): Promise; /** * Set the personal channel of the current user. User-only. * * @method ac */ 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. */ 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. */ 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. */ setUsername(username: string): Promise; /** * Set the working hours of the current user. User-only. * * @method ac */ 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. */ 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. */ suggestBirthday(userId: ID, birthday: Birthday): Promise; /** * Unblock a user. User-only. * * @method ac * @param userId The identifier of the user to unblock. */ unblockUser(userId: ID): Promise; /** * Update the profile of the current user. At least one parameter must be specified. User-only. * * @method ac */ 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. */ 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. */ updateProfileVideo(video: FileSource, params?: UpdateProfileVideoParams): Promise; /** * Add a sticker to favorites. User-only. * * @method ms * @param fileId The file identifier of the sticker. */ addStickerToFavorites(fileId: string): Promise; /** * Add a sticker to recents. User-only. * * @method ms * @param fileId The file identifier of the sticker. */ addStickerToRecents(fileId: string): Promise; /** * Clear all message drafts. User-only. * * @method ms */ clearDrafts(): Promise; /** * Clear recent stickers. User-only. * * @method ms */ 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. */ 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. */ 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. */ 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. */ 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. */ deleteScheduledMessages(chatId: ID, messageIds: number[]): Promise; /** * Edit an inline message's caption. Bot-only. * * @method ms * @param inlineMessageId The identifier of the inline message. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ forwardMessages(from: ID, to: ID, messageIds: number[], params?: ForwardMessagesParams): Promise; /** * Get favorite stickers. User-only. * * @method ms */ 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. */ 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 */ 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. */ 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. */ 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. */ 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 */ 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. */ 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. */ 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 */ getProgressId(): Promise; /** * Get recent stickers. User-only. * * @method ms */ 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. */ getRichText(chatId: ID, messageId: number): Promise; /** * Get saved animations. User-only. * * @method ms */ getSavedAnimations(): Promise; /** * Get a list of saved chats. * * @method ms */ getSavedChats(params?: GetSavedChatsParams): Promise; /** * Get messages saved from a specific chat. * * @method ms * @param chatId The identifier of a chat. */ 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. */ 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 */ 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. */ 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. */ readMessages(chatId: ID, untilMessageId: number): Promise; /** * Remove a sticker from favorites. User-only. * * @method ms * @param fileId The file identifier of the sticker. */ removeStickerFromFavorites(fileId: string): Promise; /** * Remove a sticker from recents. User-only. * * @method ms * @param fileId The file identifier of the sticker. */ 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. */ resolveMessageLink(link: string): Promise; /** * Save an animation. User-only. * * @method ms * @param fileId The file identifier of the animation. */ saveAnimation(fileId: string): Promise; /** * Search for messages. User-only. * * @method ms */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ setDefaultReaction(reaction: Reaction): Promise; /** * Start a bot. User-only. * * @method ms * @param botId The identifier of the bot to start. * @returns The start message. */ 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. */ 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. */ 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 */ 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. */ 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. */ 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. */ 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. */ 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. */ unpinMessage(chatId: ID, messageId: number, params?: UnpinMessageParams): Promise; /** * Unpin all pinned messages. * * @method ms * @param chatId The identifier of a chat. */ unpinMessages(chatId: ID, params?: UnpinMessagesParams): Promise; /** * Unsave an animation. User-only. * * @method ms * @param fileId The file identifier of the animation. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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 */ 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 */ 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 */ 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 */ 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 */ 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 */ 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 */ 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 */ downloadChunk(fileId: string, params?: DownloadParams): Promise; /** * Get custom emoji documents for download. * * @method fs * @param id Identifier of one or more of custom emojis. * @returns The custom emoji documents. * @cache */ 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. */ 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. */ 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. */ 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. */ approveJoinRequests(chatId: ID, params?: ApproveJoinRequestsParams): Promise; /** * Archive a single chat. User-only. * * @method ch * @param chatId The identifier of a chat. */ archiveChat(chatId: ID): Promise; /** * Archive multiple chats. User-only. * * @method ch * @param chatIds The identifiers of the chats to archive. */ 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. */ 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. */ closeChat(chatId: ID): Promise; /** * Close a forum topic. * * @method ch * @param chatId The identifier of a chat. * @param topicId The identifier of the topic. */ closeTopic(chatId: ID, topicId: number): Promise; /** * Create a channel. User-only. * * @method ch * @param title The title of the channel. * @returns The created channel. */ createChannel(title: string, params?: CreateChannelParams): Promise; /** * Create a group. User-only. * * @method ch * @param title The title of the group. * @returns The created group. */ 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. */ createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise; /** * Create a supergroup. User-only. * * @method ch * @param title The title of the supergroup. * @returns The created supergroup. */ 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. */ 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. */ 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. */ declineJoinRequests(chatId: ID, params?: DeclineJoinRequestsParams): Promise; /** * Delete a chat. User-only. * * @method ch * @param chatId The identifier of a chat. */ deleteChat(chatId: ID): Promise; /** * Delete a chat's photo. * * @method ch * @param chatId The identifier of a chat. */ deleteChatPhoto(chatId: ID): Promise; /** * Delete a chat's sticker set. * * @method ch * @param chatId The identifier of a chat. Must be a supergroup. */ deleteChatStickerSet(chatId: ID): Promise; /** * Disable automatic anti-spam in a group. User-only. * * @method ch * @param chatId The identifier of the group. */ 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. */ disableBusinessBots(chatId: ID): Promise; /** * Disable chat history for new members. User-only. * * @method ch * @param chatId The identifier of a chat. */ 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. */ disableJoinRequests(chatId: ID): Promise; /** * Disable sharing in a chat. User-only. * * @method ch * @param chatId The identifier of a chat. */ disableSharing(chatId: ID): Promise; /** * Disable post signatures in a channel. User-only. * * @method ch * @param chatId The identifier of the channel. */ 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. */ disableSlowMode(chatId: ID): Promise; /** * Disable topics in a group. User-only. * * @method ch * @param chatId The identifier of the group. */ 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. */ 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. */ 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. */ enableBusinessBots(chatId: ID): Promise; /** * Enable chat history for new members. User-only. * * @method ch * @param chatId The identifier of a chat. */ 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. */ enableJoinRequests(chatId: ID): Promise; /** * Enable sharing in a chat. User-only. * * @method ch * @param chatId The identifier of a chat. */ enableSharing(chatId: ID): Promise; /** * Enable post signatures in a channel. User-only. * * @method ch * @param chatId The identifier of the channel. */ 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. */ enableTopics(chatId: ID, isShownAsTabs: boolean): Promise; /** * Get a chat. * * @method ch * @cache */ getChat(chatId: ID): Promise; /** * Get the administrators of a chat. * * @method ch * @param chatId The identifier of a chat. * @returns The chat's administrators. */ 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. */ getChatMember(chatId: ID, userId: ID): Promise; /** * Get the members of a chat. * * @method ch * @param chatId The identifier of a chat. */ getChatMembers(chatId: ID, params?: GetChatMembersParams): Promise; /** * Get a partial chat. * * @method ch * @cache */ getChatP(chatId: ID): Promise; /** * Get chats from a chat list. User-only. * * @method ch */ getChats(params?: GetChatsParams): Promise; /** * Get the settings of a chat. User-only. * * @method ch * @param chatId The identifier of a chat. */ 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. */ 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. */ getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise; /** * Get discussion chat suggestions. User-only. * * @method ch */ getDiscussionChatSuggestions(): Promise; /** * Get chat history. User-only. * * @method ch * @param chatId The identifier of a chat. */ 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. */ getInactiveChats(): Promise; /** * Get pending join requests in a chat. User-only. * * @method ch * @param chatId The identifier of a chat with the join requests. */ 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. */ 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. */ getPinnedChats(from?: "archived" | "main"): Promise; /** * Get recommended channels. User-only. * * @method ch * @returns A list of recommended channels. */ 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. */ 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. */ 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. */ getTopic(chatId: ID, topicId: number): Promise; /** * Get the topics of a forum chat. User-only. * * @method ch * @param chatId The identifier of the chat. */ 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. */ getTopicsById(chatId: ID, topicIds: number[]): Promise; /** * Hide the general forum topic. * * @method ch * @param chatId The identifier of a chat. */ 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. */ hideMemberList(chatId: ID): Promise; /** * Join a chat. User-only. * * @method ch * @param chatId The identifier of a chat. */ 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. */ kickChatMember(chatId: ID, memberId: ID): Promise; /** * Leave a chat. * * @method ch * @param chatId The identifier of a chat. */ leaveChat(chatId: ID): Promise; /** * Mark all mentions in a chat as read. User-only. * * @method ch * @param chatId The identifier of the chat. */ markAllMentionsAsRead(chatId: ID, params?: MarkAllMentionsAsReadParams): Promise; /** * Mark a chat as read. User-only. * * @method ch * @param chatId The identifier of a chat. */ markChatAsRead(chatId: ID): Promise; /** * Mark a chat as unread. User-only. * * @method ch * @param chatId The identifier of a chat. */ markChatAsUnread(chatId: ID): Promise; /** * Open a chat. * * @method ch * @param chatId The identifier of a chat to open. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ setSlowMode(chatId: ID, duration: SlowModeDuration): Promise; /** * Show the general forum topic. * * @method ch * @param chatId The identifier of a chat. */ 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. */ 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. */ transferChatOwnership(chatId: ID, userId: ID, password: string): Promise; /** * Unarchive a single chat. User-only. * * @method ch * @param chatId The identifier of a chat. */ unarchiveChat(chatId: ID): Promise; /** * Unarchive multiple chats. User-only. * * @method ch * @param chatIds The identifiers of the chats to unarchive. */ 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. */ 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. */ unpinTopic(chatId: ID, topicId: number): Promise; /** * Answer a callback query. Bot-only. * * @method cq * @param id ID of the callback query to answer. */ 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 */ 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. */ 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 */ 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. */ 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. */ 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. */ 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. */ 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. */ setMyCommands(commands: BotCommand[], params?: SetMyCommandsParams): Promise; /** * Set the bot's description in the given language. Bot-only. * * @method bo */ setMyDescription(params?: { description?: string; languageCode?: string; }): Promise; /** * Set the bot's name in the given language. Bot-only. * * @method bo */ setMyName(params?: { name?: string; languageCode?: string; }): Promise; /** * Set the bot's short description in the given language. Bot-only. * * @method bo */ 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. */ addReaction(chatId: ID, messageId: number, reaction: Reaction, params?: AddReactionParams): Promise; /** * Clear recent reactions. User-only. * * @method re */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ addStoryToHighlights(chatId: ID, storyId: number): Promise; /** * Create a story. User-only. * * @method st * @param content The content of the story. * @returns The created story. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ setStoryAlbumName(chatId: ID, albumId: number, name: string): Promise; /** * Get network statistics. This might not always be available. * * @method ns */ 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. */ 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. */ 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 */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ getStarBalance(chatId: ID): Promise; /** * Get star transactions. * * @method pa * @param chatId The identifier of the chat to get star transactions for. */ 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. */ 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. */ 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. */ 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. */ deleteContact(userId: ID): Promise; /** * Delete multiple contacts. User-only. * * @method co * @param userIds The identifiers of contacts to delete. */ deleteContacts(userIds: ID[]): Promise; /** * Get contacts. User-only. * * @method co */ getContacts(): Promise; /** * Set a contact note. * * @method co * @param userId The identifier of the user to update the note for. */ setContactNote(userId: ID, params?: SetContactNoteParams): Promise; /** * Get translations. User-only. * * @method ta * @cache */ getTranslations(params?: GetTranslationsParams): Promise; /** * Craft gifts. * * @method gf * @param gifts The gifts to craft. */ 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. */ getClaimedGifts(chatId: ID, params?: GetClaimedGiftsParams): Promise; /** * Get a gift using its slug. * * @method gf * @param slug The slug of a gift. */ getGift(slug: string): Promise; /** * Get available gifts. * * @method gf */ 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. */ giftPremiumSubscription(userId: ID, duration: PremiumSubscriptionDuration, params?: GiftPremiumSubscriptionParams): Promise; /** * Sell a gift. * * @method gf * @param gift The gift to sell. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ setGiftCollectionName(chatId: ID, collectionId: number, name: string): Promise; /** * End a takeout session. User-only. * * @method to * @param takeoutId The identifier of a takeout session. */ endTakeoutSession(takeoutId: string, params?: EndTakeoutSessionParams): Promise; /** * Get left channels. User-only. * * @method to * @param takeoutId The identifier of a takeout session. */ getLeftChannels(takeoutId: string, params?: GetLeftChannelsParams): Promise; /** * Start a takeout session. User-only. * * @method to * @returns The identifier of the takeout session. */ 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. */ 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. */ 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. */ 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. */ 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. */ deleteStickerSet(slug: string): Promise; /** * Get a dice sticker set. * * @method ss * @param emoji The emoji of the dice. */ getDiceStickerSet(emoji: string): Promise; /** * Get a sticker set. * * @method ss * @param slug The slug of the sticker set or its link. */ getStickerSet(slug: string): Promise; /** * Remove a sticker from its set. * * @method ss * @param fileId The identifier of the sticker. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ suggestStickerSetSlug(title: string): Promise; /** * Set the access settings of a managed bot. Bot-only. * * @method mb * @param userId The identifier of the bot user. */ 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. */ 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. */ 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. */ 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. */ answerGuestQuery(id: string, result: InlineQueryResult): Promise; /** * Accept a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. */ acceptSecretChat(id: number): Promise; /** * End a secret chat. User-only. * * @method sc * @param id The identifier of the secret chat. */ endSecretChat(id: number, params?: EndSecretChatParams): Promise; /** * Request a secret chat. User-only. * * @method sc * @param chatId The identifier of a chat. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ 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. */ sendSecretVoice(id: number, voice: FileSource, params?: SendSecretVoiceParams): Promise; } //# sourceMappingURL=6_client_dispatcher.d.ts.map