diff --git a/TelegramBotAPI.html b/TelegramBotAPI.html index fc87b38..e019161 100644 --- a/TelegramBotAPI.html +++ b/TelegramBotAPI.html @@ -53,6 +53,79 @@

@BotNews to be the first to know about the latest updates and join the discussion in @BotTalk

+

December 29, 2023

+

Bot API 7.0

+

Reactions

+ +

Replies 2.0

+ +

Link Preview Customization

+ +

Block Quotation

+ +

Multiple Message Actions

+ +

Request for multiple users

+ +

Chat Boost

+ +

Giveaway

+ +

Web App Changes

+ +

Other Changes

+

September 22, 2023

Bot API 6.9

-

April 21, 2023

-

Bot API 6.7

-
    -
  • Added support for launching Web Apps from inline query results by replacing the parameters switch_pm_text and switch_pm_parameter of the method answerInlineQuery with the parameter button of type InlineQueryResultsButton.
  • -
  • Added the field web_app_name to the class WriteAccessAllowed.
  • -
  • Added the field switch_inline_query_chosen_chat of the type SwitchInlineQueryChosenChat to the class InlineKeyboardButton, which allows bots to switch to inline mode in a chosen chat of the given type.
  • -
  • Added the field via_chat_folder_invite_link to the class ChatMemberUpdated.
  • -
  • Added the ability to set different bot names for different user languages using the method setMyName.
  • -
  • Added the ability to get the current bot name in the given language as the class BotName using the method getMyName.
  • -
  • Added the ability to change bot settings from the bot's profile in official Telegram apps, including the ability to set animated profile photos.
  • -
  • Added the ability to specify custom emoji entities using HTML and MarkdownV2 formatting options for bots that purchased additional usernames on Fragment.
  • -

See earlier changes »

Authorizing your bot

Each bot is given a unique authentication token when it is created. The token looks something like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11, but we'll use simply <token> in this document instead. You can learn about obtaining tokens and generating new ones in this document.

@@ -163,6 +224,16 @@

Optional. New version of a channel post that is known to the bot and was edited +message_reaction +MessageReactionUpdated +Optional. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots. + + +message_reaction_count +MessageReactionCountUpdated +Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. + + inline_query InlineQuery Optional. New incoming inline query @@ -205,13 +276,23 @@

chat_member ChatMemberUpdated -Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates. +Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify "chat_member" in the list of allowed_updates to receive these updates. chat_join_request ChatJoinRequest Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates. + +chat_boost +ChatBoostUpdated +Optional. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates. + + +removed_chat_boost +ChatBoostRemoved +Optional. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates. +

getUpdates

@@ -248,7 +329,7 @@

Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.

Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time. +A JSON-serialized list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.

Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time. @@ -296,7 +377,7 @@

Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time. +A JSON-serialized list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.
Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time. drop_pending_updates @@ -527,14 +608,39 @@

Ch Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat. +available_reactions +Array of ReactionType +Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. Returned only in getChat. + + +accent_color_id +Integer +Optional. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. Returned only in getChat. Always returned in getChat. + + +background_custom_emoji_id +String +Optional. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in getChat. + + +profile_accent_color_id +Integer +Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details. Returned only in getChat. + + +profile_background_custom_emoji_id +String +Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in getChat. + + emoji_status_custom_emoji_id String -Optional. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat. +Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in getChat. emoji_status_expiration_date Integer -Optional. Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in getChat. +Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in getChat. bio @@ -607,6 +713,11 @@

Ch Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat. +has_visible_history +True +Optional. True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat. + + sticker_set_name String Optional. For supergroups, name of group sticker set. Returned only in getChat. @@ -662,42 +773,17 @@

date Integer -Date the message was sent in Unix time +Date the message was sent in Unix time. It is always a positive number, representing a valid date. chat Chat -Conversation the message belongs to - - -forward_from -User -Optional. For forwarded messages, sender of the original message - - -forward_from_chat -Chat -Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat - - -forward_from_message_id -Integer -Optional. For messages forwarded from channels, identifier of the original message in the channel +Chat the message belongs to -forward_signature -String -Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present - - -forward_sender_name -String -Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages - - -forward_date -Integer -Optional. For forwarded messages, date the original message was sent in Unix time +forward_origin +MessageOrigin +Optional. Information about the original message for forwarded messages is_topic_message @@ -712,7 +798,17 @@

reply_to_message Message -Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. +Optional. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. + + +external_reply +ExternalReplyInfo +Optional. Information about the message that is being replied to, which may come from another chat or forum topic + + +quote +TextQuote +Optional. For replies that quote part of the original message, the quoted part of the message via_bot @@ -750,6 +846,11 @@

Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text +link_preview_options +LinkPreviewOptions +Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed + + animation Animation Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set @@ -896,8 +997,8 @@

pinned_message -Message -Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply. +MaybeInaccessibleMessage +Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. invoice @@ -910,9 +1011,9 @@

Optional. Message is a service message about a successful payment, information about the payment. More about payments » -user_shared -UserShared -Optional. Service message: a user was shared with the bot +users_shared +UsersShared +Optional. Service message: users were shared with the bot chat_shared @@ -970,6 +1071,26 @@

Optional. Service message: the 'General' forum topic unhidden +giveaway_created +GiveawayCreated +Optional. Service message: a scheduled giveaway was created + + +giveaway +Giveaway +Optional. The message is a scheduled giveaway message + + +giveaway_winners +GiveawayWinners +Optional. A giveaway with public winners was completed + + +giveaway_completed +GiveawayCompleted +Optional. Service message: a giveaway without public winners was completed + + video_chat_scheduled VideoChatScheduled Optional. Service message: video chat scheduled @@ -1019,6 +1140,40 @@

+

InaccessibleMessage

+

