ReadonlyapiUsed by some middleware to store information about how a certain string or regular expression was matched.
ReadonlymeInformation about the bot itself.
ReadonlyupdateThe update object that is contained in the context.
OptionaluserAlias for ctx.update.business_connection
Get the business connection identifier from wherever possible. Alias for
this.msg?.business_connection_id ?? this.businessConnection?.id ?? this.deletedBusinessMessages?.business_connection_id.
Alias for ctx.update.business_message
Alias for ctx.update.callback_query
Alias for ctx.update.channel_post
Get the chat object from wherever possible. Alias for (this.msg ?? this.deletedBusinessMessages ?? this.messageReaction ?? this.messageReactionCount ?? this.myChatMember ?? this.chatMember ?? this.chatJoinRequest ?? this.chatBoost ?? this.removedChatBoost)?.chat.
Alias for ctx.update.chat_boost
Gets the chat identifier from wherever possible. Alias for this.chat?.id ?? this.businessConnection?.user_chat_id.
Alias for ctx.update.chat_join_request
Alias for ctx.update.chat_member
Alias for ctx.update.chosen_inline_result
Alias for ctx.update.deleted_business_messages
Alias for ctx.update.edited_business_message
Alias for ctx.update.edited_channel_post
Alias for ctx.update.edited_message
Get the user object from wherever possible. Alias for
(this.businessConnection ?? this.messageReaction ?? (this.chatBoost?.boost ?? this.removedChatBoost)?.source)?.user ?? (this.callbackQuery ?? this.msg ?? this.inlineQuery ?? this.chosenInlineResult ?? this.shippingQuery ?? this.preCheckoutQuery ?? this.myChatMember ?? this.chatMember ?? this.chatJoinRequest ?? this.purchasedPaidMedia)?.from.
Get the inline message identifier from wherever possible. Alias for
(ctx.callbackQuery ?? ctx.chosenInlineResult)?.inline_message_id.
Alias for ctx.update.inline_query
Alias for ctx.update.message
Alias for ctx.update.message_reaction
Alias for ctx.update.message_reaction_count
Get the message object from wherever possible. Alias for this.message ?? this.editedMessage ?? this.channelPost ?? this.editedChannelPost ?? this.businessMessage ?? this.editedBusinessMessage ?? this.callbackQuery?.message.
Get the message identifier from wherever possible. Alias for
this.msg?.message_id ?? this.messageReaction?.message_id ?? this.messageReactionCount?.message_id.
Alias for ctx.update.my_chat_member
Alias for ctx.update.poll
Alias for ctx.update.poll_answer
Alias for ctx.update.pre_checkout_query
Alias for ctx.update.purchased_paid_media
Alias for ctx.update.removed_chat_boost
Get the sender chat object from wherever possible. Alias for
ctx.msg?.sender_chat.
Alias for ctx.update.shipping_query
Context-aware alias for api.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.
Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via
Optionalother: string | Other<"answerCallbackQuery", "callback_query_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#answercallbackquery
and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
Context-aware alias for api.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.
Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.
An array of results for the inline query
Optionalother: Other<"answerInlineQuery", "inline_query_id" | "results">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#answerinlinequery
Context-aware alias for api.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.
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.
Optionalother: string | Other<"answerPreCheckoutQuery", "ok" | "pre_checkout_query_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#answerprecheckoutquery
Context-aware alias for api.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.
Pass 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)
Optionalother: Other<"answerShippingQuery", "shipping_query_id" | "ok">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#answershippingquery
Context-aware alias for api.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.
Unique identifier of the target user
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#approvechatjoinrequest
Context-aware alias for api.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.
Optionalother: Other<"banChatMember", "chat_id" | "user_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#banchatmember
Context-aware alias for api.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.
Unique identifier of the target user
Optionalother: Other<"banChatMember", "chat_id" | "user_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#banchatmember
Context-aware alias for api.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.
Unique identifier of the target sender chat
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#banchatsenderchat
Context-aware alias for api.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.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#closeforumtopic
Context-aware alias for api.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.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#closegeneralforumtopic
Context-aware alias for api.convertGiftToStars. Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success.
Unique identifier of the regular gift that should be converted to Telegram Stars
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#convertgifttostars
Context-aware alias for api.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.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Optionalother: Other<"copyMessage", "message_id" | "chat_id" | "from_chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#copymessage
Context-aware alias for api.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, 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.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
A list of 1-100 identifiers of messages in the current chat to copy. The identifiers must be specified in a strictly increasing order.
Optionalother: Other<"copyMessages", "message_id" | "chat_id" | "from_chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#copymessages
Context-aware alias for api.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.
Optionalother: Other<"createChatInviteLink", "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#createchatinvitelink
Context-aware alias for api.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.
The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days).
The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500
Optionalother: Other<Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#createchatsubscriptioninvitelink
Context-aware alias for api.createForumTopic. 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
Optionalother: Other<"createForumTopic", "name" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#createforumtopic
Context-aware alias for api.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.
Unique identifier of the target user
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#declinechatjoinrequest
Context-aware alias for api.deleteBusinessMessages. Delete messages on behalf of a business account. Requires the can_delete_outgoing_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.
A list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#deletebusinessmessages
Context-aware alias for api.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.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#deletechatphoto
Context-aware alias for api.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 ly returned in getChat requests to check if the bot can use this method. Returns True on success.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#deletechatstickerset
Context-aware alias for api.deleteForumTopic. 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.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#deleteforumtopic
Context-aware alias for api.deleteMessage. Use this method to delete a message, including service messages, with the following limitations:
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#deletemessage
Context-aware alias for api.deleteMessages. Use this method to delete multiple messages simultaneously. Returns True on success.
A list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#deletemessages
Context-aware alias for api.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.
Unique identifier of the story to delete
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#deletestory
Context-aware alias for api.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.
The invite link to edit
Optionalother: Other<"editChatInviteLink", "chat_id" | "invite_link">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#editchatinvitelink
Context-aware alias for api.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.
The invite link to edit
Optionalother: Other<"editChatSubscriptionInviteLink", "chat_id" | "invite_link">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#editchatsubscriptioninvitelink
Context-aware alias for api.editForumTopic. 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 the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
Optionalother: Other<"editForumTopic", "message_thread_id" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#editforumtopic
Context-aware alias for api.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 the can_manage_topics administrator rights. Returns True on success.
New topic name, 1-128 characters
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#editgeneralforumtopic
Context-aware alias for api.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. 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.
Optionalother: Other<"editMessageCaption", "message_id" | "chat_id" | "inline_message_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#editmessagecaption
Context-aware alias for api.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.
Latitude of new location
Longitude of new location
Optionalother: Other<Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#editmessagelivelocation
Context-aware alias for api.editMessageMedia. Use this method to edit animation, audio, document, 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 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.
An object for a new media content of the message
Optionalother: Other<Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#editmessagemedia
Context-aware alias for api.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. 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.
Optionalother: Other<"editMessageReplyMarkup", "message_id" | "chat_id" | "inline_message_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#editmessagereplymarkup
Context-aware alias for api.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. 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.
New text of the message, 1-4096 characters after entities parsing
Optionalother: Other<Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#editmessagetext
Context-aware alias for api.. editStoryEdits 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.
Unique identifier of the story to edit
Content of the story
Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#editstory
Context-aware alias for api.editUserStarSubscription. Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success.
Telegram payment identifier for the subscription
Pass True to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period. Pass False to allow the user to re-enable a subscription that was previously canceled by the bot.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#edituserstarsubscription
Get entities and their text. Extracts the text from ctx.msg.text or
ctx.msg.caption. Returns an empty array if one of ctx.msg,
ctx.msg.text or ctx.msg.entities is undefined.
You can filter specific entity types by passing the types parameter.
Example:
ctx.entities() // Returns all entity types
ctx.entities('url') // Returns only url entities
ctx.entities(['url', 'email']) // Returns url and email entities
Array of entities and their texts, or empty array when there's no text
Slice of the message text that contains this entity
Get entities and their text. Extracts the text from ctx.msg.text or
ctx.msg.caption. Returns an empty array if one of ctx.msg,
ctx.msg.text or ctx.msg.entities is undefined.
You can filter specific entity types by passing the types parameter.
Example:
ctx.entities() // Returns all entity types
ctx.entities('url') // Returns only url entities
ctx.entities(['url', 'email']) // Returns url and email entities
Types of entities to return. Omit to get all entities.
Array of entities and their texts, or empty array when there's no text
Slice of the message text that contains this entity
Context-aware alias for api.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.
Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using exportChatInviteLink or by calling the getChat method. If your bot needs to generate a new primary invite link replacing its previous one, use exportChatInviteLink again.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#exportchatinvitelink
Context-aware alias for api.forwardMessage. Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
Optionalother: Other<"forwardMessage", "message_id" | "chat_id" | "from_chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#forwardmessage
Context-aware alias for api.forwardMessages. 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.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
A list of 1-100 identifiers of messages in the current chat to forward. The identifiers must be specified in a strictly increasing order.
Optionalother: Other<"forwardMessages", "chat_id" | "from_chat_id" | "message_ids">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#forwardmessages
Context-aware alias for api.getChatMember. Use this method to get information about a member of a chat. The method is guaranteed to work only if the bot is an administrator in the chat. Returns a ChatMember object on success.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#getchatmember
Context-aware alias for api.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.
Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#getbusinessaccountgifts
Context-aware alias for api.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.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#getbusinessaccountstarbalance
Context-aware alias for api.getBusinessConnection. Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#getbusinessconnection
Context-aware alias for api.getChat. Use this method to 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.). Returns a Chat object on success.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#getchat
Context-aware alias for api.getChatAdministrators. Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of ChatMember objects.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#getchatadministrators
Context-aware alias for api.getChatMember. Use this method to get information about a member of a chat. The method is guaranteed to work only if the bot is an administrator in the chat. Returns a ChatMember object on success.
Unique identifier of the target user
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#getchatmember
Context-aware alias for api.getChatMemberCount. Use this method to get the number of members in a chat. Returns Int on success.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#getchatmembercount
Context-aware alias for api.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.
Optionalother: Other<"getChatMenuButton", never>Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#getchatmenubutton
Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#getcustomemojistickers
Context-aware alias for api.getFile. Use this method to get basic info 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
Note: This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#getfile
Context-aware alias for api.getMyDefaultAdministratorRights. Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
Optionalother: Other<"getMyDefaultAdministratorRights", never>Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Context-aware alias for api.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.
Unique identifier for the chat or username of the channel (in the format @channelusername)
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#getuserchatboosts
Context-aware alias for api.getUserProfilePhotos. Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
Optionalother: Other<"getUserProfilePhotos", "user_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#getuserprofilephotos
Context-aware alias for api.giftPremiumSubscription. Gifts a Telegram Premium subscription to the given user. Returns True on success.
Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12
Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months
Optionalother: Other<"giftPremiumSubscription", "star_count" | "user_id" | "month_count">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#giftpremiumsubscription
Returns true if this context object matches the given filter query, and
false otherwise. This uses the same logic as bot.on.
Returns true if this context object contains the given callback query,
or if the contained callback query data matches the given regular
expression. It returns false otherwise. This uses the same logic as
bot.callbackQuery.
The string or regex to match
Returns true if this context object belongs to a chat with the given
chat type, and false otherwise. This uses the same logic as
bot.chatType.
The chat type to match
Returns true if this context object contains the chosen inline result,
or if the contained chosen inline result matches the given regular
expression. It returns false otherwise. This uses the same logic as
bot.chosenInlineResult.
The string or regex to match
Returns true if this context object contains the given command, and
false otherwise. This uses the same logic as bot.command.
The command to match
Returns true if this context object contains the given game query, or
if the contained game query matches the given regular expression. It
returns false otherwise. This uses the same logic as bot.gameQuery.
The string or regex to match
Returns true if this context object contains the given inline query, or
if the contained inline query matches the given regular expression. It
returns false otherwise. This uses the same logic as bot.inlineQuery.
The string or regex to match
Returns true if this context object contains the given pre-checkout
query, or if the contained pre-checkout query matches the given regular
expression. It returns false otherwise. This uses the same logic as
bot.preCheckoutQuery.
The string or regex to match
Returns true if this context object contains the given shipping query,
or if the contained shipping query matches the given regular expression.
It returns false otherwise. This uses the same logic as
bot.shippingQuery.
The string or regex to match
Returns true if this context object contains the given text, or if it
contains text that matches the given regular expression. It returns
false otherwise. This uses the same logic as bot.hears.
The string or regex to match
Context-aware alias for api.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.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#hidegeneralforumtopic
Context-aware alias for api.leaveChat. Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#leavechat
Context-aware alias for api.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.
Identifier of a message to pin
Optionalother: Other<"pinChatMessage", "message_id" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#pinchatmessage
Context-aware alias for api.postStory. Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.
Content of the story
Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400
Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#poststory
Context-aware alias for api.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.
Optionalother: Other<"promoteChatMember", "chat_id" | "user_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#promotechatmember
Context-aware alias for api.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.
Unique identifier of the target user
Optionalother: Other<"promoteChatMember", "chat_id" | "user_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#promotechatmember
Context-aware alias for api.setMessageReaction. Use this method to change the chosen reactions on a message. Service messages of some types 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. Bots can't use paid reactions. Returns True on success.
A 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. Paid reactions can't be used by bots.
Optionalother: Other<"setMessageReaction", "message_id" | "reaction" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setmessagereaction
Find out which reactions were added and removed in a message_reaction
update. This method looks at ctx.messageReaction and computes the
difference between the old reaction and the new reaction. It also groups
the reactions by emoji reactions and custom emoji reactions. For example,
the resulting object could look like this:
{
emoji: ['👍', '🎉']
emojiAdded: ['🎉'],
emojiKept: ['👍'],
emojiRemoved: [],
customEmoji: [],
customEmojiAdded: [],
customEmojiKept: [],
customEmojiRemoved: ['id0123'],
paid: true,
paidAdded: false,
paidRemoved: false,
}
In the above example, a tada reaction was added by the user, and a custom
emoji reaction with the custom emoji 'id0123' was removed in the same
update. The user had already reacted with a thumbs up reaction and a paid
star reaction, which they left both unchanged. As a result, the current
reaction by the user is thumbs up, tada, and a paid reaction. Note that
the current reaction (all emoji reactions regardless of type in one list)
can also be obtained from ctx.messageReaction.new_reaction.
Remember that reaction updates only include information about the reaction of a specific user. The respective message may have many more reactions by other people which will not be included in this update.
An object containing information about the reaction update
Custom emoji currently present in this user's reaction
Custom emoji newly added to this user's reaction
Custom emoji not changed by the update to this user's reaction
Custom emoji removed from this user's reaction
Emoji currently present in this user's reaction
Emoji newly added to this user's reaction
Emoji not changed by the update to this user's reaction
Emoji removed from this user's reaction
true if a paid reaction is currently present in this user's
reaction, and false otherwise
true if a paid reaction was newly added to this user's reaction,
and false otherwise
Context-aware alias for api.readBusinessMessage. Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#readbusinessmessage
Context-aware alias for api.refundStarPayment. Refunds a successful payment in Telegram Stars.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#refundstarpayment
Context-aware alias for api.removeBusinessAccountProfilePhoto. Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.
Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#removebusinessaccountprofilephoto
Context-aware alias for api.removeChatVerification. Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#removechatverification
Context-aware alias for api.removeUserVerification. Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#removeuserverification
Context-aware alias for api.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.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#reopenforumtopic
Context-aware alias for api.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. *
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#reopengeneralforumtopic
Context-aware alias for api.sendMessage. Use this method to send text messages. On success, the sent Message is returned.
Text of the message to be sent, 1-4096 characters after entities parsing
Optionalother: Other<"sendMessage", "text" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendmessage
Context-aware alias for api.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.
Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data.
Optionalother: Other<"sendAnimation", "animation" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendanimation
Context-aware alias for api.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.
Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data.
Optionalother: Other<"sendAudio", "audio" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendaudio
Context-aware alias for api.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.
Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo. The user will see a “sending photo” status for the bot.
We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.
Optionalother: Other<"sendChatAction", "chat_id" | "action">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendchataction
Context-aware alias for api.sendContact. Use this method to send phone contacts. On success, the sent Message is returned.
Contact's phone number
Contact's first name
Optionalother: Other<"sendContact", "phone_number" | "chat_id" | "first_name">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendcontact
Context-aware alias for api.sendDice. Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
Emoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”. Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲”
Optionalother: Other<"sendDice", "emoji" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#senddice
Context-aware alias for api.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.
File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data.
Optionalother: Other<"sendDocument", "document" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#senddocument
Context-aware alias for api.sendGame. Use this method to send a game. On success, the sent Message is returned.
Short name of the game, serves as the unique identifier for the game. Set up your games via BotFather.
Optionalother: Other<"sendGame", "game_short_name" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendgame
Context-aware alias for api.sendGift. Sends a gift to the given user. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.
Identifier of the gift
Optionalother: Other<"sendGift", "chat_id" | "user_id" | "gift_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendgift
Context-aware alias for api.sendGift. Sends a gift to the given channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.
Identifier of the gift
Optionalother: Other<"sendGift", "chat_id" | "user_id" | "gift_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendgift
Context-aware alias for api.sendInvoice. Use this method to send invoices. On success, the sent Message is returned.
Product name, 1-32 characters
Product description, 1-255 characters
Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
Three-letter ISO 4217 currency code, see more on currencies
Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
Optionalother: Other<Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendinvoice
Context-aware alias for api.sendLocation. Use this method to send point on the map. On success, the sent Message is returned.
Latitude of the location
Longitude of the location
Optionalother: Other<"sendLocation", "chat_id" | "latitude" | "longitude">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendlocation
Context-aware alias for api.sendMediaGroup. Use this method to send a group of 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.
An array describing messages to be sent, must include 2-10 items
Optionalother: Other<"sendMediaGroup", "media" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendmediagroup
Context-aware alias for api.sendPhoto. Use this method to send photos. On success, the sent Message is returned.
Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20.
Optionalother: Other<"sendPhoto", "photo" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendphoto
Context-aware alias for api.sendPoll. Use this method to send a native poll. On success, the sent Message is returned.
Poll question, 1-300 characters
A list of answer options, 2-10 strings 1-100 characters each
Optionalother: Other<"sendPoll", "chat_id" | "question" | "options">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendpoll
Context-aware alias for api.sendSticker. Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.
Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. Video and animated stickers can't be sent via an HTTP URL.
Optionalother: Other<"sendSticker", "sticker" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendsticker
Context-aware alias for api.sendVenue. Use this method to send information about a venue. On success, the sent Message is returned.
Latitude of the venue
Longitude of the venue
Name of the venue
Address of the venue
Optionalother: Other<"sendVenue", "chat_id" | "title" | "latitude" | "longitude" | "address">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendvenue
Context-aware alias for api.sendVideo. Use this method to send video files, Telegram clients support mp4 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.
Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data.
Optionalother: Other<"sendVideo", "video" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendvideo
Context-aware alias for api.sendVideoNote. Use this method to send video messages. On success, the sent Message is returned.
As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.
Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data.. Sending video notes by a URL is currently unsupported
Optionalother: Other<"sendVideoNote", "video_note" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendvideonote
Context-aware alias for api.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 (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.
Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data.
Optionalother: Other<"sendVoice", "voice" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendvoice
Context-aware alias for api.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.
An object for new user permissions
Optionalother: Other<"restrictChatMember", "chat_id" | "user_id" | "permissions">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#restrictchatmember
Context-aware alias for api.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.
Unique identifier of the target user
An object for new user permissions
Optionalother: Other<"restrictChatMember", "chat_id" | "user_id" | "permissions">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#restrictchatmember
Context-aware alias for api.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.
The invite link to revoke
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#revokechatinvitelink
Context-aware alias for api.savePreparedInlineMessage. Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object.
An object describing the message to be sent
Optionalother: Other<"savePreparedInlineMessage", "result" | "user_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#savepreparedinlinemessage
Context-aware alias for api.sendPaidMedia. Use this method to send paid media. On success, the sent Message is returned.
The number of Telegram Stars that must be paid to buy access to the media
An array describing the media to be sent; up to 10 items
Optionalother: Other<"sendPaidMedia", "media" | "chat_id" | "star_count">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#sendpaidmedia
Context-aware alias for api.setBusinessAccountBio. Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success.
The new value of the bio for the business account; 0-140 characters
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setbusinessaccountbio
Context-aware alias for api.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.
Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field
Types of gifts accepted by the business account
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setbusinessaccountgiftsettings
Context-aware alias for api.setBusinessAccountName. Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success.
The new value of the first name for the business account; 1-64 characters
Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setbusinessaccountname
Context-aware alias for api.setBusinessAccountProfilePhoto. CsetBusinessAccountProfilePhotohanges the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.
The new profile photo to set
Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setbusinessaccountprofilephoto
Context-aware alias for api.setBusinessAccountUsername. Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success.
The new value of the username for the business account; 0-32 characters
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setbusinessaccountusername
Context-aware alias for api.setChatAdministratorCustomTitle. Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
New custom title for the administrator; 0-16 characters, emoji are not allowed
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setchatadministratorcustomtitle
Context-aware alias for api.setChatAdministratorCustomTitle. Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
Unique identifier of the target user
New custom title for the administrator; 0-16 characters, emoji are not allowed
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setchatadministratorcustomtitle
Context-aware alias for api.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.
New chat description, 0-255 characters
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setchatdescription
Context-aware alias for api.setChatMenuButton. Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
Optionalother: Other<"setChatMenuButton", never>Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setchatmenubutton
Context-aware alias for api.setChatPermissions. Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success.
New default chat permissions
Optionalother: Other<"setChatPermissions", "chat_id" | "permissions">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setchatpermissions
Context-aware alias for api.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.
New chat photo, uploaded using multipart/form-data
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setchatphoto
Context-aware alias for api.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 ly returned in getChat requests to check if the bot can use this method. Returns True on success.
Name of the sticker set to be set as the group sticker set
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setchatstickerset
Context-aware alias for api.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.
New chat title, 1-255 characters
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setchattitle
Context-aware alias for api.setMyDefaultAdministratorRights. Use this method to the 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. Returns True on success.
Optionalother: Other<"setMyDefaultAdministratorRights", never>Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setmydefaultadministratorrights
Context-aware alias for api.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.
An array describing the errors
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setpassportdataerrors
Context-aware alias for api.serUserEmojiStatus. 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.
Optionalother: Other<"setUserEmojiStatus", "user_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#setuseremojistatus
Context-aware alias for api.stopMessageLiveLocation. Use 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.
Optionalother: Other<"stopMessageLiveLocation", "message_id" | "chat_id" | "inline_message_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#stopmessagelivelocation
Context-aware alias for api.stopPoll. Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
Optionalother: Other<"stopPoll", "message_id" | "chat_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#stoppoll
Context-aware alias for api.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.
Number of Telegram Stars to transfer; 1-10000
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#transferbusinessaccountstars
Context-aware alias for api.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.
Unique identifier of the regular gift that should be transferred
Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.
The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#transfergift
Context-aware alias for api.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.
Unique identifier of the target user
Optionalother: Other<"unbanChatMember", "chat_id" | "user_id">Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#unbanchatmember
Context-aware alias for api.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.
Unique identifier of the target sender chat
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#unbanchatsenderchat
Context-aware alias for api.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.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#unhidegeneralforumtopic
Context-aware alias for api.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.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#unpinallchatmessages
Context-aware alias for api.unpinAllForumTopicMessages. 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.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#unpinallforumtopicmessages
Context-aware alias for api.unpinAllGeneralForumTopicMessages. 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. Returns True on success.
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
Context-aware alias for api.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.
Optionalmessage_id: numberIdentifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.
Optionalother: Other<"unpinChatMessage", "message_id" | "chat_id">Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#unpinchatmessage
Context-aware alias for api.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.
Unique identifier of the regular gift that should be upgraded to a unique one
Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#upgradegift
Context-aware alias for api.verifyChat. Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.
Optionalother: Other<"verifyChat", never>Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#verifychat
Context-aware alias for api.verifyUser. Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.
Optionalother: Other<"verifyUser", never>Optional remaining parameters, confer the official reference below
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Official reference: https://core.telegram.org/bots/api#verifyuser
An API instance that allows you to call any method of the Telegram Bot API.