Skip to content

Commit

Permalink
Update Bot API to 7.9.
Browse files Browse the repository at this point in the history
  • Loading branch information
egorpugin committed Aug 14, 2024
1 parent e550f9a commit 2be0188
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 26 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ C++ library for [Telegram Bot API](https://core.telegram.org/bots/api) with gene

Features:

* Bot API v7.8
* Bot API v7.9
* Generated API structures and methods. No manual typing errors. Easily updatable for API changes.
* C++23
* Header only
Expand Down
150 changes: 126 additions & 24 deletions TelegramBotAPI.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<link rel="alternate icon" href="/img/favicon.ico" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">

<link href="/css/telegram.css?239" rel="stylesheet" media="screen">
<link href="/css/telegram.css?240" rel="stylesheet" media="screen">
<style>
</style>
</head>
Expand Down Expand Up @@ -53,6 +53,18 @@ <h3><a class="anchor" name="recent-changes" href="#recent-changes"><i class="anc
<blockquote>
<p>Subscribe to <a href="https://t.me/botnews">@BotNews</a> to be the first to know about the latest updates and join the discussion in <a href="https://t.me/bottalk">@BotTalk</a></p>
</blockquote>
<h4><a class="anchor" name="august-14-2024" href="#august-14-2024"><i class="anchor-icon"></i></a>August 14, 2024</h4>
<p><strong>Bot API 7.9</strong></p>
<ul>
<li>Added support for <a href="https://telegram.org/blog/superchannels-star-reactions-subscriptions#super-channels">Super Channels</a>, allowing received channel messages to have users or other channels as their senders.</li>
<li>Added the ability to send paid media to any chat.</li>
<li>Added the parameter <em>business_connection_id</em> to the method <a href="#sendpaidmedia">sendPaidMedia</a>, allowing bots to send paid media on behalf of a business account.</li>
<li>Added the field <em>paid_media</em> to the class <a href="#transactionpartneruser">TransactionPartnerUser</a> for transactions involving paid media.</li>
<li>Added the method <a href="#createchatsubscriptioninvitelink">createChatSubscriptionInviteLink</a>, allowing bots to create subscription invite links.</li>
<li>Added the method <a href="#editchatsubscriptioninvitelink">editChatSubscriptionInviteLink</a>, allowing bots to edit the <em>name</em> of subscription invite links.</li>
<li>Added the field <em>until_date</em> to the class <a href="#chatmembermember">ChatMemberMember</a> for members with an active subscription.</li>
<li>Added support for paid reactions and the class <a href="#reactiontypepaid">ReactionTypePaid</a>.</li>
</ul>
<h4><a class="anchor" name="july-31-2024" href="#july-31-2024"><i class="anchor-icon"></i></a>July 31, 2024</h4>
<p><strong>Bot API 7.8</strong></p>
<ul>
Expand Down Expand Up @@ -93,21 +105,6 @@ <h4><a class="anchor" name="june-18-2024" href="#june-18-2024"><i class="anchor-
<li>Added the parameter <em>business_connection_id</em> to the methods <a href="#editmessagetext">editMessageText</a>, <a href="#editmessagemedia">editMessageMedia</a>, <a href="#editmessagecaption">editMessageCaption</a>, <a href="#editmessagelivelocation">editMessageLiveLocation</a>, <a href="#stopmessagelivelocation">stopMessageLiveLocation</a> and <a href="#editmessagereplymarkup">editMessageReplyMarkup</a>, allowing the bot to edit business messages.</li>
<li>Added the parameter <em>business_connection_id</em> to the method <a href="#stoppoll">stopPoll</a>, allowing the bot to stop polls it sent on behalf of a business account.</li>
</ul>
<h4><a class="anchor" name="may-28-2024" href="#may-28-2024"><i class="anchor-icon"></i></a>May 28, 2024</h4>
<p><strong>Bot API 7.4</strong></p>
<ul>
<li>Added support for payments in <a href="https://t.me/BotNews/90">Telegram Stars</a> by introducing the new currency “XTR”.</li>
<li>The parameter <em>provider_token</em> of the methods <a href="#sendinvoice">sendInvoice</a> and <a href="#createinvoicelink">createInvoiceLink</a> must be omitted for payments in <a href="https://t.me/BotNews/90">Telegram Stars</a>.</li>
<li>The field <em>provider_token</em> in the class <a href="#inputinvoicemessagecontent">InputInvoiceMessageContent</a> must be omitted for payments in <a href="https://t.me/BotNews/90">Telegram Stars</a>.</li>
<li>Added the method <a href="#refundstarpayment">refundStarPayment</a>.</li>
<li>Added the field <em>effect_id</em> to the class <a href="#message">Message</a>.</li>
<li>Added the parameter <em>message_effect_id</em> to the methods <a href="#sendmessage">sendMessage</a>, <a href="#sendphoto">sendPhoto</a>, <a href="#sendvideo">sendVideo</a>, <a href="#sendanimation">sendAnimation</a>, <a href="#sendaudio">sendAudio</a>, <a href="#senddocument">sendDocument</a>, <a href="#sendsticker">sendSticker</a>, <a href="#sendvideonote">sendVideoNote</a>, <a href="#sendvoice">sendVoice</a>, <a href="#sendlocation">sendLocation</a>, <a href="#sendvenue">sendVenue</a>, <a href="#sendcontact">sendContact</a>, <a href="#sendpoll">sendPoll</a>, <a href="#senddice">sendDice</a>, <a href="#sendinvoice">sendInvoice</a>, <a href="#sendgame">sendGame</a>, and <a href="#sendmediagroup">sendMediaGroup</a>.</li>
<li>Added the field <em>show_caption_above_media</em> to the classes <a href="#message">Message</a>, <a href="#inputmediaanimation">InputMediaAnimation</a>, <a href="#inputmediaphoto">InputMediaPhoto</a>, <a href="#inputmediavideo">InputMediaVideo</a>, <a href="#inlinequeryresultgif">InlineQueryResultGif</a>, <a href="#inlinequeryresultmpeg4gif">InlineQueryResultMpeg4Gif</a>, <a href="#inlinequeryresultphoto">InlineQueryResultPhoto</a>, <a href="#inlinequeryresultvideo">InlineQueryResultVideo</a>, <a href="#inlinequeryresultcachedgif">InlineQueryResultCachedGif</a>, <a href="#inlinequeryresultcachedmpeg4gif">InlineQueryResultCachedMpeg4Gif</a>, <a href="#inlinequeryresultcachedphoto">InlineQueryResultCachedPhoto</a>, and <a href="#inlinequeryresultcachedvideo">InlineQueryResultCachedVideo</a>.</li>
<li>Added the parameter <em>show_caption_above_media</em> to the methods <a href="#sendanimation">sendAnimation</a>, <a href="#sendphoto">sendPhoto</a>, <a href="#sendvideo">sendVideo</a>, <a href="#copymessage">copyMessage</a>, and <a href="#editmessagecaption">editMessageCaption</a>.</li>
<li>Added support for “expandable_blockquote” entities in received messages.</li>
<li>Added support for “expandable_blockquote” entity parsing in “MarkdownV2” and “HTML” parse modes.</li>
<li>Allowed to explicitly specify “expandable_blockquote” entities in formatted texts.</li>
</ul>
<p><strong><a href="/bots/api-changelog">See earlier changes »</a></strong></p>
<h3><a class="anchor" name="authorizing-your-bot" href="#authorizing-your-bot"><i class="anchor-icon"></i></a>Authorizing your bot</h3>
<p>Each bot is given a unique authentication token <a href="/bots/features#botfather">when it is created</a>. The token looks something like <code>123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11</code>, but we&#39;ll use simply <strong>&lt;token&gt;</strong> in this document instead. You can learn about obtaining tokens and generating new ones in <a href="/bots/features#botfather">this document</a>.</p>
Expand Down Expand Up @@ -847,12 +844,12 @@ <h4><a class="anchor" name="message" href="#message"><i class="anchor-icon"></i>
<tr>
<td>from</td>
<td><a href="#user">User</a></td>
<td><em>Optional</em>. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.</td>
<td><em>Optional</em>. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats</td>
</tr>
<tr>
<td>sender_chat</td>
<td><a href="#chat">Chat</a></td>
<td><em>Optional</em>. 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 <em>from</em> contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.</td>
<td><em>Optional</em>. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel&#39;s discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field <em>from</em> contains a fake sender user in non-channel chats.</td>
</tr>
<tr>
<td>sender_boost_count</td>
Expand Down Expand Up @@ -4241,6 +4238,11 @@ <h4><a class="anchor" name="chatmembermember" href="#chatmembermember"><i class=
<td><a href="#user">User</a></td>
<td>Information about the user</td>
</tr>
<tr>
<td>until_date</td>
<td>Integer</td>
<td><em>Optional</em>. Date when the user&#39;s subscription will expire; Unix time</td>
</tr>
</tbody>
</table>
<h4><a class="anchor" name="chatmemberrestricted" href="#chatmemberrestricted"><i class="anchor-icon"></i></a>ChatMemberRestricted</h4>
Expand Down Expand Up @@ -4676,6 +4678,7 @@ <h4><a class="anchor" name="reactiontype" href="#reactiontype"><i class="anchor-
<ul>
<li><a href="#reactiontypeemoji">ReactionTypeEmoji</a></li>
<li><a href="#reactiontypecustomemoji">ReactionTypeCustomEmoji</a></li>
<li><a href="#reactiontypepaid">ReactionTypePaid</a></li>
</ul>
<h4><a class="anchor" name="reactiontypeemoji" href="#reactiontypeemoji"><i class="anchor-icon"></i></a>ReactionTypeEmoji</h4>
<p>The reaction is based on an emoji.</p>
Expand Down Expand Up @@ -4723,6 +4726,24 @@ <h4><a class="anchor" name="reactiontypecustomemoji" href="#reactiontypecustomem
</tr>
</tbody>
</table>
<h4><a class="anchor" name="reactiontypepaid" href="#reactiontypepaid"><i class="anchor-icon"></i></a>ReactionTypePaid</h4>
<p>The reaction is paid.</p>
<table class="table">
<thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>type</td>
<td>String</td>
<td>Type of the reaction, always “paid”</td>
</tr>
</tbody>
</table>
<h4><a class="anchor" name="reactioncount" href="#reactioncount"><i class="anchor-icon"></i></a>ReactionCount</h4>
<p>Represents a reaction added to a message along with the number of times it was added.</p>
<table class="table">
Expand Down Expand Up @@ -7104,7 +7125,7 @@ <h4><a class="anchor" name="sendvideonote" href="#sendvideonote"><i class="ancho
</tbody>
</table>
<h4><a class="anchor" name="sendpaidmedia" href="#sendpaidmedia"><i class="anchor-icon"></i></a>sendPaidMedia</h4>
<p>Use this method to send paid media to channel chats. On success, the sent <a href="#message">Message</a> is returned.</p>
<p>Use this method to send paid media. On success, the sent <a href="#message">Message</a> is returned.</p>
<table class="table">
<thead>
<tr>
Expand All @@ -7116,10 +7137,16 @@ <h4><a class="anchor" name="sendpaidmedia" href="#sendpaidmedia"><i class="ancho
</thead>
<tbody>
<tr>
<td>business_connection_id</td>
<td>String</td>
<td>Optional</td>
<td>Unique identifier of the business connection on behalf of which the message will be sent</td>
</tr>
<tr>
<td>chat_id</td>
<td>Integer or String</td>
<td>Yes</td>
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat&#39;s balance. Otherwise, they will be credited to the bot&#39;s balance.</td>
</tr>
<tr>
<td>star_count</td>
Expand Down Expand Up @@ -7796,7 +7823,7 @@ <h4><a class="anchor" name="sendchataction" href="#sendchataction"><i class="anc
</tbody>
</table>
<h4><a class="anchor" name="setmessagereaction" href="#setmessagereaction"><i class="anchor-icon"></i></a>setMessageReaction</h4>
<p>Use this method to change the chosen reactions on a message. Service messages can&#39;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 <em>True</em> on success.</p>
<p>Use this method to change the chosen reactions on a message. Service messages can&#39;t be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can&#39;t use paid reactions. Returns <em>True</em> on success.</p>
<table class="table">
<thead>
<tr>
Expand All @@ -7823,7 +7850,7 @@ <h4><a class="anchor" name="setmessagereaction" href="#setmessagereaction"><i cl
<td>reaction</td>
<td>Array of <a href="#reactiontype">ReactionType</a></td>
<td>Optional</td>
<td>A JSON-serialized 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.</td>
<td>A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can&#39;t be used by bots.</td>
</tr>
<tr>
<td>is_big</td>
Expand Down Expand Up @@ -8349,6 +8376,76 @@ <h4><a class="anchor" name="editchatinvitelink" href="#editchatinvitelink"><i cl
</tr>
</tbody>
</table>
<h4><a class="anchor" name="createchatsubscriptioninvitelink" href="#createchatsubscriptioninvitelink"><i class="anchor-icon"></i></a>createChatSubscriptionInviteLink</h4>
<p>Use this method to create a <a href="https://telegram.org/blog/superchannels-star-reactions-subscriptions#star-subscriptions">subscription invite link</a> for a channel chat. The bot must have the <em>can_invite_users</em> administrator rights. The link can be edited using the method <a href="#editchatsubscriptioninvitelink">editChatSubscriptionInviteLink</a> or revoked using the method <a href="#revokechatinvitelink">revokeChatInviteLink</a>. Returns the new invite link as a <a href="#chatinvitelink">ChatInviteLink</a> object.</p>
<table class="table">
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>chat_id</td>
<td>Integer or String</td>
<td>Yes</td>
<td>Unique identifier for the target channel chat or username of the target channel (in the format <code>@channelusername</code>)</td>
</tr>
<tr>
<td>name</td>
<td>String</td>
<td>Optional</td>
<td>Invite link name; 0-32 characters</td>
</tr>
<tr>
<td>subscription_period</td>
<td>Integer</td>
<td>Yes</td>
<td>The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days).</td>
</tr>
<tr>
<td>subscription_price</td>
<td>Integer</td>
<td>Yes</td>
<td>The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500</td>
</tr>
</tbody>
</table>
<h4><a class="anchor" name="editchatsubscriptioninvitelink" href="#editchatsubscriptioninvitelink"><i class="anchor-icon"></i></a>editChatSubscriptionInviteLink</h4>
<p>Use this method to edit a subscription invite link created by the bot. The bot must have the <em>can_invite_users</em> administrator rights. Returns the edited invite link as a <a href="#chatinvitelink">ChatInviteLink</a> object.</p>
<table class="table">
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>chat_id</td>
<td>Integer or String</td>
<td>Yes</td>
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
</tr>
<tr>
<td>invite_link</td>
<td>String</td>
<td>Yes</td>
<td>The invite link to edit</td>
</tr>
<tr>
<td>name</td>
<td>String</td>
<td>Optional</td>
<td>Invite link name; 0-32 characters</td>
</tr>
</tbody>
</table>
<h4><a class="anchor" name="revokechatinvitelink" href="#revokechatinvitelink"><i class="anchor-icon"></i></a>revokeChatInviteLink</h4>
<p>Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as <a href="#chatinvitelink">ChatInviteLink</a> object.</p>
<table class="table">
Expand Down Expand Up @@ -8808,7 +8905,7 @@ <h4><a class="anchor" name="createforumtopic" href="#createforumtopic"><i class=
</tbody>
</table>
<h4><a class="anchor" name="editforumtopic" href="#editforumtopic"><i class="anchor-icon"></i></a>editForumTopic</h4>
<p>Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have <em>can_manage_topics</em> administrator rights, unless it is the creator of the topic. Returns <em>True</em> on success.</p>
<p>Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights, unless it is the creator of the topic. Returns <em>True</em> on success.</p>
<table class="table">
<thead>
<tr>
Expand Down Expand Up @@ -8950,7 +9047,7 @@ <h4><a class="anchor" name="unpinallforumtopicmessages" href="#unpinallforumtopi
</tbody>
</table>
<h4><a class="anchor" name="editgeneralforumtopic" href="#editgeneralforumtopic"><i class="anchor-icon"></i></a>editGeneralForumTopic</h4>
<p>Use this method to edit the name of the &#39;General&#39; topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have <em>can_manage_topics</em> administrator rights. Returns <em>True</em> on success.</p>
<p>Use this method to edit the name of the &#39;General&#39; topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. Returns <em>True</em> on success.</p>
<table class="table">
<thead>
<tr>
Expand Down Expand Up @@ -13406,6 +13503,11 @@ <h4><a class="anchor" name="transactionpartneruser" href="#transactionpartneruse
<td>String</td>
<td><em>Optional</em>. Bot-specified invoice payload</td>
</tr>
<tr>
<td>paid_media</td>
<td>Array of <a href="#paidmedia">PaidMedia</a></td>
<td><em>Optional</em>. Information about the paid media bought by the user</td>
</tr>
</tbody>
</table>
<h4><a class="anchor" name="transactionpartnerfragment" href="#transactionpartnerfragment"><i class="anchor-icon"></i></a>TransactionPartnerFragment</h4>
Expand Down
2 changes: 1 addition & 1 deletion sw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

void build(Solution &s)
{
auto &tgbot = s.addLibrary("tgbot", "1.1.7.7.8");
auto &tgbot = s.addLibrary("tgbot", "1.1.7.7.9");
tgbot += Git("https://github.com/egorpugin/tgbot");

auto &apitool = tgbot.addExecutable("apitool");
Expand Down

0 comments on commit 2be0188

Please sign in to comment.