This object describes a message that was deleted or is otherwise inaccessible to the bot.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
chatChatChat the message belonged to
message_idIntegerUnique message identifier inside the chat
dateIntegerAlways 0. The field can be used to differentiate regular and inaccessible messages.
+

MaybeInaccessibleMessage

+

This object describes a message that can be inaccessible to the bot. It can be one of

+

MessageEntity

This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

@@ -1033,7 +1188,7 @@

without usernames), “custom_emoji” (for inline custom emoji stickers) +

@@ -1067,8 +1222,8 @@

PhotoSize

-

This object represents one size of a photo or a file / sticker thumbnail.

+

TextQuote

+

This object contains information about the quoted part of a message that is replied to by the given message.

Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)
offset
@@ -1079,34 +1234,29 @@

- - - - - - + - + - - - + + + - + - + - - - + + +
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idtext StringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.Text of the quoted part of a message that is replied to by the given message
widthIntegerPhoto widthentitiesArray of MessageEntityOptional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes.
heightposition IntegerPhoto heightApproximate quote position in the original message in UTF-16 code units as specified by the sender
file_sizeIntegerOptional. File size in bytesis_manualTrueOptional. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.
-

Animation

-

This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).

+

ExternalReplyInfo

+

This object contains information about a message that is being replied to, which may come from another chat or forum topic.

@@ -1117,112 +1267,124 @@

- - - + + + - - - + + + - + - + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - -
file_idStringIdentifier for this file, which can be used to download or reuse the fileoriginMessageOriginOrigin of the message replied to by the given message
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.chatChatOptional. Chat the original message belongs to. Available only if the chat is a supergroup or a channel.
widthmessage_id IntegerVideo width as defined by senderOptional. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.
heightIntegerVideo height as defined by senderlink_preview_optionsLinkPreviewOptionsOptional. Options used for link preview generation for the original message, if it is a text message
durationIntegerDuration of the video in seconds as defined by senderanimationAnimationOptional. Message is an animation, information about the animation
thumbnailPhotoSizeOptional. Animation thumbnail as defined by senderaudioAudioOptional. Message is an audio file, information about the file
file_nameStringOptional. Original animation filename as defined by senderdocumentDocumentOptional. Message is a general file, information about the file
mime_typeStringOptional. MIME type of the file as defined by senderphotoArray of PhotoSizeOptional. Message is a photo, available sizes of the photo
file_sizeIntegerOptional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.stickerStickerOptional. Message is a sticker, information about the sticker
-

Audio

-

This object represents an audio file to be treated as music by the Telegram clients.

- - - - - + + + - - - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionstoryStoryOptional. Message is a forwarded story
file_idStringIdentifier for this file, which can be used to download or reuse the filevideoVideoOptional. Message is a video, information about the video
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.video_noteVideoNoteOptional. Message is a video note, information about the video message
durationIntegerDuration of the audio in seconds as defined by sendervoiceVoiceOptional. Message is a voice message, information about the file
performerStringOptional. Performer of the audio as defined by sender or by audio tagshas_media_spoilerTrueOptional. True, if the message media is covered by a spoiler animation
titleStringOptional. Title of the audio as defined by sender or by audio tagscontactContactOptional. Message is a shared contact, information about the contact
file_nameStringOptional. Original filename as defined by senderdiceDiceOptional. Message is a dice with random value
mime_typeStringOptional. MIME type of the file as defined by sendergameGameOptional. Message is a game, information about the game. More about games »
file_sizeIntegerOptional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.giveawayGiveawayOptional. Message is a scheduled giveaway, information about the giveaway
thumbnailPhotoSizeOptional. Thumbnail of the album cover to which the music file belongsgiveaway_winnersGiveawayWinnersOptional. A giveaway with public winners was completed
invoiceInvoiceOptional. Message is an invoice for a payment, information about the invoice. More about payments »
locationLocationOptional. Message is a shared location, information about the location
pollPollOptional. Message is a native poll, information about the poll
venueVenueOptional. Message is a venue, information about the venue
-

Document

-

This object represents a general file (as opposed to photos, voice messages and audio files).

+

ReplyParameters

+

Describes reply parameters for the message that is being sent.

@@ -1233,9 +1395,346 @@

- - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
file_idStringIdentifier for this file, which can be used to download or reuse the filemessage_idIntegerIdentifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified
chat_idInteger or StringOptional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername)
allow_sending_without_replyBooleanOptional. Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.
quoteStringOptional. Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities. The message will fail to send if the quote isn't found in the original message.
quote_parse_modeStringOptional. Mode for parsing entities in the quote. See formatting options for more details.
quote_entitiesArray of MessageEntityOptional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode.
quote_positionIntegerOptional. Position of the quote in the original message in UTF-16 code units
+

MessageOrigin

+

This object describes the origin of a message. It can be one of

+ +

MessageOriginUser

+

The message was originally sent by a known user.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the message origin, always “user”
dateIntegerDate the message was sent originally in Unix time
sender_userUserUser that sent the message originally
+

MessageOriginHiddenUser

+

The message was originally sent by an unknown user.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the message origin, always “hidden_user”
dateIntegerDate the message was sent originally in Unix time
sender_user_nameStringName of the user that sent the message originally
+

MessageOriginChat

+

The message was originally sent on behalf of a chat to a group chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the message origin, always “chat”
dateIntegerDate the message was sent originally in Unix time
sender_chatChatChat that sent the message originally
author_signatureStringOptional. For messages originally sent by an anonymous chat administrator, original message author signature
+

MessageOriginChannel

+

The message was originally sent to a channel chat.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
typeStringType of the message origin, always “channel”
dateIntegerDate the message was sent originally in Unix time
chatChatChannel chat to which the message was originally sent
message_idIntegerUnique message identifier inside the chat
author_signatureStringOptional. Signature of the original post author
+

