From 1ef70bba0dd2ae221aab0d6a0420dfbd59bc7767 Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Sat, 17 Feb 2024 15:06:01 +0300 Subject: [PATCH] Update Bot API to 7.1. --- TelegramBotAPI.html | 254 +++++++++++++++++++++++++++----------------- sw.cpp | 2 +- 2 files changed, 156 insertions(+), 100 deletions(-) diff --git a/TelegramBotAPI.html b/TelegramBotAPI.html index e019161..3527d36 100644 --- a/TelegramBotAPI.html +++ b/TelegramBotAPI.html @@ -53,6 +53,17 @@

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

+

February 16, 2024

+

Bot API 7.1

+
    +
  • Added support for the administrator rights can_post_stories, can_edit_stories, can_delete_stories in supergroups.
  • +
  • Added the class ChatBoostAdded and the field boost_added to the class Message for service messages about a user boosting a chat.
  • +
  • Added the field sender_boost_count to the class Message.
  • +
  • Added the field reply_to_story to the class Message.
  • +
  • Added the fields chat and id to the class Story.
  • +
  • Added the field unrestrict_boost_count to the class Chat.
  • +
  • Added the field custom_emoji_sticker_set_name to the class Chat.
  • +

December 29, 2023

Bot API 7.0

Reactions

@@ -138,15 +149,6 @@

