Readonly
optionsReadonly
tokenKick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group 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 admin rights.
Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername
)
Optional
untilDate: numberDate when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever
Optional
Optional
extra: Omit<{}, "chat_id" | "user_id" | "until_date">Optional
since API 5.3. Use Telegram.banChatMember
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.
Sticker set name
User identifier of the sticker set owner
Optional
thumbnail: string | InputFileA .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see animated sticker technical requirements), or a WEBM video with the thumbnail up to 32 kilobytes in size; see video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass a HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using Input helpers. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.
Optional
since API 6.8. Use Telegram.setStickerSetThumbnail
If set to true
, first eligible call will avoid performing a POST request.
Note that such a call:
https://core.telegram.org/bots/faq#how-can-i-make-requests-in-response-to-updates https://github.com/telegraf/telegraf/pull/1250
Send answers to an inline query. No more than 50 results per query are allowed.
Optional
extra: Omit<{}, "chat_id" | "inline_query_id" | "results">Optional
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. 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.
Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.
Optional
errorMessage: stringRequired if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.
Optional
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. Reply to shipping queries.
Specify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)
Required if ok is True. A JSON-serialized array of available shipping options.
Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.
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.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Unique identifier of the target user
Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group 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 admin rights.
Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername
)
Optional
untilDate: numberDate when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever
Optional
Optional
extra: Omit<{}, "chat_id" | "user_id" | "until_date">Optional
Ban a channel chat in a supergroup or a channel. The owner of the chat will not be able to send messages and join live streams on behalf of the chat, unless it is unbanned first. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Unique identifier of the target sender chat
Optional
extra: { Optional
Optional
caption?: string | FmtString<string>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.
Unique identifier for the target message thread of the forum topic
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.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
Send copy of existing message.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
Message identifier in the chat specified in from_chat_id
Optional
extra: { Optional
Optional
caption?: string | FmtString<string>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.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)
Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.
Optional
extra: Omit<{}, "chat_id" | "from_chat_id" | "message_ids">Optional
Use this method to create a 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 information about the created topic as a ForumTopic object.
Topic name, 1-128 characters
Optional
extra: Omit<{}, "chat_id" | "name">Optional
Create new sticker set owned by a user. The bot will be able to edit the created sticker set.
User identifier of created sticker set owner
Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in “by
Sticker set title, 1-64 characters
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.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Unique identifier of the target user
Use this method to delete a forum topic along with all its messages in a forum 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.
Unique identifier for the target message thread of the forum topic
Delete a message, including service messages, with the following limitations:
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Identifier of the message to delete
Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted
Use this method to edit name and icon of a 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, unless it is the creator of the topic. Returns True on success.
Unique identifier for the target message thread of the forum topic
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.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
New topic name, 1-128 characters
Edit captions of messages sent by the bot or via the bot (for inline bots). On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Required if inlineMessageId is not specified. Identifier of the sent message
Required if chatId and messageId are not specified. Identifier of the inline message
New caption of the message
Optional
extra: Omit<{}, "caption" | "chat_id" | "message_id" | "inline_message_id">Optional
Optional
extra: Omit<{}, "chat_id" | "message_id" | "inline_message_id" | "latitude" | "longitude">Optional
Edit animation, audio, document, photo, or video messages. If a message is a part of a message album, then it can be edited only to a photo or a video. Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded. Use previously uploaded file via its file_id or specify a URL.
Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Required if inlineMessageId is not specified. Identifier of the sent message
Required if chatId and messageId are not specified. Identifier of the inline message
New media of message
Optional
extra: Omit<{}, "chat_id" | "message_id" | "inline_message_id" | "media">Additional parameters, such as reply_markup
Optional
Edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Required if inlineMessageId is not specified. Identifier of the sent message
Required if chatId and messageId are not specified. Identifier of the inline message
A JSON-serialized object for an inline keyboard.
If edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
Edit text and game messages sent by the bot or via the bot (for inline bots). On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Required if inlineMessageId is not specified. Identifier of the sent message
Required if chatId and messageId are not specified. Identifier of the inline message
New text of the message
Optional
extra: Omit<{}, "text" | "chat_id" | "message_id" | "inline_message_id">Optional
Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Forward existing message.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
Message identifier in the chat specified in from_chat_id
Optional
extra: Omit<{}, "chat_id" | "from_chat_id" | "message_id">Optional
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.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)
Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.
Optional
extra: Omit<{}, "chat_id" | "from_chat_id" | "message_ids">Optional
Get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.).
Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
Get information about a member of a chat.
Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
Unique identifier of the target user
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.
Unique identifier for the target private chat. If not specified, default bot's menu button will be returned.
Optional
chatUse this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
Pass true to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned.
Optional
forDirectly request incoming updates.
You should probably use Telegraf::launch
instead.
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.
Unique identifier for the chat or username of the channel (in the format @channelusername
)
Unique identifier of the target user
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.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
Pin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
Optional
extra: { Optional
Optional
disable_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 admin rights. Pass False for all boolean parameters to demote a user.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
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.
Unique identifier for the target message thread of the forum topic
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.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass True for all boolean parameters to lift restrictions from a user.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
Send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
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).
Optional
extra: Omit<{}, "action" | "chat_id">Optional
Send a dice, which will have a random value from 1 to 6.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Optional
extra: Omit<{}, "chat_id">Optional
Unique identifier for the target private chat
Optional
extra: Omit<{}, "chat_id" | "protect_content" | "title" | "description" | "payload" | "provider_token" | "currency" | "prices" | "max_tip_amount" | "suggested_tip_amounts" | "provider_data" | "photo_url" | "photo_size" | "photo_width" | "photo_height" | "need_name" | "need_phone_number" | "need_email" | "need_shipping_address" | "send_phone_number_to_provider" | "send_email_to_provider" | "is_flexible" | "start_parameter">Optional
Send point on the map.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Optional
extra: Omit<{}, "chat_id" | "latitude" | "longitude">Optional
Send a group of photos or videos as an album.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
A JSON-serialized array describing photos and videos to be sent, must include 2–10 items
Optional
extra: Omit<{}, "chat_id" | "media">Optional
Send a text message.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Text of the message to be sent
Optional
extra: Omit<{}, "text" | "chat_id">Optional
Send a native poll.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Poll question, 1-255 characters
A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
Optional
extra: Omit<{}, "type" | "chat_id" | "question" | "options">Optional
Send a native quiz.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Poll question, 1-255 characters
A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
Optional
extra: Omit<{}, "type" | "chat_id" | "question" | "options">Optional
Send .webp, animated .tgs, or video .webm stickers
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Optional
extra: Omit<{}, "chat_id" | "sticker">Optional
Optional
extra: Omit<{}, "chat_id" | "title" | "latitude" | "longitude" | "address">Optional
Send video messages.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Optional
extra: Omit<{}, "chat_id" | "video_note">Optional
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 (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.
Use this method to change the bot's menu button in a private chat, or the default menu button. Returns true on success.
Optional
chatOptional
menuChange 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 admin rights.
Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername
)
New chat title, 1-255 characters
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. In albums, bots must react to the first message.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Identifier of the target message
Optional
reaction: ReactionType[]New list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.
Optional
Optional
is_big: booleanPass True to set the reaction with a big animation
Optional
Change the list of the bot's commands.
A list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.
Optional
extra: Omit<{}, "chat_id" | "commands">Optional
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 are free to modify the list before adding the bot.
Optional
forOptional
rights?: ChatAdministratorRightsUse this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.
New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.
Optional
language_code: stringA two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description.
Optional
Use this method to change the bot's name.
New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.
Optional
language_code: stringA two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name.
Optional
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.
Optional
language_code: stringA two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description.
Optional
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.
Sticker set name
User identifier of the sticker set owner
Optional
thumbnail: string | InputFileA .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see animated sticker technical requirements), or a WEBM video with the thumbnail up to 32 kilobytes in size; see video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass a HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using Input helpers. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.
Optional
Optional
markup: InlineKeyboardMarkupOptional
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Identifier of the original message with the poll
Optional
extra: Omit<{}, "chat_id" | "message_id">Optional
Unban a user from a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Unique identifier for the target group or username of the target supergroup or channel (in the format @username)
Unique identifier of the target user
Optional
extra: { Optional
Optional
only_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.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Unique identifier of the target sender chat
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.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
Use this method to clear the list of pinned messages in a 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.
Unique identifier for the target message thread of the forum topic
Use 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.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
Unpin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Optional
messageId: numberOptional
Upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). https://core.telegram.org/bots/api#sending-files
User identifier of sticker file owner
Generated using TypeDoc
Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group 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 admin rights.