PhotoSize

+

This object represents one size of a photo or a file / sticker thumbnail.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
widthIntegerPhoto width
heightIntegerPhoto height
file_sizeIntegerOptional. File size in bytes
+

Animation

+

This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
widthIntegerVideo width as defined by sender
heightIntegerVideo height as defined by sender
durationIntegerDuration of the video in seconds as defined by sender
thumbnailPhotoSizeOptional. Animation thumbnail as defined by sender
file_nameStringOptional. Original animation filename as defined by sender
mime_typeStringOptional. MIME type of the file as defined by sender
file_sizeIntegerOptional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
+

Audio

+

This object represents an audio file to be treated as music by the Telegram clients.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
durationIntegerDuration of the audio in seconds as defined by sender
performerStringOptional. Performer of the audio as defined by sender or by audio tags
titleStringOptional. Title of the audio as defined by sender or by audio tags
file_nameStringOptional. Original filename as defined by sender
mime_typeStringOptional. MIME type of the file as defined by sender
file_sizeIntegerOptional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
thumbnailPhotoSizeOptional. Thumbnail of the album cover to which the music file belongs
+

Document

+

This object represents a general file (as opposed to photos, voice messages and audio files).

+ + + + + + + + + + + + + @@ -1819,8 +2318,8 @@

GeneralForumTopicUnhidden

This object represents a service message about General forum topic unhidden in the chat. Currently holds no information.

-

UserShared

-

This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button.

+

UsersShared

+

This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.

FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_id
@@ -1836,9 +2335,9 @@

WriteAccessAllowed

+

This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
from_requestBooleanOptional. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess
web_app_nameStringOptional. Name of the Web App, if the access was granted when the Web App was launched from a link
from_attachment_menuBooleanOptional. True, if the access was granted when the bot was added to the attachment or side menu
+

VideoChatScheduled

+

This object represents a service message about a video chat scheduled in the chat.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
start_dateIntegerPoint in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator
+

VideoChatStarted

+

This object represents a service message about a video chat started in the chat. Currently holds no information.

+

VideoChatEnded

+

This object represents a service message about a video chat ended in the chat.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
durationIntegerVideo chat duration in seconds
+

VideoChatParticipantsInvited

+

This object represents a service message about new members invited to a video chat.

+ + + + + + + + + + + + + + + +
FieldTypeDescription
usersArray of UserNew members that were invited to the video chat
+

GiveawayCreated

+

This object represents a service message about the creation of a scheduled giveaway. Currently holds no information.

+

Giveaway

+

This object represents a message about a scheduled giveaway.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
chatsArray of ChatThe list of chats which the user must join to participate in the giveaway
winners_selection_dateIntegerPoint in time (Unix timestamp) when winners of the giveaway will be selected
winner_countIntegerThe number of users which are supposed to be selected as winners of the giveaway
only_new_membersTrueOptional. True, if only users who join the chats after the giveaway started should be eligible to win
has_public_winnersTrueOptional. True, if the list of giveaway winners will be visible to everyone
prize_descriptionStringOptional. Description of additional giveaway prize
country_codesArray of StringOptional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways.
premium_subscription_month_countIntegerOptional. The number of months the Telegram Premium subscription won from the giveaway will be active for
+

GiveawayWinners

+

This object represents a message about the completion of a giveaway with public winners.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - -
FieldTypeDescription
chatChatThe chat that created the giveaway
giveaway_message_idIntegerIdentifier of the messsage with the giveaway in the chat
winners_selection_dateIntegerPoint in time (Unix timestamp) when winners of the giveaway were selected
winner_countIntegerTotal number of winners in the giveaway
winnersArray of UserList of up to 100 winners of the giveaway
additional_chat_count IntegerIdentifier of the requestOptional. The number of other chats the user had to join in order to be eligible for the giveaway
chat_idpremium_subscription_month_count IntegerIdentifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for
-

WriteAccessAllowed

-

This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.

- - - - - + + + - - - - - + + + - - - + + + - - - + + +
FieldTypeDescriptionunclaimed_prize_countIntegerOptional. Number of undistributed prizes
from_requestBooleanOptional. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccessonly_new_membersTrueOptional. True, if only users who had joined the chats after the giveaway started were eligible to win
web_app_nameStringOptional. Name of the Web App, if the access was granted when the Web App was launched from a linkwas_refundedTrueOptional. True, if the giveaway was canceled because the payment for it was refunded
from_attachment_menuBooleanOptional. True, if the access was granted when the bot was added to the attachment or side menuprize_descriptionStringOptional. Description of additional giveaway prize
-

VideoChatScheduled

-

This object represents a service message about a video chat scheduled in the chat.

+

GiveawayCompleted

+

This object represents a service message about the completion of a giveaway without public winners.

@@ -1905,34 +2583,24 @@

- + - + - -
start_datewinner_count IntegerPoint in time (Unix timestamp) when the video chat is supposed to be started by a chat administratorNumber of winners in the giveaway
-

VideoChatStarted

-

This object represents a service message about a video chat started in the chat. Currently holds no information.

-

VideoChatEnded

-

This object represents a service message about a video chat ended in the chat.

- - - - - + + + - - - - - + + +
FieldTypeDescriptionunclaimed_prize_countIntegerOptional. Number of undistributed prizes
durationIntegerVideo chat duration in secondsgiveaway_messageMessageOptional. Message with the giveaway that was completed, if it wasn't deleted
-

VideoChatParticipantsInvited

-

This object represents a service message about new members invited to a video chat.

+

LinkPreviewOptions

+

Describes the options used for link preview generation.