Added the fields from_request and from_attachment_menu to the class WriteAccessAllowed.
  • Added the fields added_to_attachment_menu and allows_write_to_pm to the class WebAppUser.
  • -

    August 18, 2023

    -

    Bot API 6.8

    -
      -
    • Added the field story to the class Message for messages with forwarded stories. Currently, it holds no information.
    • -
    • Added the field voter_chat to the class PollAnswer, to contain channel chat voters in Polls. For backward compatibility, the field user in such objects will contain the user 136817688 (@Channel_Bot).
    • -
    • Added the field emoji_status_expiration_date to the class Chat.
    • -
    • Added the method unpinAllGeneralForumTopicMessages.
    • -
    • Increased to 512 characters the maximum length of the startapp parameter in direct Web App links.
    • -

    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.

    @@ -201,7 +203,7 @@

    update_id Integer -The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially. +The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This identifier becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially. message @@ -211,7 +213,7 @@

    edited_message Message -Optional. New version of a message that is known to the bot and was edited +Optional. New version of a message that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot. channel_post @@ -221,7 +223,7 @@

    edited_channel_post Message -Optional. New version of a channel post that is known to the bot and was edited +Optional. New version of a channel post that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot. message_reaction @@ -231,7 +233,7 @@

    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. +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. The updates are grouped and can be sent with delay up to a few minutes. inline_query @@ -261,7 +263,7 @@

    poll Poll -Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot +Optional. New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot poll_answer @@ -690,7 +692,12 @@

    Ch slow_mode_delay Integer -Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat. +Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in getChat. + + +unrestrict_boost_count +Integer +Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in getChat. message_auto_delete_time @@ -728,6 +735,11 @@

    Ch Optional. True, if the bot can change the group sticker set. Returned only in getChat. +custom_emoji_sticker_set_name +String +Optional. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. Returned only in getChat. + + linked_chat_id Integer Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat. @@ -771,6 +783,11 @@

    Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. +sender_boost_count +Integer +Optional. If the sender of the message boosted the chat, the number of boosts added by the user + + date Integer Date the message was sent in Unix time. It is always a positive number, representing a valid date. @@ -811,6 +828,11 @@

    Optional. For replies that quote part of the original message, the quoted part of the message +reply_to_story +Story +Optional. For replies to a story, the original story + + via_bot User Optional. Bot through which the message was sent @@ -1041,6 +1063,11 @@

    Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. +boost_added +ChatBoostAdded +Optional. Service message: user boosted the chat + + forum_topic_created ForumTopicCreated Optional. Service message: forum topic created @@ -1764,7 +1791,28 @@

    Story

    -

    This object represents a message about a forwarded story in the chat. Currently holds no information.

    +

    This object represents a story.

    + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    chatChatChat that posted the story
    idIntegerUnique identifier for the story in the chat

    Video

    This object represents a video file.

    @@ -2122,7 +2170,7 @@

    - + @@ -2259,6 +2307,24 @@

    ChatBoostAdded

    +

    This object represents a service message about a user boosting a chat.

    +
    horizontal_accuracyFloat numberFloat Optional. The radius of uncertainty for the location, measured in meters; 0-1500
    + + + + + + + + + + + + + + +
    FieldTypeDescription
    boost_countIntegerNumber of boosts added by the user

    ForumTopicCreated

    This object represents a service message about a new forum topic created in the chat.

    @@ -2522,7 +2588,7 @@

    - + - + @@ -2753,12 +2819,12 @@

    - +
    prefer_small_media BooleanOptional. 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 previewOptional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
    prefer_large_media BooleanOptional. 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 previewOptional. True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
    show_above_textselective BooleanOptional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.

    Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard.
    Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.

    Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard.

    KeyboardButton

    -

    This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_user, request_chat, request_contact, request_location, and request_poll are mutually exclusive.

    +

    This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive.

    @@ -2805,7 +2871,7 @@

    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 »

    @@ -2929,7 +2995,7 @@

    - +
    selective BooleanOptional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.

    Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet.
    Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.

    Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet.
    @@ -2951,7 +3017,6 @@

    < -

    Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.

    InlineKeyboardButton

    This object represents one button of an inline keyboard. You must use exactly one of the optional fields.

    @@ -2971,7 +3036,7 @@

    <

    - + @@ -3169,7 +3234,7 @@

    Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. +

    url StringOptional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings.Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.
    callback_dataOptional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.
    @@ -3291,7 +3356,7 @@

    boost ChatBoost -Infomation about the chat boost +Information about the chat boost @@ -5073,7 +5138,7 @@

    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.
    - 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:

    +

    Links tg://user?id=<user_id> can be used to mention a user by their identifier 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.
    • @@ -5099,7 +5164,9 @@
      +>The last line of the block quotation** +>The second block quotation started right after the previous\r +>The third block quotation started right after the previous

      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.
      • @@ -6101,19 +6168,19 @@

        latitude -Float number +Float Yes Latitude of the venue longitude -Float number +Float Yes Longitude of the venue @@ -6548,7 +6615,7 @@

        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.

        +

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

        @@ -6569,7 +6636,7 @@

        message_id

        - + @@ -6786,7 +6853,7 @@

        can_manage_chat

        - + @@ -6825,40 +6892,40 @@

        Pass True if the administrator can invite new users to the chat

        - + - + - + - + - + - + - + - + - + - + - + - + @@ -8401,19 +8468,19 @@

        InlineQueryResultVoice

        Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message.

        Integer YesIdentifier of the target messageIdentifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead.
        reactionBoolean OptionalPass 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 privilegePass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege.
        can_delete_messages
        can_post_messagescan_post_stories Boolean OptionalPass True if the administrator can post messages in the channel, or access channel statistics; channels onlyPass True if the administrator can post stories to the chat
        can_edit_messagescan_edit_stories Boolean OptionalPass True if the administrator can edit messages of other users and can pin messages; channels onlyPass True if the administrator can edit stories posted by other users
        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
        can_post_storiescan_post_messages Boolean OptionalPass True if the administrator can post stories in the channel; channels onlyPass True if the administrator can post messages in the channel, or access channel statistics; channels only
        can_edit_storiescan_edit_messages Boolean OptionalPass True if the administrator can edit stories posted by other users; channels onlyPass True if the administrator can edit messages of other users and can pin messages; channels only
        can_delete_storiescan_pin_messages Boolean OptionalPass True if the administrator can delete stories posted by other users; channels onlyPass True if the administrator can pin messages, supergroups only
        can_manage_topics
        @@ -9935,7 +10001,6 @@

        InlineQueryResultDocument

        Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.

        @@ -10019,7 +10084,6 @@

        InlineQueryResultLocation

        Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.

        @@ -10043,12 +10107,12 @@

        InlineQueryResultVenue

        Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.

        @@ -10192,7 +10255,6 @@

        InlineQueryResultContact

        Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.

        @@ -10261,7 +10323,6 @@

        InlineQueryResultGame

        Represents a Game.

        @@ -10295,7 +10356,6 @@

        -

        Note: This will only work in Telegram versions released after October 1, 2016. Older clients will not display any inline results if a game result is among them.

        InlineQueryResultCachedPhoto

        Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.

        @@ -10513,7 +10573,6 @@

        animated stickers. Older clients will ignore them.

        InlineQueryResultCachedDocument

        Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.

        @@ -10577,7 +10636,6 @@

        InlineQueryResultCachedVideo

        Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.

        @@ -10699,7 +10757,6 @@

        InlineQueryResultCachedAudio

        Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

        @@ -10753,7 +10810,6 @@

        InputMessageContent

        This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 5 types:

          @@ -10819,7 +10875,7 @@

        Payments

        -

        Your bot can accept payments from Telegram users. Please see the introduction to payments for more details on the process and how to set up payments for your bot. Please note that users will need Telegram v.4.0 or higher to use payments (released on May 18, 2017).

        +

        Your bot can accept payments from Telegram users. Please see the introduction to payments for more details on the process and how to set up payments for your bot.

        sendInvoice

        Use this method to send invoices. On success, the sent Message is returned.

        diff --git a/sw.cpp b/sw.cpp index ed4d4c2..3272fd0 100644 --- a/sw.cpp +++ b/sw.cpp @@ -1,6 +1,6 @@ void build(Solution &s) { - auto &tgbot = s.addLibrary("tgbot", "1.1.5.7.0"); + auto &tgbot = s.addLibrary("tgbot", "1.1.5.7.1"); tgbot += Git("https://github.com/egorpugin/tgbot"); auto &apitool = tgbot.addExecutable("apitool");