import { EventEmitter } from 'events'; import FormData from 'form-data'; import { TelegramError } from './errors'; import { ReadStream } from 'fs'; import { Update, UpdateType, MessageEntity, Message, MessageId, LinkPreviewOptions, ReplyParameters, InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply, User, InputFile, InputMediaAudio, InputMediaDocument, InputMediaLivePhoto, InputMediaPhoto, InputMediaVideo, InputPollMedia, InputPollOption, InputProfilePhoto, UserProfilePhotos, UserProfileAudios, ChatPermissions, ChatInviteLink, ChatFullInfo, Sticker, ReactionType, ChatMember, ForumTopic, BotAccessSettings, BusinessConnection, BotCommandScope, BotCommand, BotName, BotDescription, BotShortDescription, MenuButton, ChatAdministratorRights, InputMedia, Poll, UserChatBoosts, PreparedInlineMessage, PreparedKeyboardButton, KeyboardButton, StickerSet, InputSticker, InlineQueryResult, InlineQueryResultsButton, SentGuestMessage, SentWebAppMessage, LabeledPrice, ShippingOption, MaskPosition, PassportElementError, GameHighScore, ParseMode, EventTypes, MessageTypes, StarTransactions, InputPaidMedia, WebhookInfo, Currencies, Gifts, AcceptedGiftTypes, StarAmount, OwnedGifts, InputStoryContent, Story, StoryArea, InputChecklist, SuggestedPostParameters } from './types/'; import * as TelegramTypes from './types/'; import { ExactlyOne } from './utils'; /** * All events such as `message`, `callback_query`, `message:location` etc. */ type allEmittedTypes = EventTypes & MessageTypes; /** * A class for wrapping files or buffers, intended for use when sending files in requests. * Allows you to specify additional file parameters. */ export declare class FileOptions { file: ReadStream | Buffer | File; options?: (FormData.AppendOptions | string) | undefined; constructor(file: ReadStream | Buffer | File, options?: (FormData.AppendOptions | string) | undefined); } export declare class TelegramBot extends EventEmitter { private readonly polling; botToken: string; testEnvironment: boolean; baseURL: string; autoRetry: boolean; autoRetryLimit: number; allowedUpdates: UpdateType[]; pollingTimeout: number; agent?: { destroy(): void; }; constructor(options: { botToken: string; testEnvironment?: boolean; baseURL?: string; autoRetry?: boolean; autoRetryLimit?: number; allowedUpdates?: UpdateType[]; pollingTimeout?: number; /** * HTTP(S) agent used for all requests to the Telegram Bot API. Pass an instance of `HttpsProxyAgent` * (`https-proxy-agent`) or `SocksProxyAgent` (`socks-proxy-agent`) to route traffic through a proxy. * Node.js only — ignored in browser builds. */ agent?: { destroy(): void; }; }); static isTelegramError(error: unknown): error is TelegramError; startPolling(): Promise; stopPolling(): Promise; private request; private serializeJSON; private handleObject; private createFormData; private callApi; processUpdate(update: Update): Promise; /** * ## getUpdates * Use this method to receive incoming updates using long polling [wiki](https://en.wikipedia.org/wiki/Push_technology#Long_polling). Returns an Array of Update objects. * @see https://core.telegram.org/bots/api#getupdates */ getUpdates(options?: { /** * Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of * previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An * update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id. The * negative offset can be specified to retrieve updates starting from -offset update from the end of the updates * queue. All previous updates will be forgotten. */ offset?: number; /** * Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100. */ limit?: number; /** * Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling * should be used for testing purposes only. */ timeout?: number; /** * A JSON-serialized list of the update types you want your bot to receive. For example, specify `["message", * "edited_channel_post", "callback_query"]` to only receive updates of these types. See Update for a complete * list of available update types. Specify an empty list to receive all update types except chat_member, * message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used. * * Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted * updates may be received for a short period of time. */ allowed_updates?: UpdateType[]; }, abortController?: AbortController): Promise; /** * ## setWebhook * Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update * for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case * of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success. * * If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter * ```secret_token```. If specified, the request will contain a header ```“X-Telegram-Bot-Api-Secret-Token”``` with * the secret token as content. * @see https://core.telegram.org/bots/api#setwebhook */ setWebhook(options: { /** * HTTPS URL to send updates to. Use an empty string to remove webhook integration */ url: string; /** * Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide * for details. */ certificate?: InputFile; /** * The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS */ ip_address?: string; /** * The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults * to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's * throughput. */ max_connections?: number; /** * A JSON-serialized list of the update types you want your bot to receive. For example, specify `["message", * "edited_channel_post", "callback_query"]` to only receive updates of these types. See Update for a complete list * of available update types. Specify an empty list to receive all update types except chat_member, * message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used. * Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted * updates may be received for a short period of time. */ allowed_updates?: UpdateType[]; /** * Pass True to drop all pending updates */ drop_pending_updates?: boolean; /** * A secret token to be sent in a header “X-Telegram-Bot-Api-Secret-Token” in every webhook request, 1-256 * characters. Only characters `A-Z`, `a-z`, `0-9`, `_` and `-` are allowed. The header is useful to ensure that the * request comes from a webhook set by you. */ secret_token?: string; }): Promise; /** * ## deleteWebhook * Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success. * @see https://core.telegram.org/bots/api#deletewebhook */ deleteWebhook(options?: { drop_pending_updates?: boolean; }): Promise; /** * ## getWebhookInfo * Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. * If the bot is using getUpdates, will return an object with the url field empty. * @see https://core.telegram.org/bots/api#getwebhookinfo */ getWebhookInfo(): Promise; /** * ## getMe * A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information * about the bot in form of a User object. * @see https://core.telegram.org/bots/api#getme */ getMe(): Promise; /** * ## logOut * Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot * before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful * call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server * for 10 minutes. Returns True on success. Requires no parameters. * @see https://core.telegram.org/bots/api#logout */ logOut(): Promise; /** * ## close * Use this method to close the bot instance before moving it from one local server to another. You need to delete the * webhook before calling this method to ensure that the bot isn't launched again after server restart. The method * will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no * parameters. * @see https://core.telegram.org/bots/api#close */ close(): Promise; /** * ## sendMessage * Use this method to send text messages. On success, the sent Message is returned. * @see https://core.telegram.org/bots/api#sendmessage */ sendMessage(options: { /** * Unique identifier of the business connection on behalf of which the message will be sent */ business_connection_id?: string; /** * Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */ chat_id: number | string; /** * Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of * bots with forum topic mode enabled only */ message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a * direct messages chat */ direct_messages_topic_id?: number; /** * Text of the message to be sent, 1-4096 characters after entities parsing */ text: string; /** * Mode for parsing entities in the message text. See formatting options for more details. */ parse_mode?: ParseMode; /** * A JSON-serialized list of special entities that appear in message text, which can be specified instead of * parse_mode */ entities?: MessageEntity[]; /** * Link preview generation options for the message */ link_preview_options?: LinkPreviewOptions; /** * Sends the message silently. Users will receive a notification with no sound. */ disable_notification?: boolean; /** * Protects the contents of the sent message from forwarding and saving */ protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; /** * Unique identifier of the message effect to be added to the message; for private chats only */ message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; /** * Description of the message to reply to */ reply_parameters?: ReplyParameters; /** * Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, * instructions to remove a reply keyboard or to force a reply from the user */ reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** * ## forwardMessage * Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or * forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album * grouping is kept for forwarded messages. On success, an array of MessageId of the sent messages is returned. * @see https://core.telegram.org/bots/api#forwardmessage */ forwardMessage(options: { chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; from_chat_id: number | string; video_start_timestamp?: number; disable_notification?: boolean; protect_content?: boolean; /** * Unique identifier of the message effect to be added to the message; only available when forwarding to private * chats */ message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; message_id: number; }): Promise; /** * ## forwardMessages * Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are * skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages * can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. * The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original * message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is * returned. * @see https://core.telegram.org/bots/api#forwardmessages */ forwardMessages(options: { chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; from_chat_id: number | string; message_ids: number[]; disable_notification?: boolean; protect_content?: boolean; }): Promise; /** * ## copyMessage * Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway * winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field * correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message * doesn't have a link to the original message. Returns the MessageId of the sent message on success. * @see https://core.telegram.org/bots/api#copymessage */ copyMessage(options: { chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; from_chat_id: number | string; message_id: number; video_start_timestamp?: number; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; show_caption_above_media?: boolean; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; /** * Unique identifier of the message effect to be added to the message; only available when copying to private chats */ message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** * ## copyMessages * Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are * skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A * quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is * analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album * grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned. * @see https://core.telegram.org/bots/api#copymessages */ copyMessages(options: { chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; from_chat_id: number | string; message_ids: number[]; disable_notification?: boolean; protect_content?: boolean; remove_caption?: boolean; }): Promise; /** * ## sendPhoto * Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are * skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A * quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is * analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album * grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned. * @see https://core.telegram.org/bots/api#sendphoto */ sendPhoto(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; photo: InputFile | string; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; show_caption_above_media?: boolean; has_spoiler?: boolean; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** * ## sendAudio * Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio * must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files * of up to 50 MB in size, this limit may be changed in the future. * * For sending voice messages, use the sendVoice method instead. * @see https://core.telegram.org/bots/api#sendaudio */ sendAudio(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; audio: InputFile | string; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; duration?: number; performer?: string; title?: string; thumbnail?: InputFile | string; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** ## sendDocument * Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of * any type of up to 50 MB in size, this limit may be changed in the future. * @see https://core.telegram.org/bots/api#senddocument */ sendDocument(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; document: InputFile | string; thumbnail?: InputFile | string; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; disable_content_type_detection?: boolean; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** * ## sendVideo * Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document). * On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit * may be changed in the future. * @see https://core.telegram.org/bots/api#sendvideo */ sendVideo(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; video: InputFile | string; duration?: number; width?: number; height?: number; thumbnail?: InputFile | string; cover?: InputFile | string; start_timestamp?: number; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; show_caption_above_media?: boolean; has_spoiler?: boolean; supports_streaming?: boolean; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** * ## sendAnimation * Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message * is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the * future. * @see https://core.telegram.org/bots/api#sendanimation */ sendAnimation(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; animation: InputFile | string; duration?: number; width?: number; height?: number; thumbnail?: InputFile | string; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; show_caption_above_media?: boolean; has_spoiler?: boolean; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** * ## sendVoice * Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. * For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other * formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice * messages of up to 50 MB in size, this limit may be changed in the future. * @see https://core.telegram.org/bots/api#sendvoice */ sendVoice(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; voice: InputFile | string; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; duration?: number; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** * ## sendVideoNote * As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send * video messages. On success, the sent Message is returned. * @see https://core.telegram.org/bots/api#sendvideonote */ sendVideoNote(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; video_note: InputFile | string; duration?: number; length?: number; thumbnail?: InputFile | string; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** * ## sendPaidMedia * Use this method to send paid media to channel chats. On success, the sent Message is returned. * @see https://core.telegram.org/bots/api#sendpaidmedia */ sendPaidMedia(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; star_count: number; media: InputPaidMedia[]; payload?: string; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; show_caption_above_media?: boolean; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** * ## sendLivePhoto * Use this method to send live photos. On success, the sent Message is returned. * @see https://core.telegram.org/bots/api#sendlivephoto */ sendLivePhoto(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a * direct messages chat */ direct_messages_topic_id?: number; /** * Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a * file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using * multipart/form-data. Sending live photos by a URL is currently unsupported. */ live_photo: InputFile | string; /** * The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers * (recommended) or upload a new video using multipart/form-data. Sending live photos by a URL is currently * unsupported. */ photo: InputFile | string; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; show_caption_above_media?: boolean; has_spoiler?: boolean; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** * ## sendMediaGroup * Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and * audio files can be only grouped in an album with messages of the same type. On success, an array of Messages that * were sent is returned. * @see https://core.telegram.org/bots/api#sendmediagroup */ sendMediaGroup(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; media: (InputMediaAudio | InputMediaDocument | InputMediaLivePhoto | InputMediaPhoto | InputMediaVideo)[]; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; reply_parameters?: ReplyParameters; }): Promise; /** * ## sendLocation * Use this method to send point on the map. On success, the sent Message is returned. * @see https://core.telegram.org/bots/api#sendlocation */ sendLocation(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; latitude: number; longitude: number; horizontal_accuracy?: number; live_period?: number; heading?: number; proximity_alert_radius?: number; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** * ## sendVenue * Use this method to send information about a venue. On success, the sent Message is returned. * @see https://core.telegram.org/bots/api#sendvenue */ sendVenue(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; latitude: number; longitude: number; title: string; address: string; foursquare_id?: string; foursquare_type?: string; google_place_id?: string; google_place_type?: string; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** * ## sendContact * Use this method to send phone contacts. On success, the sent Message is returned. * @see https://core.telegram.org/bots/api#sendcontact */ sendContact(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; phone_number: string; first_name: string; last_name?: string; vcard?: string; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** * ## sendPoll * Use this method to send a native poll. On success, the sent Message is returned. * @see https://core.telegram.org/bots/api#sendpoll */ sendPoll(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; question: string; question_parse_mode?: ParseMode; question_entities?: MessageEntity[]; options: InputPollOption[]; is_anonymous?: boolean; type?: 'quiz' | 'regular'; allows_multiple_answers?: boolean; allows_revoting?: boolean; shuffle_options?: boolean; allow_adding_options?: boolean; hide_results_until_closes?: boolean; /** * Pass True, if voting is limited to users who have been members of the chat where the poll is being sent for more * than 24 hours; for channel chats only */ members_only?: boolean; /** * A JSON-serialized list of 0-12 two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which * users can vote in the poll; for channel chats only. If omitted or empty, then users from any country can * participate in the poll. */ country_codes?: string[]; correct_option_ids?: number[]; explanation?: string; explanation_parse_mode?: ParseMode; explanation_entities?: MessageEntity[]; /** * Media added to the quiz explanation */ explanation_media?: InputPollMedia; open_period?: number; close_date?: number; is_closed?: boolean; description?: string; description_parse_mode?: ParseMode; description_entities?: MessageEntity[]; /** * Media added to the poll description */ media?: InputPollMedia; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** * ## sendDice * Use this method to send an animated emoji that will display a random value. On success, the sent Message is * returned. * @see https://core.telegram.org/bots/api#senddice */ sendDice(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; emoji?: '🎲' | '🎯' | '🏀' | '⚽' | '🎳' | '🎰'; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** * ## sendMessageDraft * Use this method to stream a partial message to a user while the message is being generated. Note that the streamed * draft is ephemeral and acts as a temporary 30-second preview - once the output is finalized, you must call * sendMessage with the complete message to persist it in the user's chat. Returns True on success. * @see https://core.telegram.org/bots/api#sendmessagedraft */ sendMessageDraft(options: { /** * Unique identifier for the target private chat */ chat_id: number; /** * Unique identifier for the target message thread */ message_thread_id?: number; /** * Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated */ draft_id: number; /** * Text of the message to be sent, 0-4096 characters after entities parsing. Pass an empty text to show a * “Thinking…” placeholder. */ text?: string; /** * Mode for parsing entities in the message text. See formatting options for more details. */ parse_mode?: ParseMode; /** * A JSON-serialized list of special entities that appear in message text, which can be specified instead of * parse_mode */ entities?: MessageEntity[]; }): Promise; /** * ## sendChatAction * Use this method when you need to tell the user that something is happening on the bot's side. The status is set for * 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on * success. * @see https://core.telegram.org/bots/api#sendchataction */ sendChatAction(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; action: 'typing' | 'upload_photo' | 'record_video' | 'upload_video' | 'record_voice' | 'upload_voice' | 'upload_document' | 'choose_sticker' | 'find_location' | 'record_video_note' | 'upload_video_note'; }): Promise; /** * ## setMessageReaction * Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically * forwarded messages from a channel to its discussion group have the same available reactions as messages in the * channel. Returns True on success. * @see https://core.telegram.org/bots/api#setmessagereaction */ setMessageReaction(options: { chat_id: number | string; message_id: number; reaction?: ReactionType[]; is_big?: boolean; }): Promise; /** * ## deleteMessageReaction * Use this method to remove a reaction from a message in a group or a supergroup chat. The bot must have the * 'can_delete_messages' administrator right in the chat. Returns True on success. * @see https://core.telegram.org/bots/api#deletemessagereaction */ deleteMessageReaction(options: { chat_id: number | string; message_id: number; /** * Identifier of the user whose reaction will be removed, if the reaction was added by a user */ user_id?: number; /** * Identifier of the chat whose reaction will be removed, if the reaction was added by a chat */ actor_chat_id?: number; }): Promise; /** * ## deleteAllMessageReactions * Use this method to remove up to 10000 recent reactions in a group or a supergroup chat added by a given user or * chat. The bot must have the 'can_delete_messages' administrator right in the chat. Returns True on success. * @see https://core.telegram.org/bots/api#deleteallmessagereactions */ deleteAllMessageReactions(options: { chat_id: number | string; /** * Identifier of the user whose reactions will be removed, if the reactions were added by a user */ user_id?: number; /** * Identifier of the chat whose reactions will be removed, if the reactions were added by a chat */ actor_chat_id?: number; }): Promise; /** * ## getUserProfilePhotos * Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object. * @see https://core.telegram.org/bots/api#getuserprofilephotos */ getUserProfilePhotos(options: { user_id: number; offset?: number; limit?: number; }): Promise; /** * ## setMyProfilePhoto * Changes the profile photo of the bot. Returns True on success. * @see https://core.telegram.org/bots/api#setmyprofilephoto */ setMyProfilePhoto(options: { photo: InputProfilePhoto; }): Promise; /** * ## removeMyProfilePhoto * Removes the profile photo of the bot. Requires no parameters. Returns True on success. * @see https://core.telegram.org/bots/api#removemyprofilephoto */ removeMyProfilePhoto(): Promise; /** * ## getUserProfileAudios * Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object. * @see https://core.telegram.org/bots/api#getuserprofileaudios */ getUserProfileAudios(options: { user_id: number; offset?: number; limit?: number; }): Promise; /** * ## setUserEmojiStatus * Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the * Mini App method requestEmojiStatusAccess. Returns True on success. * @see https://core.telegram.org/bots/api#setuseremojistatus */ setUserEmojiStatus(options: { user_id: number; emoji_status_custom_emoji_id?: string; emoji_status_expiration_date?: number; }): Promise; /** * ## getFile * Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can * download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via * the link ```https://api.telegram.org/file/bot/```, where `````` is taken from the * response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be * requested by calling getFile again. * @see https://core.telegram.org/bots/api#getfile */ getFile(options: { file_id: string; }): Promise; /** * ## banChatMember * Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the * user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot * must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns * True on success. * @see https://core.telegram.org/bots/api#banchatmember */ banChatMember(options: { chat_id: number | string; user_id: number; until_date?: number; revoke_messages?: boolean; }): Promise; /** * ## unbanChatMember * Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group * or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to * work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able * to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, * use the parameter only_if_banned. Returns True on success. * @see https://core.telegram.org/bots/api#unbanchatmember */ unbanChatMember(options: { chat_id: number | string; user_id: number; only_if_banned?: boolean; }): Promise; /** * ## restrictChatMember * Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to * work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a * user. Returns True on success. * @see https://core.telegram.org/bots/api#restrictchatmember */ restrictChatMember(options: { chat_id: number | string; user_id: number; permissions: ChatPermissions; use_independent_chat_permissions?: boolean; until_date?: number; }): Promise; /** * ## promoteChatMember * Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the * chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to * demote a user. Returns True on success. * @see https://core.telegram.org/bots/api#promotechatmember */ promoteChatMember(options: { chat_id: number | string; user_id: number; is_anonymous?: boolean; can_manage_chat?: boolean; can_delete_messages?: boolean; can_manage_video_chats?: boolean; can_restrict_members?: boolean; can_promote_members?: boolean; can_change_info?: boolean; can_invite_users?: boolean; can_post_stories?: boolean; can_edit_stories?: boolean; can_delete_stories?: boolean; can_post_messages?: boolean; can_edit_messages?: boolean; can_pin_messages?: boolean; can_manage_topics?: boolean; /** * Pass True if the administrator can manage direct messages within the channel and decline suggested posts; * for channels only */ can_manage_direct_messages?: boolean; /** * Pass True if the administrator can edit the tags of regular members; for groups and supergroups only */ can_manage_tags?: boolean; }): Promise; /** * ## setChatAdministratorCustomTitle * Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on * success. * @see https://core.telegram.org/bots/api#setchatadministratorcustomtitle */ setChatAdministratorCustomTitle(options: { chat_id: number | string; user_id: number; custom_title: string; }): Promise; /** * ## setChatMemberTag * Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in * the chat for this to work and must have the can_manage_tags administrator right. Returns True on success. * @see https://core.telegram.org/bots/api#setchatmembertag */ setChatMemberTag(options: { chat_id: number | string; user_id: number; tag?: string; }): Promise; /** * ## banChatSenderChat * Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the * banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator * in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on * \success. * @see https://core.telegram.org/bots/api#banchatsenderchat */ banChatSenderChat(options: { chat_id: number | string; sender_chat_id: number; }): Promise; /** * ## unbanChatSenderChat * Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an * administrator for this to work and must have the appropriate administrator rights. Returns True on success. * @see https://core.telegram.org/bots/api#unbanchatsenderchat */ unbanChatSenderChat(options: { chat_id: number | string; sender_chat_id: number; }): Promise; /** * ## setChatPermissions * Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an * administrator for this to work and must have the appropriate administrator rights. Returns True on success. * @see https://core.telegram.org/bots/api#setchatpermissions */ setChatPermissions(options: { chat_id: number | string; permissions: ChatPermissions; use_independent_chat_permissions?: boolean; }): Promise; /** * ## exportChatInviteLink * Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. * The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. * Returns the new invite link as String on success. * @see https://core.telegram.org/bots/api#exportchatinvitelink */ exportChatInviteLink(options: { chat_id: number | string; }): Promise; /** * ## createChatSubscriptionInviteLink * Use this method to create a subscription invite link for a channel chat. The bot must have the `can_invite_users` * administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the * method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object. */ createChatSubscriptionInviteLink(options: { chat_id: number | string; name?: string; subscription_period: number; subscription_price: number; }): Promise; /** * ## editChatSubscriptionInviteLink * Use this method to edit a subscription invite link created by the bot. The bot must have the `can_invite_users` * administrator rights. Returns the edited invite link as a ChatInviteLink object. */ editChatSubscriptionInviteLink(options: { chat_id: number | string; invite_link: string; name?: string; }): Promise; /** * ## createChatInviteLink * Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for * this to work and must have the appropriate administrator rights. The link can be revoked using the method * revokeChatInviteLink. Returns the new invite link as ChatInviteLink object. * @see https://core.telegram.org/bots/api#createchatinvitelink */ createChatInviteLink(options: { chat_id: number | string; name?: string; expire_date?: number; member_limit?: number; creates_join_request?: boolean; }): Promise; /** * ## editChatInviteLink * Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat * for this to work and must have the appropriate administrator rights. Returns the edited invite link as a * ChatInviteLink object. * @see https://core.telegram.org/bots/api#editchatinvitelink */ editChatInviteLink(options: { chat_id: number | string; invite_link: string; name?: string; expire_date?: number; member_limit?: number; creates_join_request?: boolean; }): Promise; /** * ## revokeChatInviteLink * Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is * automatically generated. The bot must be an administrator in the chat for this to work and must have the * appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object. * @see https://core.telegram.org/bots/api#revokechatinvitelink */ revokeChatInviteLink(options: { chat_id: number | string; invite_link: string; }): Promise; /** * ## approveChatJoinRequest * Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and * must have the can_invite_users administrator right. Returns True on success. * @see https://core.telegram.org/bots/api#approvechatjoinrequest */ approveChatJoinRequest(options: { chat_id: number | string; user_id: number; }): Promise; /** * ## declineChatJoinRequest * Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and * must have the can_invite_users administrator right. Returns True on success. * @see https://core.telegram.org/bots/api#declinechatjoinrequest */ declineChatJoinRequest(options: { chat_id: number | string; user_id: number; }): Promise; /** * ## setChatPhoto * Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be * an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on * success. * @see https://core.telegram.org/bots/api#setchatphoto */ setChatPhoto(options: { chat_id: number | string; photo: InputFile; }): Promise; /** * ## deleteChatPhoto * Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator * in the chat for this to work and must have the appropriate administrator rights. Returns True on success. * @see https://core.telegram.org/bots/api#deletechatphoto */ deleteChatPhoto(options: { chat_id: number | string; }): Promise; /** * ## setChatTitle * Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an * administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on * success. * @see https://core.telegram.org/bots/api#setchattitle */ setChatTitle(options: { chat_id: number | string; title: string; }): Promise; /** * ## setChatDescription * Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator * in the chat for this to work and must have the appropriate administrator rights. Returns True on success. * @see https://core.telegram.org/bots/api#setchatdescription */ setChatDescription(options: { chat_id: number | string; description?: string; }): Promise; /** * ## pinChatMessage * Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the * bot must be an administrator in the chat for this to work and must have the ```'can_pin_messages'``` administrator * right in a supergroup or ```'can_edit_messages'``` administrator right in a channel. Returns True on success. * @see https://core.telegram.org/bots/api#pinchatmessage */ pinChatMessage(options: { business_connection_id?: string; chat_id: number | string; message_id: number; disable_notification?: boolean; }): Promise; /** * ## unpinChatMessage * Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, * the bot must be an administrator in the chat for this to work and must have the ```'can_pin_messages'``` * administrator right in a supergroup or ```'can_edit_messages'``` administrator right in a channel. Returns True on * success. * @see https://core.telegram.org/bots/api#unpinchatmessage */ unpinChatMessage(options: { business_connection_id?: string; chat_id: number | string; message_id?: number; }): Promise; /** * ## unpinAllChatMessages * Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be * an administrator in the chat for this to work and must have the ```'can_pin_messages'``` administrator right in a * supergroup or ```'can_edit_messages'``` administrator right in a channel. Returns True on success. * @see https://core.telegram.org/bots/api#unpinallchatmessages */ unpinAllChatMessages(options: { chat_id: number | string; }): Promise; /** * ## leaveChat * Use this method for your bot to leave a group, supergroup or channel. Returns True on success. * @see https://core.telegram.org/bots/api#leavechat */ leaveChat(options: { chat_id: number | string; }): Promise; /** * ## getChat * Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success. * @see https://core.telegram.org/bots/api#getchat */ getChat(options: { chat_id: number | string; }): Promise; /** * ## getChatAdministrators * Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of ChatMember * objects. * @see https://core.telegram.org/bots/api#getchatadministrators */ getChatAdministrators(options: { chat_id: number | string; /** * Pass True to additionally receive all bots that are administrators of the chat. By default, bots other than the * current bot are omitted. */ return_bots?: boolean; }): Promise; /** * ## getChatMemberCount * Use this method to get the number of members in a chat. Returns Int on success. * @see https://core.telegram.org/bots/api#getchatmembercount */ getChatMemberCount(options: { chat_id: number | string; }): Promise; /** * ## getChatMember * Use this method to get information about a member of a chat. The method is only guaranteed to work for other users * if the bot is an administrator in the chat. Returns a ChatMember object on success. * @see https://core.telegram.org/bots/api#getchatmember */ getChatMember(options: { chat_id: number | string; user_id: number; }): Promise; /** * ## getUserPersonalChatMessages * Use this method to get the last messages from the personal chat (i.e., the chat currently added to their profile) * of a given user. On success, an array of Message objects is returned. * @see https://core.telegram.org/bots/api#getuserpersonalchatmessages */ getUserPersonalChatMessages(options: { /** * Unique identifier for the target user */ user_id: number; /** * The maximum number of messages to return; 1-20 */ limit: number; }): Promise; /** * ## setChatStickerSet * Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for * this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally * returned in getChat requests to check if the bot can use this method. Returns True on success. * @see https://core.telegram.org/bots/api#setchatstickerset */ setChatStickerSet(options: { chat_id: number | string; sticker_set_name: string; }): Promise; /** * ## deleteChatStickerSet * Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for * this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally * returned in getChat requests to check if the bot can use this method. Returns True on success. * @see https://core.telegram.org/bots/api#deletechatstickerset */ deleteChatStickerSet(options: { chat_id: number | string; }): Promise; /** * ## getForumTopicIconStickers * Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no * parameters. Returns an Array of Sticker objects. * @see https://core.telegram.org/bots/api#getforumtopiciconstickers */ getForumTopicIconStickers(): Promise; /** * ## createForumTopic * Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a * supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics * administrator right. Returns information about the created topic as a ForumTopic object. * @see https://core.telegram.org/bots/api#createforumtopic */ createForumTopic(options: { chat_id: number | string; name: string; icon_color?: string; icon_custom_emoji_id?: string; }): Promise; /** * ## editForumTopic * Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the * case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the * can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. * @see https://core.telegram.org/bots/api#editforumtopic */ editForumTopic(options: { chat_id: number | string; message_thread_id: number; name?: string; icon_custom_emoji_id?: string; }): Promise; /** * ## closeForumTopic * Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for * this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. * Returns True on success. * @see https://core.telegram.org/bots/api#closeforumtopic */ closeForumTopic(options: { chat_id: number | string; message_thread_id: number; }): Promise; /** * ## reopenForumTopic * Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat * for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. * Returns True on success. * @see https://core.telegram.org/bots/api#reopenforumtopic */ reopenForumTopic(options: { chat_id: number | string; message_thread_id: number; }): Promise; /** * ## deleteForumTopic * Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat * with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and * must have the can_delete_messages administrator rights. Returns True on success. * @see https://core.telegram.org/bots/api#deleteforumtopic */ deleteForumTopic(options: { chat_id: number | string; message_thread_id: number; }): Promise; /** * ## unpinAllForumTopicMessages * Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat * with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and * must have the can_pin_messages administrator right in the supergroup. Returns True on success. * @see https://core.telegram.org/bots/api#unpinallforumtopicmessages */ unpinAllForumTopicMessages(options: { chat_id: number | string; message_thread_id: number; }): Promise; /** * ## editGeneralForumTopic * Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an * administrator in the chat for this to work and must have can_manage_topics administrator rights. Returns True on * success. * @see https://core.telegram.org/bots/api#editgeneralforumtopic */ editGeneralForumTopic(options: { chat_id: number | string; name: string; }): Promise; /** * ## closeGeneralForumTopic * Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in * the chat for this to work and must have the ```can_manage_topics``` administrator rights. Returns True on success. * @see https://core.telegram.org/bots/api#closegeneralforumtopic */ closeGeneralForumTopic(options: { chat_id: number | string; }): Promise; /** * ## reopenGeneralForumTopic * Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in * the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically * unhidden if it was hidden. Returns True on success. * @see https://core.telegram.org/bots/api#reopengeneralforumtopic */ reopenGeneralForumTopic(options: { chat_id: number | string; }): Promise; /** * ## hideGeneralForumTopic * Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the * chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically * closed if it was open. Returns True on success. * @see https://core.telegram.org/bots/api#hidegeneralforumtopic */ hideGeneralForumTopic(options: { chat_id: number | string; }): Promise; /** * ## unhideGeneralForumTopic * Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the * chat for this to work and must have the can_manage_topics administrator rights. Returns True on success. * @see https://core.telegram.org/bots/api#unhidegeneralforumtopic */ unhideGeneralForumTopic(options: { chat_id: number | string; }): Promise; /** * ## unpinAllGeneralForumTopicMessages * se this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in * the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on * success. * @see https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages */ unpinAllGeneralForumTopicMessages(options: { chat_id: number | string; }): Promise; /** * ## answerCallbackQuery * Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the * user as a notification at the top of the chat screen or as an alert. On success, True is returned. * @see https://core.telegram.org/bots/api#answercallbackquery */ answerCallbackQuery(options: { callback_query_id: string; text?: string; show_alert?: boolean; url?: string; cache_time?: number; }): Promise; /** * ## getUserChatBoosts * Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. * Returns a UserChatBoosts object. * @see https://core.telegram.org/bots/api#getuserchatboosts */ getUserChatBoosts(options: { chat_id: number | string; user_id: number; }): Promise; /** * ## getBusinessConnection * Use this method to get information about the connection of the bot with a business account. Returns a * BusinessConnection object on success. * @see https://core.telegram.org/bots/api#getbusinessconnection */ getBusinessConnection(options: { business_connection_id: string; }): Promise; /** * ## getManagedBotToken * Use this method to get the token of a managed bot. Returns the token as String on success. * @see https://core.telegram.org/bots/api#getmanagedbottoken */ getManagedBotToken(options: { /** * User identifier of the managed bot whose token will be returned */ user_id: number; }): Promise; /** * ## replaceManagedBotToken * Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as * String on success. * @see https://core.telegram.org/bots/api#replacemanagedbottoken */ replaceManagedBotToken(options: { /** * User identifier of the managed bot whose token will be replaced */ user_id: number; }): Promise; /** * ## getManagedBotAccessSettings * Use this method to get the access settings of a managed bot. Returns a BotAccessSettings object on success. * @see https://core.telegram.org/bots/api#getmanagedbotaccesssettings */ getManagedBotAccessSettings(options: { /** * User identifier of the managed bot whose access settings will be returned */ user_id: number; }): Promise; /** * ## setManagedBotAccessSettings * Use this method to change the access settings of a managed bot. Returns True on success. * @see https://core.telegram.org/bots/api#setmanagedbotaccesssettings */ setManagedBotAccessSettings(options: { /** * User identifier of the managed bot whose access settings will be changed */ user_id: number; /** * Pass True, if only selected users can access the bot. The bot's owner can always access it. */ is_access_restricted: boolean; /** * A JSON-serialized list of up to 10 identifiers of users who will have access to the bot in addition to its * owner. Ignored if is_access_restricted is false. */ added_user_ids?: number[]; }): Promise; /** * ## setMyCommands * Use this method to change the list of the bot's commands. See this manual for more details about bot commands. * Returns True on success. * @see https://core.telegram.org/bots/api#setmycommands */ setMyCommands(options: { commands: BotCommand[]; scope?: BotCommandScope; language_code?: string; }): Promise; /** * ## deleteMyCommands * Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, * higher level commands will be shown to affected users. Returns True on success. * @see https://core.telegram.org/bots/api#deletemycommands */ deleteMyCommands(options?: { scope?: BotCommandScope; language_code?: string; }): Promise; /** * ## getMyCommands * Use this method to get the current list of the bot's commands for the given scope and user language. Returns an * Array of BotCommand objects. If commands aren't set, an empty list is returned. * @see https://core.telegram.org/bots/api#getmycommands */ getMyCommands(options?: { scope?: BotCommandScope; language_code?: string; }): Promise; /** * ## setMyName * Use this method to change the bot's name. Returns True on success. * @see https://core.telegram.org/bots/api#setmyname */ setMyName(options?: { name?: string; language_code?: string; }): Promise; /** * ## getMyName * Use this method to get the current bot name for the given user language. Returns BotName on success. * @see https://core.telegram.org/bots/api#getmyname */ getMyName(options?: { language_code?: string; }): Promise; /** * ## setMyDescription * Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. * Returns True on success. * @see https://core.telegram.org/bots/api#setmydescription */ setMyDescription(options?: { description?: string; language_code?: string; }): Promise; /** * ## getMyDescription * Use this method to get the current bot description for the given user language. Returns BotDescription on success. * @see https://core.telegram.org/bots/api#getmydescription */ getMyDescription(options?: { language_code?: string; }): Promise; /** * ## setMyShortDescription * Use this method to change the bot's short description, which is shown on the bot's profile page and is sent * together with the link when users share the bot. Returns True on success. * @see https://core.telegram.org/bots/api#setmyshortdescription */ setMyShortDescription(options?: { short_description?: string; language_code?: string; }): Promise; /** * ## getMyShortDescription * Use this method to get the current bot short description for the given user language. Returns BotShortDescription * on success. * @see https://core.telegram.org/bots/api#getmyshortdescription */ getMyShortDescription(options?: { language_code?: string; }): Promise; /** * ## setChatMenuButton * Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on * success. * @see https://core.telegram.org/bots/api#setchatmenubutton */ setChatMenuButton(options?: { chat_id?: number | string; menu_button?: MenuButton; }): Promise; /** * ## getChatMenuButton * Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. * Returns MenuButton on success. * @see https://core.telegram.org/bots/api#getchatmenubutton */ getChatMenuButton(options?: { chat_id?: number | string; }): Promise; /** * ## setMyDefaultAdministratorRights * Use this method to change the default administrator rights requested by the bot when it's added as an administrator * to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding * the bot. Returns True on success. * @see https://core.telegram.org/bots/api#setmydefaultadministratorrights */ setMyDefaultAdministratorRights(options: { rights: ChatAdministratorRights; for_channels?: boolean; }): Promise; /** * ## getMyDefaultAdministratorRights * Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on * success. * @see https://core.telegram.org/bots/api#getmydefaultadministratorrights */ getMyDefaultAdministratorRights(options?: { for_channels?: boolean; }): Promise; /** * ## editMessageText * Use this method to edit text and game messages. On success, if the edited message is not an inline message, the * edited Message is returned, otherwise True is returned. * @see https://core.telegram.org/bots/api#editmessagetext */ editMessageText(options: ({ chat_id: number | string; message_id: number; } | { inline_message_id: string; }) & { business_connection_id?: string; text: string; parse_mode?: ParseMode; entities?: MessageEntity[]; link_preview_options?: LinkPreviewOptions; reply_markup?: InlineKeyboardMarkup; }): Promise; /** * ## editMessageCaption * Use this method to edit captions of messages. On success, if the edited message is not an inline message, the * edited Message is returned, otherwise True is returned. * @see https://core.telegram.org/bots/api#editmessagecaption */ editMessageCaption(options: ({ chat_id: number | string; message_id: number; } | { inline_message_id: string; }) & { business_connection_id?: string; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; show_caption_above_media?: boolean; reply_markup?: InlineKeyboardMarkup; }): Promise; /** * ## editMessageMedia * Use this method to edit animation, audio, document, live photo, photo, or video messages, or to add media to text * messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only * to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is * edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, * if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note * that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited * within 48 hours from the time they were sent. * @see https://core.telegram.org/bots/api#editmessagemedia */ editMessageMedia(options: ({ chat_id: number | string; message_id: number; } | { inline_message_id: string; }) & { business_connection_id?: string; media: InputMedia; reply_markup?: InlineKeyboardMarkup; }): Promise; /** * ## editMessageLiveLocation * Use this method to edit live location messages. A location can be edited until its live_period expires or editing * is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline * message, the edited Message is returned, otherwise True is returned. * @see https://core.telegram.org/bots/api#editmessagelivelocation */ editMessageLiveLocation(options: ({ chat_id: number | string; message_id: number; } | { inline_message_id: string; }) & { business_connection_id?: string; latitude: number; longitude: number; live_period?: number; horizontal_accuracy?: number; heading?: number; proximity_alert_radius?: number; reply_markup?: InlineKeyboardMarkup; }): Promise; /** * ## stopMessageLiveLocation * se this method to stop updating a live location message before live_period expires. On success, if the message is * not an inline message, the edited Message is returned, otherwise True is returned. * @see https://core.telegram.org/bots/api#stopmessagelivelocation */ stopMessageLiveLocation(options: ({ chat_id: number | string; message_id: number; } | { inline_message_id: string; }) & { business_connection_id?: string; reply_markup?: InlineKeyboardMarkup; }): Promise; /** * ## editMessageReplyMarkup * Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline * message, the edited Message is returned, otherwise True is returned. * @see https://core.telegram.org/bots/api#editmessagereplymarkup */ editMessageReplyMarkup(options: ({ chat_id: number | string; message_id: number; } | { inline_message_id: string; }) & { business_connection_id?: string; reply_markup?: InlineKeyboardMarkup; }): Promise; /** * ## stopPoll * Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned. * @see https://core.telegram.org/bots/api#stoppoll */ stopPoll(options: { business_connection_id?: string; chat_id: number | string; message_id: number; reply_markup?: InlineKeyboardMarkup; }): Promise; /** * ## deleteMessage * Use this method to delete a message, including service messages, with the following limitations: * - A message can only be deleted if it was sent less than 48 hours ago. * - Service messages about a supergroup, channel, or forum topic creation can't be deleted. * - A dice message in a private chat can only be deleted if it was sent more than 24 hours ago. * - Bots can delete outgoing messages in private chats, groups, and supergroups. * - Bots can delete incoming messages in private chats. * - Bots granted can_post_messages permissions can delete outgoing messages in channels. * - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there. * Returns True on success. * @see https://core.telegram.org/bots/api#deletemessage */ deleteMessage(options: { chat_id: number | string; message_id: number; }): Promise; /** * ## deleteMessages * Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they * are skipped. Returns True on success. * @see https://core.telegram.org/bots/api#deletemessages */ deleteMessages(options: { chat_id: number | string; message_ids: number[]; }): Promise; /** * ## sendSticker * Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is * returned. * @see https://core.telegram.org/bots/api#sendsticker */ sendSticker(options: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; sticker: InputFile | string; emoji?: string; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply; }): Promise; /** * ## getStickerSet * Use this method to get a sticker set. On success, a StickerSet object is returned. * @see https://core.telegram.org/bots/api#getstickerset */ getStickerSet(options: { name: string; }): Promise; /** * ## getCustomEmojiStickers * Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker * objects. * @see https://core.telegram.org/bots/api#getcustomemojistickers */ getCustomEmojiStickers(options: { custom_emoji_ids: string[]; }): Promise; /** * ## uploadStickerFile * Use this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or * replaceStickerInSet methods (the file can be used multiple times). Returns the uploaded File on success. * @see https://core.telegram.org/bots/api#uploadstickerfile */ uploadStickerFile(options: { user_id: number; sticker: InputFile; sticker_format?: InputSticker['format']; }): Promise; /** * ## createNewStickerSet * Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus * created. Returns True on success. * @see https://core.telegram.org/bots/api#createnewstickerset */ createNewStickerSet(options: { user_id: number; name: string; title: string; stickers: InputSticker[]; sticker_type?: Sticker['type']; needs_repainting?: boolean; }): Promise; /** * ## addStickerToSet * Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. * Other sticker sets can have up to 120 stickers. Returns True on success. * @see https://core.telegram.org/bots/api#addstickertoset */ addStickerToSet(options: { user_id: number; name: string; sticker: InputSticker; }): Promise; /** * ## setStickerPositionInSet * Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success. * @see https://core.telegram.org/bots/api#setstickerpositioninset */ setStickerPositionInSet(options: { sticker: string; position: number; }): Promise; /** * ## deleteStickerFromSet * Use this method to delete a sticker from a set created by the bot. Returns True on success. * @see https://core.telegram.org/bots/api#deletestickerfromset */ deleteStickerFromSet(options: { sticker: string; }): Promise; /** * ## replaceStickerInSet * Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling * deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet. Returns True on success. * @see https://core.telegram.org/bots/api#replacestickerinset */ replaceStickerInSet(options: { user_id: number; name: string; old_sticker: string; sticker: InputSticker; }): Promise; /** * ## setStickerEmojiList * Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong * to a sticker set created by the bot. Returns True on success. * @see https://core.telegram.org/bots/api#setstickeremojilist */ setStickerEmojiList(options: { sticker: string; emoji_list: string[]; }): Promise; /** * ## setStickerKeywords * Use this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to * a sticker set created by the bot. Returns True on success. * @see https://core.telegram.org/bots/api#setstickerkeywords */ setStickerKeywords(options: { sticker: string; keywords: string[]; }): Promise; /** * ## setStickerMaskPosition * Use this method to change the mask position of a mask sticker. The sticker must belong to a sticker set that was * created by the bot. Returns True on success. * @see https://core.telegram.org/bots/api#setstickermaskposition */ setStickerMaskPosition(options: { sticker: string; mask_position: MaskPosition; }): Promise; /** * ## setStickerSetTitle * Use this method to set the title of a created sticker set. Returns True on success. * @see https://core.telegram.org/bots/api#setstickersettitle */ setStickerSetTitle(options: { name: string; title: string; }): Promise; /** * ## setStickerSetThumbnail * Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match * the format of the stickers in the set. Returns True on success. * @see https://core.telegram.org/bots/api#setstickersetthumbnail */ setStickerSetThumbnail(options: { name: string; user_id: number; thumbnail?: InputFile | string; format: InputSticker['format']; }): Promise; /** * ## setCustomEmojiStickerSetThumbnail * Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success. * @see https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail */ setCustomEmojiStickerSetThumbnail(options: { name: string; custom_emoji_id?: string; }): Promise; /** * ## deleteStickerSet * Use this method to delete a sticker set that was created by the bot. Returns True on success. * @see https://core.telegram.org/bots/api#deletestickerset */ deleteStickerSet(options: { name: string; }): Promise; /** * ## answerInlineQuery * Use this method to send answers to an inline query. On success, True is returned. * No more than 50 results per query are allowed. * @see https://core.telegram.org/bots/api#answerinlinequery */ answerInlineQuery(options: { inline_query_id: string; results: InlineQueryResult[]; cache_time?: number; is_personal?: boolean; next_offset?: string; button?: InlineQueryResultsButton; }): Promise; /** * ## answerWebAppQuery * Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of * the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned. * @see https://core.telegram.org/bots/api#answerwebappquery */ answerWebAppQuery(options: { web_app_query_id: string; result: InlineQueryResult; }): Promise; /** * ## answerGuestQuery * Use this method to reply to a received guest message. On success, a SentGuestMessage object is returned. * @see https://core.telegram.org/bots/api#answerguestquery */ answerGuestQuery(options: { /** * Unique identifier for the query to be answered */ guest_query_id: string; /** * A JSON-serialized object describing the message to be sent */ result: InlineQueryResult; }): Promise; /** * ## savePreparedInlineMessage * Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object. * @see https://core.telegram.org/bots/api#savepreparedinlinemessage */ savePreparedInlineMessage(options: { /** * Unique identifier of the target user that can use the prepared message */ user_id: number; /** * A JSON-serialized object describing the message to be sent */ result: InlineQueryResult; /** * Pass True if the message can be sent to private chats with users */ allow_user_chats?: boolean; /** * Pass True if the message can be sent to private chats with bots */ allow_bot_chats?: boolean; /** * Pass True if the message can be sent to group and supergroup chats */ allow_group_chats?: boolean; /** * Pass True if the message can be sent to channel chats */ allow_channel_chats?: boolean; }): Promise; /** * ## savePreparedKeyboardButton * Stores a keyboard button that can be used by a user within a Mini App. Returns a PreparedKeyboardButton object. * @see https://core.telegram.org/bots/api#savepreparedkeyboardbutton */ savePreparedKeyboardButton(options: { /** * Unique identifier of the target user that can use the button */ user_id: number; /** * A JSON-serialized object describing the button to be saved. The button must be of the type request_users, * request_chat, or request_managed_bot */ button: KeyboardButton; }): Promise; /** * ## sendInvoice * Use this method to send invoices. On success, the sent Message is returned. * @see https://core.telegram.org/bots/api#sendinvoice */ sendInvoice(options: { chat_id: number | string; message_thread_id?: number; /** * Identifier of the direct messages topic to which the message will be forwarded; required if the message is * forwarded to a direct messages chat */ direct_messages_topic_id?: number; title: string; description: string; payload: string; provider_token?: T extends 'XTR' ? never : string; currency: T; prices: T extends 'XTR' ? [LabeledPrice] : LabeledPrice[]; max_tip_amount?: T extends 'XTR' ? never : number; suggested_tip_amounts?: number[]; start_parameter: string; provider_data?: string; photo_url?: string; photo_size?: number; photo_width?: number; photo_height?: number; need_name?: T extends 'XTR' ? never : boolean; need_phone_number?: T extends 'XTR' ? never : boolean; need_email?: T extends 'XTR' ? never : boolean; need_shipping_address?: T extends 'XTR' ? never : boolean; send_phone_number_to_provider?: T extends 'XTR' ? never : boolean; send_email_to_provider?: T extends 'XTR' ? never : boolean; is_flexible?: T extends 'XTR' ? never : boolean; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; /** * A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. * If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. */ suggested_post_parameters?: SuggestedPostParameters; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup; }): Promise; /** * ## createInvoiceLink * Use this method to create a link for an invoice. Returns the created invoice link as String on success. * @see https://core.telegram.org/bots/api#createinvoicelink */ createInvoiceLink(options: { business_connection_id?: string; title: string; description: string; payload: string; provider_token?: string; currency: T; prices: T extends 'XTR' ? [LabeledPrice] : LabeledPrice[]; subscription_period?: T extends 'XTR' ? number : never; max_tip_amount?: T extends 'XTR' ? never : number; suggested_tip_amounts?: number[]; provider_data?: string; photo_url?: string; photo_size?: number; photo_width?: number; photo_height?: number; need_name?: T extends 'XTR' ? never : boolean; need_phone_number?: T extends 'XTR' ? never : boolean; need_email?: T extends 'XTR' ? never : boolean; need_shipping_address?: T extends 'XTR' ? never : boolean; send_phone_number_to_provider?: T extends 'XTR' ? never : boolean; send_email_to_provider?: T extends 'XTR' ? never : boolean; is_flexible?: T extends 'XTR' ? never : boolean; }): Promise; /** * ## answerShippingQuery * If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will * send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, * True is returned. * @see https://core.telegram.org/bots/api#answershippingquery */ answerShippingQuery(options: { shipping_query_id: string; ok: true; shipping_options: ShippingOption[]; } | { shipping_query_id: string; ok: false; error_message: string; }): Promise; /** * ## answerPreCheckoutQuery * Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the * form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On * success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query * was sent. * @see https://core.telegram.org/bots/api#answerprecheckoutquery */ answerPreCheckoutQuery(options: { pre_checkout_query_id: string; } & ({ ok: true; error_message?: never; } | { ok: false; error_message: string; })): Promise; /** * ## getMyStarBalance * A method to get the current Telegram Stars balance of the bot. Requires no parameters. * On success, returns a StarAmount object. * @see https://core.telegram.org/bots/api#getmystarbalance */ getMyStarBalance(): Promise; /** * ## getStarTransactions * Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object. * @see https://core.telegram.org/bots/api#getstartransactions */ getStarTransactions(options?: { offset?: number; limit?: number; }): Promise; /** * ## refundStarPayment * Refunds a successful payment in Telegram Stars. Returns True on success. * @see https://core.telegram.org/bots/api#refundstarpayment */ refundStarPayment(options: { user_id: number; telegram_payment_charge_id: string; }): Promise; /** * ## editUserStarSubscription * Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success. * @see https://core.telegram.org/bots/api#edituserstarsubscription */ editUserStarSubscription(options: { user_id: number; telegram_payment_charge_id: string; is_canceled: boolean; }): Promise; /** * ## setPassportDataErrors * Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able * to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the * error must change). Returns True on success. * Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For * example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. * Supply some details in the error message to make sure the user knows how to correct the issues. * @see https://core.telegram.org/bots/api#setpassportdataerrors */ setPassportDataErrors(options: { user_id: number; errors: PassportElementError[]; }): Promise; /** * ## sendGame * Use this method to send a game. On success, the sent Message is returned. * @see https://core.telegram.org/bots/api#sendgame */ sendGame(options: { business_connection_id?: string; chat_id: number; message_thread_id?: number; game_short_name: string; disable_notification?: boolean; protect_content?: boolean; /** * Pass True to allow up to 1000 messages per second, ignoring * [broadcasting limits](https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once) * for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance */ allow_paid_broadcast?: boolean; message_effect_id?: string; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup; }): Promise; /** * ## setGameScore * Use this method to set the score of the specified user in a game message. On success, if the message is not an * inline message, the [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned. * Returns an error, if the new score is not greater than the user's current score in the chat and force is False. * @see https://core.telegram.org/bots/api#setgamescore */ setGameScore(options: ({ chat_id: number; message_id: number; } | { inline_message_id: string; }) & { user_id: number; score: number; force?: boolean; disable_edit_message?: boolean; }): Promise; /** * ## getGameHighScores * Use this method to get data for high score tables. Will return the score of the specified user and several of their * neighbors in a game. Returns an Array of GameHighScore objects. * > This method will currently return scores for the target user, plus two of their closest neighbors on each side. * Will also return the top three users if the user and their neighbors are not among them. Please note that this * behavior is subject to change. * @see https://core.telegram.org/bots/api#getgamehighscores */ getGameHighScores(options: ({ chat_id: number; message_id: number; } | { inline_message_id: string; }) & { user_id: number; }): Promise; /** * ## getAvailableGifts * Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a Gifts object. * @see https://core.telegram.org/bots/api#getavailablegifts */ getAvailableGifts(): Promise; /** * ## sendGift * Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns True on success. * @see https://core.telegram.org/bots/api#sendgift */ sendGift(options: ExactlyOne<{ user_id?: number; chat_id?: number | string; }> & { gift_id: string; pay_for_upgrade?: boolean; text?: string; text_parse_mode?: ParseMode; text_entities?: MessageEntity[]; }): Promise; /** * ## verifyUser * Verifies a user on behalf of the organization which is represented by the bot. Returns True on success. * @see https://core.telegram.org/bots/api#verifyuser */ verifyUser(options: { user_id: number; custom_description?: string; }): Promise; /** * ## verifyChat * Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success. * @see https://core.telegram.org/bots/api#verifychat */ verifyChat(options: { chat_id: number | string; custom_description?: string; }): Promise; /** * ## removeUserVerification * Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. * Returns True on success. * @see https://core.telegram.org/bots/api#removeuserverification */ removeUserVerification(options: { user_id: number; }): Promise; /** * ## removeChatVerification * Removes verification from a chat which is currently verified on behalf of the organization represented by the bot. * Returns True on success. * @see https://core.telegram.org/bots/api#removechatverification */ removeChatVerification(options: { chat_id: number | string; }): Promise; /** * ## readBusinessMessage * Marks incoming message as read on behalf of a business account. Requires * the can_read_messages business bot right. * Returns True on success. * @see https://core.telegram.org/bots/api#readbusinessmessage */ readBusinessMessage(options: { business_connection_id: string; chat_id: number | string; message_id: number; }): Promise; /** * ## deleteBusinessMessages * Delete messages on behalf of a business account. Requires * the can_delete_sent_messages business bot right to delete messages sent by * the bot itself, or the can_delete_all_messages business bot right to delete * any message. Returns True on success. * @see https://core.telegram.org/bots/api#deletebusinessmessages */ deleteBusinessMessages(options: { business_connection_id: string; message_ids: number[]; }): Promise; /** * ## setBusinessAccountName * Changes the first and last name of a managed business account. Requires the * can_change_name business bot right. * Returns True on success. * @see https://core.telegram.org/bots/api#setbusinessaccountname */ setBusinessAccountName(options: { business_connection_id: string; first_name: string; last_name?: string; }): Promise; /** * ## setBusinessAccountUsername * Changes the username of a managed business account. Requires the * can_change_username business bot right. * Returns True on success. * @see https://core.telegram.org/bots/api#setbusinessaccountusername */ setBusinessAccountUsername(options: { business_connection_id: string; username: string; }): Promise; /** * ## setBusinessAccountBio * Changes the bio of a managed business account. Requires the * can_change_bio business bot right. * Returns True on success. * @see https://core.telegram.org/bots/api#setbusinessaccountbio */ setBusinessAccountBio(options: { business_connection_id: string; bio: string; }): Promise; /** * ## setBusinessAccountProfilePhoto * Changes the profile photo of a managed business account. Requires the * can_edit_profile_photo business bot right. * Returns True on success. * @see https://core.telegram.org/bots/api#setbusinessaccountprofilephoto */ setBusinessAccountProfilePhoto(options: { business_connection_id: string; photo: InputProfilePhoto; is_public?: boolean; }): Promise; /** * ## removeBusinessAccountProfilePhoto * Removes the current profile photo of a managed business account. * Requires the can_edit_profile_photo business bot right. * Returns True on success. * @see https://core.telegram.org/bots/api#removebusinessaccountprofilephoto */ removeBusinessAccountProfilePhoto(options: { business_connection_id: string; is_public?: boolean; }): Promise; /** * ## setBusinessAccountGiftSettings * Changes the privacy settings pertaining to incoming gifts in a managed * business account. Requires the can_change_gift_settings business bot right. * Returns True on success. * @see https://core.telegram.org/bots/api#setbusinessaccountgiftsettings */ setBusinessAccountGiftSettings(options: { business_connection_id: string; show_gift_button: boolean; accepted_gift_types: AcceptedGiftTypes; }): Promise; /** * ## getBusinessAccountStarBalance * Returns the amount of Telegram Stars owned by a managed business account. * Requires the can_view_gifts_and_stars business bot right. * Returns StarAmount on success. * @see https://core.telegram.org/bots/api#getbusinessaccountstarbalance */ getBusinessAccountStarBalance(options: { business_connection_id: string; }): Promise; /** * ## transferBusinessAccountStars * Transfers Telegram Stars from the business account balance to the bot's * balance. Requires the can_transfer_stars business bot right. * Returns True on success. * @see https://core.telegram.org/bots/api#transferbusinessaccountstars */ transferBusinessAccountStars(options: { business_connection_id: string; star_count: number; }): Promise; /** * ## getBusinessAccountGifts * Returns the gifts received and owned by a managed business account. * Requires the can_view_gifts_and_stars business bot right. * Returns OwnedGifts on success. * @see https://core.telegram.org/bots/api#getbusinessaccountgifts */ getBusinessAccountGifts(options: { business_connection_id: string; exclude_unsaved?: boolean; exclude_saved?: boolean; exclude_unlimited?: boolean; /** Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique */ exclude_limited_upgradable?: boolean; /** Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique */ exclude_limited_non_upgradable?: boolean; exclude_unique?: boolean; /** * Pass True to exclude gifts that were assigned from the TON blockchain * and can't be resold or transferred in Telegram */ exclude_from_blockchain?: boolean; sort_by_price?: boolean; offset?: string; limit?: number; }): Promise; /** * ## getUserGifts * Returns the gifts owned and hosted by a user. Returns OwnedGifts on success. * @see https://core.telegram.org/bots/api#getusergifts */ getUserGifts(options: { /** Unique identifier of the user */ user_id: number; /** Pass True to exclude gifts that can be purchased an unlimited number of times */ exclude_unlimited?: boolean; /** * Pass True to exclude gifts that can be purchased a limited number of times * and can be upgraded to unique */ exclude_limited_upgradable?: boolean; /** * Pass True to exclude gifts that can be purchased a limited number of times * and can't be upgraded to unique */ exclude_limited_non_upgradable?: boolean; /** * Pass True to exclude gifts that were assigned from the TON blockchain * and can't be resold or transferred in Telegram */ exclude_from_blockchain?: boolean; /** Pass True to exclude unique gifts */ exclude_unique?: boolean; /** * Pass True to sort results by gift price instead of send date. * Sorting is applied before pagination. */ sort_by_price?: boolean; /** * Offset of the first entry to return as received from the previous request; * use an empty string to get the first chunk of results */ offset?: string; /** The maximum number of gifts to be returned; 1-100. Defaults to 100 */ limit?: number; }): Promise; /** * ## getChatGifts * Returns the gifts owned by a chat. Returns OwnedGifts on success. * @see https://core.telegram.org/bots/api#getchatgifts */ getChatGifts(options: { /** * Unique identifier for the target chat or username of the target channel * (in the format @channelusername) */ chat_id: number | string; /** * Pass True to exclude gifts that aren't saved to the chat's profile page. * Always True, unless the bot has the can_post_messages administrator right in the channel. */ exclude_unsaved?: boolean; /** * Pass True to exclude gifts that are saved to the chat's profile page. * Always False, unless the bot has the can_post_messages administrator right in the channel. */ exclude_saved?: boolean; /** Pass True to exclude gifts that can be purchased an unlimited number of times */ exclude_unlimited?: boolean; /** * Pass True to exclude gifts that can be purchased a limited number of times * and can be upgraded to unique */ exclude_limited_upgradable?: boolean; /** * Pass True to exclude gifts that can be purchased a limited number of times * and can't be upgraded to unique */ exclude_limited_non_upgradable?: boolean; /** * Pass True to exclude gifts that were assigned from the TON blockchain * and can't be resold or transferred in Telegram */ exclude_from_blockchain?: boolean; /** Pass True to exclude unique gifts */ exclude_unique?: boolean; /** * Pass True to sort results by gift price instead of send date. * Sorting is applied before pagination. */ sort_by_price?: boolean; /** * Offset of the first entry to return as received from the previous request; * use an empty string to get the first chunk of results */ offset?: string; /** The maximum number of gifts to be returned; 1-100. Defaults to 100 */ limit?: number; }): Promise; /** * ## convertGiftToStars * Converts a given regular gift to Telegram Stars. Requires the * can_convert_gifts_to_stars business bot right. * Returns True on success. * @see https://core.telegram.org/bots/api#convertgifttostars */ convertGiftToStars(options: { business_connection_id: string; owned_gift_id: string; }): Promise; /** * ## upgradeGift * Upgrades a given regular gift to a unique gift. Requires the * can_transfer_and_upgrade_gifts business bot right. Additionally requires * the can_transfer_stars business bot right if the upgrade is paid. * Returns True on success. * @see https://core.telegram.org/bots/api#upgradegift */ upgradeGift(options: { business_connection_id: string; owned_gift_id: string; keep_original_details?: boolean; star_count?: number; }): Promise; /** * ## transferGift * Transfers an owned unique gift to another user. Requires the * can_transfer_and_upgrade_gifts business bot right. Requires * can_transfer_stars business bot right if the transfer is paid. * Returns True on success. * @see https://core.telegram.org/bots/api#transfertgift */ transferGift(options: { business_connection_id: string; owned_gift_id: string; new_owner_chat_id: number; star_count?: number; }): Promise; /** * ## postStory * Posts a story on behalf of a managed business account. Requires the * can_manage_stories business bot right. * Returns Story on success. * @see https://core.telegram.org/bots/api#poststory */ postStory(options: { business_connection_id: string; content: InputStoryContent; active_period: number; caption?: string; parse_mode?: string; caption_entities?: MessageEntity[]; areas?: StoryArea[]; post_to_chat_page?: boolean; protect_content?: boolean; }): Promise; /** * ## repostStory * Reposts a story on behalf of a business account from another business account. * Both business accounts must be managed by the same bot, and the story on the source * account must have been posted (or reposted) by the bot. Requires the can_manage_stories * business bot right for both business accounts. Returns Story on success. * @see https://core.telegram.org/bots/api#repoststory */ repostStory(options: { /** Unique identifier of the business connection */ business_connection_id: string; /** Unique identifier of the chat which posted the story that should be reposted */ from_chat_id: number; /** Unique identifier of the story that should be reposted */ from_story_id: number; /** * Period after which the story is moved to the archive, in seconds; * must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 */ active_period: number; /** Pass True to keep the story accessible after it expires */ post_to_chat_page?: boolean; /** Pass True if the content of the story must be protected from forwarding and screenshotting */ protect_content?: boolean; }): Promise; /** * ## editStory * Edits a story previously posted by the bot on behalf of a managed business * account. Requires the can_manage_stories business bot right. * Returns Story on success. * @see https://core.telegram.org/bots/api#editstory */ editStory(options: { business_connection_id: string; story_id: string; content?: InputStoryContent; caption?: string; parse_mode?: string; caption_entities?: MessageEntity[]; areas?: StoryArea[]; }): Promise; /** * ## deleteStory * Deletes a story previously posted by the bot on behalf of a managed * business account. Requires the can_manage_stories business bot right. * Returns True on success. * @see https://core.telegram.org/bots/api#deletestory */ deleteStory(options: { business_connection_id: string; story_id: string; }): Promise; /** * ## giftPremiumSubscription * Gifts a Telegram Premium subscription to the given user. * Returns True on success. * @see https://core.telegram.org/bots/api#giftpremiumsubscription */ giftPremiumSubscription(options: { user_id: number; month_count: number; star_count: number; text?: string; text_parse_mode?: string; text_entities?: MessageEntity[]; }): Promise; /** * ## sendChecklist * Use this method to send a checklist on behalf of a connected business account. * On success, the sent Message is returned. * @see https://core.telegram.org/bots/api#sendchecklist */ sendChecklist(options: { business_connection_id: string; chat_id: number; checklist: InputChecklist; disable_notification?: boolean; protect_content?: boolean; message_effect_id?: string; reply_parameters?: ReplyParameters; reply_markup?: InlineKeyboardMarkup; }): Promise; /** * ## editMessageChecklist * Use this method to edit a checklist on behalf of a connected business account. * On success, the edited Message is returned. * @see https://core.telegram.org/bots/api#editmessagechecklist */ editMessageChecklist(options: { business_connection_id: string; chat_id: number; message_id: number; checklist: InputChecklist; reply_markup?: InlineKeyboardMarkup; }): Promise; /** * ## approveSuggestedPost * Use this method to approve a suggested post in a direct messages chat. The bot must have the 'can_post_messages' * administrator right in the corresponding channel chat. Returns True on success. * @see https://core.telegram.org/bots/api#approvesuggestedpost */ approveSuggestedPost(options: { /** * Unique identifier for the target direct messages chat */ chat_id: number; /** * Identifier of a suggested post message to approve */ message_id: number; /** * Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been * specified when the suggested post was created. If specified, then the date must be not more than 2678400 seconds * (30 days) in the future */ send_date?: number; }): Promise; /** * ## declineSuggestedPost * Use this method to decline a suggested post in a direct messages chat. The bot must have the * 'can_manage_direct_messages' administrator right in the corresponding channel chat. Returns True on success. * @see https://core.telegram.org/bots/api#declinesuggestedpost */ declineSuggestedPost(options: { /** * Unique identifier for the target direct messages chat */ chat_id: number; /** * Identifier of a suggested post message to decline */ message_id: number; /** * Comment for the creator of the suggested post; 0-128 characters */ comment?: string; }): Promise; on(event: U, listener: (eventData: NonNullable) => void): this; emit(event: U, eventData: NonNullable): boolean; } /** * ## MethodParameters * Get the parameters of a method. */ export type MethodParameters = TelegramBot[T] extends (...args: infer P) => Promise ? P[0] : TelegramBot[T] extends (...args: infer P) => unknown ? P[0] : never; /** * ## MethodReturn * Get the return type of a method. */ export type MethodReturn = T extends unknown ? TelegramBot[T] extends (...args: infer A) => Promise ? U : TelegramBot[T] extends (...args: infer A) => infer U ? U : never : never; export * from './types';