@@ -1943,9 +2611,29 @@

User -

+ + + + + + + + + + + + + + + + + + + + + + +
New members that were invited to the video chatis_disabledBooleanOptional. True, if the link preview is disabled
urlStringOptional. URL to use for the link preview. If empty, then the first URL found in the message text will be used
prefer_small_mediaBooleanOptional. True, if the media in the link preview is suppposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
prefer_large_mediaBooleanOptional. True, if the media in the link preview is suppposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
show_above_textBooleanOptional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text
@@ -2086,9 +2774,9 @@

KeyboardButtonRequestUser -Optional. If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a “user_shared” service message. Available in private chats only. +request_users +KeyboardButtonRequestUsers +Optional. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only. request_chat @@ -2118,8 +2806,8 @@

KeyboardButtonRequestUser

-

This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed. More about requesting users »

+

KeyboardButtonRequestUsers

+

This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed. More about requesting users »

@@ -2132,17 +2820,22 @@

UserShared object. Must be unique within the message +

- + - + + + + + +
Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message
user_is_bot BooleanOptional. Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied.Optional. Pass True to request bots, pass False to request regular users. If not specified, no additional restrictions are applied.
user_is_premium BooleanOptional. Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied.Optional. Pass True to request premium users, pass False to request non-premium users. If not specified, no additional restrictions are applied.
max_quantityIntegerOptional. The maximum number of users to be selected; 1-10. Defaults to 1.
@@ -2424,8 +3117,8 @@

Message -Optional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old +MaybeInaccessibleMessage +Optional. Message sent by the bot with the callback button that originated the query inline_message_id @@ -2598,7 +3291,7 @@

ChatMemberUpdated

+

This object represents changes in the status of a chat member.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
chatChatChat the user belongs to
fromUserPerformer of the action, which resulted in the change
dateIntegerDate the change was done in Unix time
old_chat_memberChatMemberPrevious information about the chat member
new_chat_memberChatMemberNew information about the chat member
invite_linkChatInviteLinkOptional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
via_chat_folder_invite_linkBooleanOptional. True, if the user joined the chat via a chat folder invite link

ChatMember

This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:

    @@ -2744,7 +3485,7 @@

    < can_send_messages Boolean -True, if the user is allowed to send text messages, contacts, invoices, locations and venues +True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues can_send_audios @@ -2995,8 +3736,8 @@

    -

    ChatMemberUpdated

    -

    This object represents changes in the status of a chat member.

    +

    ChatJoinRequest

    +

    Represents a join request sent to a chat.

    @@ -3009,42 +3750,120 @@

    - + - + - + - + - - - + + + - - - + + + - + + + +
    chat ChatChat the user belongs toChat to which the request was sent
    from UserPerformer of the action, which resulted in the changeUser that sent the join request
    dateuser_chat_id IntegerDate the change was done in Unix timeIdentifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user.
    old_chat_memberChatMemberPrevious information about the chat memberdateIntegerDate the request was sent in Unix time
    new_chat_memberChatMemberNew information about the chat memberbioStringOptional. Bio of the user.
    invite_link ChatInviteLinkOptional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.Optional. Chat invite link that was used by the user to send the join request
    +

    ChatPermissions

    +

    Describes actions that a non-administrator user is allowed to take in a chat.

    + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    via_chat_folder_invite_linkcan_send_messages BooleanOptional. True, if the user joined the chat via a chat folder invite linkOptional. True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues
    can_send_audiosBooleanOptional. True, if the user is allowed to send audios
    can_send_documentsBooleanOptional. True, if the user is allowed to send documents
    can_send_photosBooleanOptional. True, if the user is allowed to send photos
    can_send_videosBooleanOptional. True, if the user is allowed to send videos
    can_send_video_notesBooleanOptional. True, if the user is allowed to send video notes
    can_send_voice_notesBooleanOptional. True, if the user is allowed to send voice notes
    can_send_pollsBooleanOptional. True, if the user is allowed to send polls
    can_send_other_messagesBooleanOptional. True, if the user is allowed to send animations, games, stickers and use inline bots
    can_add_web_page_previewsBooleanOptional. True, if the user is allowed to add web page previews to their messages
    can_change_infoBooleanOptional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
    can_invite_usersBooleanOptional. True, if the user is allowed to invite new users to the chat
    can_pin_messagesBooleanOptional. True, if the user is allowed to pin messages. Ignored in public supergroups
    can_manage_topicsBooleanOptional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages
    -

    ChatJoinRequest

    -

    Represents a join request sent to a chat.

    +

    ChatLocation

    +

    Represents a location to which a chat is connected.

    @@ -3055,39 +3874,48 @@

    Chat -

    - - - - - + + + - - - + + + + +
    Chat to which the request was sent
    fromUserUser that sent the join requestlocationLocationThe location to which the supergroup is connected. Can't be a live location.
    user_chat_idIntegerIdentifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user.addressStringLocation address; 1-64 characters, as defined by the chat owner
    +

    ReactionType

    +

    This object describes the type of a reaction. Currently, it can be one of

    + +

    ReactionTypeEmoji

    +

    The reaction is based on an emoji.

    + + - - - + + + + + - + - + - - - + + +
    dateIntegerDate the request was sent in Unix timeFieldTypeDescription
    biotype StringOptional. Bio of the user.Type of the reaction, always “emoji”
    invite_linkChatInviteLinkOptional. Chat invite link that was used by the user to send the join requestemojiStringReaction emoji. Currently, it can be one of "👍", "👎", "❤", "🔥", "🥰", "👏", "😁", "🤔", "🤯", "😱", "🤬", "😢", "🎉", "🤩", "🤮", "💩", "🙏", "👌", "🕊", "🤡", "🥱", "🥴", "😍", "🐳", "❤‍🔥", "🌚", "🌭", "💯", "🤣", "⚡", "🍌", "🏆", "💔", "🤨", "😐", "🍓", "🍾", "💋", "🖕", "😈", "😴", "😭", "🤓", "👻", "👨‍💻", "👀", "🎃", "🙈", "😇", "😨", "🤝", "✍", "🤗", "🫡", "🎅", "🎄", "☃", "💅", "🤪", "🗿", "🆒", "💘", "🙉", "🦄", "😘", "💊", "🙊", "😎", "👾", "🤷‍♂", "🤷", "🤷‍♀", "😡"
    -

    ChatPermissions

    -

    Describes actions that a non-administrator user is allowed to take in a chat.

    +

    ReactionTypeCustomEmoji

    +

    The reaction is based on a custom emoji.

    @@ -3098,79 +3926,90 @@

    ReactionCount

    +

    Represents a reaction added to a message along with the number of times it was added.

    +
    + - - - + + + + + - - - + + + - - - + + + + +
    can_send_photosBooleanOptional. True, if the user is allowed to send photosFieldTypeDescription
    can_send_videosBooleanOptional. True, if the user is allowed to send videostypeReactionTypeType of the reaction
    can_send_video_notesBooleanOptional. True, if the user is allowed to send video notestotal_countIntegerNumber of times the reaction was added
    +

    MessageReactionUpdated

    +

    This object represents a change of a reaction on a message performed by a user.

    + + - - - + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + +
    can_send_voice_notesBooleanOptional. True, if the user is allowed to send voice notesFieldTypeDescription
    can_send_pollsBooleanOptional. True, if the user is allowed to send pollschatChatThe chat containing the message the user reacted to
    can_send_other_messagesBooleanOptional. True, if the user is allowed to send animations, games, stickers and use inline botsmessage_idIntegerUnique identifier of the message inside the chat
    can_add_web_page_previewsBooleanOptional. True, if the user is allowed to add web page previews to their messagesuserUserOptional. The user that changed the reaction, if the user isn't anonymous
    can_change_infoBooleanOptional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroupsactor_chatChatOptional. The chat on behalf of which the reaction was changed, if the user is anonymous
    can_invite_usersBooleanOptional. True, if the user is allowed to invite new users to the chatdateIntegerDate of the change in Unix time
    can_pin_messagesBooleanOptional. True, if the user is allowed to pin messages. Ignored in public supergroupsold_reactionArray of ReactionTypePrevious list of reaction types that were set by the user
    can_manage_topicsBooleanOptional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messagesnew_reactionArray of ReactionTypeNew list of reaction types that have been set by the user
    -

    ChatLocation

    -

    Represents a location to which a chat is connected.

    +

    MessageReactionCountUpdated

    +

    This object represents reaction changes on a message with anonymous reactions.

    @@ -3181,14 +4020,24 @@

    Location -

    + + + - - - + + + + + + + + + + + + +
    The location to which the supergroup is connected. Can't be a live location.chatChatThe chat containing the message
    addressStringLocation address; 1-64 characters, as defined by the chat ownermessage_idIntegerUnique message identifier inside the chat
    dateIntegerDate of the change in Unix time
    reactionsArray of ReactionCountList of reactions that are present on the message
    @@ -3353,12 +4202,166 @@

    BotCommandScopeChat

    +

    Represents the scope of bot commands, covering a specific chat.

    + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringScope type, must be chat
    chat_idInteger or StringUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
    +

    BotCommandScopeChatAdministrators

    +

    Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.

    + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringScope type, must be chat_administrators
    chat_idInteger or StringUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
    +

    BotCommandScopeChatMember

    +

    Represents the scope of bot commands, covering a specific member of a group or supergroup chat.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringScope type, must be chat_member
    chat_idInteger or StringUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
    user_idIntegerUnique identifier of the target user
    +

    BotName

    +

    This object represents the bot's name.

    + + + + + + + + + + + + + + + +
    FieldTypeDescription
    nameStringThe bot's name
    +

    BotDescription

    +

    This object represents the bot's description.

    + + + + + + + + + + + + + + + +
    FieldTypeDescription
    descriptionStringThe bot's description
    +

    BotShortDescription

    +

    This object represents the bot's short description.

    + + + + + + + + + + + + + + + +
    FieldTypeDescription
    short_descriptionStringThe bot's short description
    +

    MenuButton

    +

    This object describes the bot's menu button in a private chat. It should be one of

    + +

    If a menu button other than MenuButtonDefault is set for a private chat, then it is applied in the chat. Otherwise the default menu button is applied. By default, the menu button opens the list of bot commands.

    +

    MenuButtonCommands

    +

    Represents a menu button, which opens the bot's list of commands.

    + + + + + + + + + + + + +
    FieldTypeDescription
    typeStringType of the button, must be commands
    -

    BotCommandScopeChat

    -

    Represents the scope of bot commands, covering a specific chat.

    +

    MenuButtonWebApp

    +

    Represents a menu button, which launches a Web App.

    @@ -3371,17 +4374,22 @@

    - + - - - + + + + + + + +
    type StringScope type, must be chatType of the button, must be web_app
    chat_idInteger or StringUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)textStringText on the button
    web_appWebAppInfoDescription of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery.
    -

    BotCommandScopeChatAdministrators

    -

    Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.

    +

    MenuButtonDefault

    +

    Describes that no specific value for the menu button was set.

    @@ -3394,17 +4402,19 @@

    BotCommandScopeChatMember

    -

    Represents the scope of bot commands, covering a specific member of a group or supergroup chat.

    +

    ChatBoostSource

    +

    This object describes the source of a chat boost. It can be one of

    + +

    ChatBoostSourcePremium

    +

    The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.

    @@ -3415,24 +4425,19 @@

    User +

    User that boosted the chat
    -

    BotName

    -

    This object represents the bot's name.

    +

    ChatBoostSourceGiftCode

    +

    The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.

    @@ -3443,14 +4448,19 @@

    - + - + + + + + +
    namesource StringThe bot's nameSource of the boost, always “gift_code”
    userUserUser for which the gift code was created
    -

    BotDescription

    -

    This object represents the bot's description.

    +

    ChatBoostSourceGiveaway

    +

    The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.

    @@ -3461,14 +4471,29 @@

    User +

    + + + + +
    Optional. User that won the prize in the giveaway if any
    is_unclaimedTrueOptional. True, if the giveaway was completed, but there was no user to win the prize
    -

    BotShortDescription

    -

    This object represents the bot's short description.

    +

    ChatBoost

    +

    This object contains information about a chat boost.

    @@ -3479,22 +4504,29 @@

    - + - + + + + + + + + + + + + + + + +
    short_descriptionboost_id StringThe bot's short descriptionUnique identifier of the boost
    add_dateIntegerPoint in time (Unix timestamp) when the chat was boosted
    expiration_dateIntegerPoint in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged
    sourceChatBoostSourceSource of the added boost
    -

    MenuButton

    -

    This object describes the bot's menu button in a private chat. It should be one of

    - -

    If a menu button other than MenuButtonDefault is set for a private chat, then it is applied in the chat. Otherwise the default menu button is applied. By default, the menu button opens the list of bot commands.

    -

    MenuButtonCommands

    -

    Represents a menu button, which opens the bot's list of commands.

    +

    ChatBoostUpdated

    +

    This object represents a boost added to a chat or changed.

    @@ -3505,14 +4537,19 @@

    - - - + + + + + + + +
    typeStringType of the button, must be commandschatChatChat which was boosted
    boostChatBoostInfomation about the chat boost
    -

    MenuButtonWebApp

    -

    Represents a menu button, which launches a Web App.

    +

    ChatBoostRemoved

    +

    This object represents a boost removed from a chat.

    @@ -3523,24 +4560,29 @@

    - - - + + + - + - + - - - + + + + + + + +
    typeStringType of the button, must be web_appchatChatChat which was boosted
    textboost_id StringText on the buttonUnique identifier of the boost
    web_appWebAppInfoDescription of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery.remove_dateIntegerPoint in time (Unix timestamp) when the boost was removed
    sourceChatBoostSourceSource of the removed boost
    -

    MenuButtonDefault

    -

    Describes that no specific value for the menu button was set.

    +

    UserChatBoosts

    +

    This object represents a list of boosts added to a chat by a user.

    @@ -3551,9 +4593,9 @@

    - - - + + +
    typeStringType of the button, must be defaultboostsArray of ChatBoostThe list of boosts added to the chat by the user
    @@ -3893,6 +4935,54 @@

    sendVoice, the file must have the type audio/ogg and be no more than 1MB in size. 1-20MB voice notes will be sent as files.
  • Other configurations may work but we can't guarantee that they will.
+

Accent colors

+

Colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) can be customized by app themes. Additionally, the following colors in RGB format are currently in use.

+

+ + + + + + + + + + + + + + + + + + + +
Color identifierLight colorsDark colors
7E15052 F9AE63FF9380 992F37
8E0802B FAC534ECB04E C35714
9A05FF3 F48FFFC697FF 5E31C8
1027A910 A7DC57A7EB6E 167E2D
1127ACCE 82E8D640D8D0 045C7F
123391D4 7DD3F052BFFF 0B5494
13DD4371 FFBE9FFF86A6 8E366E
14247BED F04856 FFFFFF3FA2FE E5424F FFFFFF
15D67722 1EA011 FFFFFFFF905E 32A527 FFFFFF
16179E42 E84A3F FFFFFF66D364 D5444F FFFFFF
172894AF 6FC456 FFFFFF22BCE2 3DA240 FFFFFF
180C9AB3 FFAD95 FFE6B522BCE2 FF9778 FFDA6B
197757D6 F79610 FFDE8E9791FF F2731D FFDB59
201585CF F2AB1D FFFFFF3DA6EB EEA51D FFFFFF

+

Profile accent colors

+

Currently, the following colors in RGB format are in use for profile backgrounds.

+

+ + + + + + + + + + + + + + + + + + + + + +
Color identifierLight colorsDark colors
0BA56509C4540
1C27C3E945E2C
2956AC8715099
349A35533713B
43E97AD387E87
55A8FBB477194
6B85378944763
77F8B95435261
8C9565D D97C57994343 AC583E
9CF7244 CC94338F552F A17232
109662D4 B966B6634691 9250A2
113D9755 89A650296A43 5F8F44
123D95BA 50AD98306C7C 3E987E
13538BC2 4DA8BD38618C 458BA1
14B04F74 D1666D884160 A65259
15637482 7B8A9753606E 384654

Inline mode objects

Objects and methods used in the inline mode are described in the Inline mode section.

Available methods

@@ -3948,10 +5038,10 @@

LinkPreviewOptions Optional -Disables link previews for links in this message +Link preview generation options for the message disable_notification @@ -3966,16 +5056,10 @@

ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to reply_markup @@ -3986,14 +5070,15 @@

Formatting options

-

The Bot API supports basic formatting for messages. You can use bold, italic, underlined, strikethrough, and spoiler text, as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can specify text entities directly, or use markdown-style or HTML-style formatting.

+

The Bot API supports basic formatting for messages. You can use bold, italic, underlined, strikethrough, spoiler text, block quotations as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can specify text entities directly, or use markdown-style or HTML-style formatting.

Note that Telegram clients will display an alert to the user before opening an inline link ('Open this link?' together with the full URL).

-

Message entities can be nested, providing following restrictions are met:
- If two entities have common characters, then one of them is fully contained inside another.
- bold, italic, underline, strikethrough, and spoiler entities can contain and can be part of any other entities, except pre and code.
- All other entities can't contain each other.

+

Message entities can be nested, providing following restrictions are met:
- If two entities have common characters, then one of them is fully contained inside another.
- bold, italic, underline, strikethrough, and spoiler entities can contain and can be part of any other entities, except pre and code.
- blockquote entities can't be nested.
- All other entities can't contain each other.

Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username. Please note:

  • These links will work only if they are used inside an inline link or in an inline keyboard button. For example, they will not work, when used in a message text.
  • Unless the user is a member of the chat where they were mentioned, these mentions are only guaranteed to work if the user has contacted the bot in private in the past or has sent a callback query to the bot via an inline button and doesn't have Forwarded Messages privacy enabled for the bot.
+

You can find the list of programming and markup languages for which syntax highlighting is supported at libprisma#supported-languages.

MarkdownV2 style

To use this mode, pass MarkdownV2 in the parse_mode field. Use the following syntax in your message:

*bold \*text*
@@ -4011,7 +5096,10 @@ 
+``` +>Block quotation started +>Block quotation continued +>The last line of the block quotation

Please note:

  • Any character with code between 1 and 126 inclusively can be escaped anywhere with a preceding '\' character, in which case it is treated as an ordinary character and not a part of the markup. This implies that '\' character usually must be escaped with a preceding '\' character.
  • @@ -4035,7 +5123,8 @@
    </tg-emoji> <code>inline fixed-width code</code> <pre>pre-formatted fixed-width code block</pre> -<pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre> +<pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre> +<blockquote>Block quotation started\nBlock quotation continued\nThe last line of the block quotation</blockquote>

    Please note:

    • Only the tags mentioned above are currently supported.
    • @@ -4063,12 +5152,12 @@
      MarkdownV2 instead. -
    • There is no way to specify underline and strikethrough entities, use parse mode MarkdownV2 instead.
    • +
    • There is no way to specify “underline”, “strikethrough”, “spoiler”, “blockquote” and “custom_emoji” entities, use parse mode MarkdownV2 instead.
    • To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.
    • Escaping inside entities is not allowed, so entity must be closed first and reopened again: use _snake_\__case_ for italic snake_case and *2*\**2=4* for bold 2*2=4.

    forwardMessage

    -

    Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent Message is returned.

    +

    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.

    @@ -4117,8 +5206,138 @@

    copyMessage

    -

    Use this method to copy messages of any kind. Service 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.

    +

    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.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of the forum; for forum supergroups only
    from_chat_idInteger or StringYesUnique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)
    message_idsArray of IntegerYesIdentifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.
    disable_notificationBooleanOptionalSends the messages silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the forwarded messages from forwarding and saving
    +

    copyMessage

    +

    Use this method to copy messages of any kind. 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 forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of the forum; for forum supergroups only
    from_chat_idInteger or StringYesUnique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
    message_idIntegerYesMessage identifier in the chat specified in from_chat_id
    captionStringOptionalNew caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
    parse_modeStringOptionalMode for parsing entities in the new caption. See formatting options for more details.
    caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode
    disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
    protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
    reply_parametersReplyParametersOptionalDescription of the message to reply to
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
    +

    copyMessages

    +

    Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned.

    @@ -4145,61 +5364,31 @@

    formatting options for more details. -

    - - - - - + - + - - - - - - - + - + - - - - - - - +
    caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_modeIdentifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.
    disable_notification Boolean OptionalSends the message silently. Users will receive a notification with no sound.Sends the messages silently. Users will receive a notification with no sound.
    protect_content Boolean OptionalProtects the contents of the sent message from forwarding and saving
    reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original messageProtects the contents of the sent messages from forwarding and saving
    allow_sending_without_replyremove_caption Boolean OptionalPass True if the message should be sent even if the specified replied-to message is not found
    reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.Pass True to copy the messages without their captions
    @@ -4270,16 +5459,10 @@

    Protects the contents of the sent message from forwarding and saving -reply_to_message_id -Integer -Optional -If the message is a reply, ID of the original message - - -allow_sending_without_reply -Boolean +reply_parameters +ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to reply_markup @@ -4375,16 +5558,10 @@

    Protects the contents of the sent message from forwarding and saving -reply_to_message_id -Integer -Optional -If the message is a reply, ID of the original message - - -allow_sending_without_reply -Boolean +reply_parameters +ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to reply_markup @@ -4467,16 +5644,10 @@

    ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to reply_markup @@ -4583,16 +5754,10 @@

    Protects the contents of the sent message from forwarding and saving -reply_to_message_id -Integer -Optional -If the message is a reply, ID of the original message - - -allow_sending_without_reply -Boolean +reply_parameters +ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to reply_markup @@ -4693,16 +5858,10 @@

    ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to reply_markup @@ -4779,16 +5938,10 @@

    Protects the contents of the sent message from forwarding and saving -reply_to_message_id -Integer -Optional -If the message is a reply, ID of the original message - - -allow_sending_without_reply -Boolean +reply_parameters +ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to reply_markup @@ -4859,16 +6012,10 @@

    ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to reply_markup @@ -4921,16 +6068,10 @@

    ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to @@ -5007,16 +6148,10 @@

    ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to reply_markup @@ -5111,16 +6246,10 @@

    Protects the contents of the sent message from forwarding and saving -reply_to_message_id -Integer -Optional -If the message is a reply, ID of the original message - - -allow_sending_without_reply -Boolean +reply_parameters +ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to reply_markup @@ -5191,16 +6320,10 @@

    ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to reply_markup @@ -5319,16 +6442,10 @@

    Protects the contents of the sent message from forwarding and saving -reply_to_message_id -Integer -Optional -If the message is a reply, ID of the original message - - -allow_sending_without_reply -Boolean +reply_parameters +ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to reply_markup @@ -5381,16 +6498,10 @@

    Protects the contents of the sent message from forwarding -reply_to_message_id -Integer -Optional -If the message is a reply, ID of the original message - - -allow_sending_without_reply -Boolean +reply_parameters +ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to reply_markup @@ -5436,6 +6547,44 @@

    setMessageReaction

    +

    Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message. Returns True on success.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    message_idIntegerYesIdentifier of the target message
    reactionArray of ReactionTypeOptionalNew 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.
    is_bigBooleanOptionalPass True to set the reaction with a big animation

    getUserProfilePhotos

    Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.

    @@ -5637,79 +6786,79 @@

    can_manage_chat

    - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -6227,7 +7376,7 @@

    Boolean OptionalPass True if the administrator can access the chat event log, chat statistics, boost list in channels, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilegePass True if the administrator can access the chat event log, boost list in channels, see channel members, report spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege
    can_post_messagescan_delete_messages Boolean OptionalPass True if the administrator can post messages in the channel; channels onlyPass True if the administrator can delete messages of other users
    can_edit_messagescan_manage_video_chats Boolean OptionalPass True if the administrator can edit messages of other users and can pin messages; channels onlyPass True if the administrator can manage video chats
    can_delete_messagescan_restrict_members Boolean OptionalPass True if the administrator can delete messages of other usersPass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics
    can_post_storiescan_promote_members Boolean OptionalPass True if the administrator can post stories in the channel; channels onlyPass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)
    can_edit_storiescan_change_info Boolean OptionalPass True if the administrator can edit stories posted by other users; channels onlyPass True if the administrator can change chat title, photo and other settings
    can_delete_storiescan_invite_users Boolean OptionalPass True if the administrator can delete stories posted by other users; channels onlyPass True if the administrator can invite new users to the chat
    can_manage_video_chatscan_post_messages Boolean OptionalPass True if the administrator can manage video chatsPass True if the administrator can post messages in the channel, or access channel statistics; channels only
    can_restrict_memberscan_edit_messages Boolean OptionalPass True if the administrator can restrict, ban or unban chat membersPass True if the administrator can edit messages of other users and can pin messages; channels only
    can_promote_memberscan_pin_messages Boolean OptionalPass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)Pass True if the administrator can pin messages, supergroups only
    can_change_infocan_post_stories Boolean OptionalPass True if the administrator can change chat title, photo and other settingsPass True if the administrator can post stories in the channel; channels only
    can_invite_userscan_edit_stories Boolean OptionalPass True if the administrator can invite new users to the chatPass True if the administrator can edit stories posted by other users; channels only
    can_pin_messagescan_delete_stories Boolean OptionalPass True if the administrator can pin messages, supergroups onlyPass True if the administrator can delete stories posted by other users; channels only
    can_manage_topics

    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.

    +

    Use this method to get up to date information about the chat. Returns a Chat object on success.

    @@ -6713,6 +7862,32 @@

    +

    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.

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the chat or username of the channel (in the format @channelusername)
    user_idIntegerYesUnique identifier of the target user

    setMyCommands

    Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success.

    @@ -7081,10 +8256,10 @@

    LinkPreviewOptions

    - + @@ -7396,6 +8571,32 @@

    deleteMessages

    +

    Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success.

    +
    OptionalDisables link previews for links in this messageLink preview generation options for the message
    reply_markup
    + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
    message_idsArray of IntegerYesIdentifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted

    Stickers

    The following methods and objects allow your bot to handle stickers and sticker sets.

    Sticker

    @@ -7649,16 +8850,10 @@

    ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to reply_markup @@ -9595,9 +10790,9 @@

    LinkPreviewOptions +Optional. Link preview generation options for the message @@ -10091,16 +11286,10 @@

    ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to reply_markup @@ -10389,7 +11578,7 @@

    ISO 3166-1 alpha-2 country code state @@ -11155,16 +12344,10 @@

    Protects the contents of the sent message from forwarding and saving -reply_to_message_id -Integer -Optional -If the message is a reply, ID of the original message - - -allow_sending_without_reply -Boolean +reply_parameters +ReplyParameters Optional -Pass True if the message should be sent even if the specified replied-to message is not found +Description of the message to reply to reply_markup @@ -11407,7 +12590,7 @@
    Apps
    Platform
    diff --git a/include/tgbot/bot.h b/include/tgbot/bot.h index cd01924..8c11db3 100644 --- a/include/tgbot/bot.h +++ b/include/tgbot/bot.h @@ -202,6 +202,9 @@ struct api { return p; } else if constexpr (is_instance::value) { return from_json(j); + } else if constexpr (is_instance::value) { + throw std::logic_error{"no implemented"}; + //return std::visit([&](auto &&r) { return from_json>(r); }, j); } else if constexpr (is_simple_type) { return j; } else if constexpr (requires { refl::is_received_variant; requires refl::is_received_variant; }) { diff --git a/sw.cpp b/sw.cpp index 24d353e..ed4d4c2 100644 --- a/sw.cpp +++ b/sw.cpp @@ -1,6 +1,6 @@ void build(Solution &s) { - auto &tgbot = s.addLibrary("tgbot", "1.1.5.6.9"); + auto &tgbot = s.addLibrary("tgbot", "1.1.5.7.0"); tgbot += Git("https://github.com/egorpugin/tgbot"); auto &apitool = tgbot.addExecutable("apitool");