diff --git a/data/web/blogfork.telegram.org/constructor/messageEntityUrl.html b/data/web/blogfork.telegram.org/constructor/messageEntityUrl.html index 772e0ed0cf..00815a1211 100644 --- a/data/web/blogfork.telegram.org/constructor/messageEntityUrl.html +++ b/data/web/blogfork.telegram.org/constructor/messageEntityUrl.html @@ -85,7 +85,7 @@ <p>How to create styled text with message entities</p> <h4><a class="anchor" href="#messageentitytexturl" id="messageentitytexturl" name="messageentitytexturl"><i class="anchor-icon"></i></a><a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a></h4> <p>Message entity representing a <a href="https://google.com">text url</a>: for in-text urls like <a href="https://google.com">https://google.com</a> use <a href="/constructor/messageEntityUrl">messageEntityUrl</a>.</p> -<p>Note that an additional confirmation popup with the full URL must be displayed to the user before opening this link, unless the domain is one of the whitelisted domains specified in the <a href="/api/config#whitelisted-domains"><code>whitelisted_domains</code> client configuration parameter »</a>.</p></div> +<p>Note that an additional confirmation popup with the full URL must be displayed to the user before opening this link, unless the domain satisfies the conditions specified in the <a href="/api/config#whitelisted-domains">domain whitelist documentation »</a>.</p></div> </div> diff --git a/data/web/core.telegram.org/constructor/messageEntityUrl.html b/data/web/core.telegram.org/constructor/messageEntityUrl.html index 772e0ed0cf..00815a1211 100644 --- a/data/web/core.telegram.org/constructor/messageEntityUrl.html +++ b/data/web/core.telegram.org/constructor/messageEntityUrl.html @@ -85,7 +85,7 @@ <p>How to create styled text with message entities</p> <h4><a class="anchor" href="#messageentitytexturl" id="messageentitytexturl" name="messageentitytexturl"><i class="anchor-icon"></i></a><a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a></h4> <p>Message entity representing a <a href="https://google.com">text url</a>: for in-text urls like <a href="https://google.com">https://google.com</a> use <a href="/constructor/messageEntityUrl">messageEntityUrl</a>.</p> -<p>Note that an additional confirmation popup with the full URL must be displayed to the user before opening this link, unless the domain is one of the whitelisted domains specified in the <a href="/api/config#whitelisted-domains"><code>whitelisted_domains</code> client configuration parameter »</a>.</p></div> +<p>Note that an additional confirmation popup with the full URL must be displayed to the user before opening this link, unless the domain satisfies the conditions specified in the <a href="/api/config#whitelisted-domains">domain whitelist documentation »</a>.</p></div> </div> diff --git a/data/web/corefork.telegram.org/api/links.html b/data/web/corefork.telegram.org/api/links.html index 55a329925c..c7c5b27b4e 100644 --- a/data/web/corefork.telegram.org/api/links.html +++ b/data/web/corefork.telegram.org/api/links.html @@ -58,7 +58,7 @@ <li><code>tg:path?query</code></li> <li><code>tg://path?query</code></li> </ul> -<p>The <code>#fragment</code> part is always ignored when parsing Telegram deep links. </p> +<p>The <code>#fragment</code> part is always ignored. </p> <p>Also note that whenever a <code><username>.t.me</code> link is encountered and <code><username></code> is not equal to <code>www</code>, is not a single letter and is a valid username, it should be treated exactly as a <code>t.me/<username>/</code> link (generate a <code>t.me/<username>/</code> link and append the rest of the path (if present) and the query string (if present)). </p> <h3><a class="anchor" href="#public-username-links" id="public-username-links" name="public-username-links"><i class="anchor-icon"></i></a>Public username links</h3> <p>Used to link to public users, groups and channels, see <a href="/api/invites#public-usernames">here for more info on how to handle them »</a>. </p> @@ -189,9 +189,9 @@ t.me/<username>/<id>?single&thread=<thread_id>&comment <pre><code>t.me/c/<channel>/<id>?single&thread=<thread_id>&comment=<message_id>&t=<media_timestamp> t.me/c/<channel>/<thread_id>/<id>?single&comment=<message_id>&t=<media_timestamp></code></pre> <p><code>tg:</code> syntax (public links):</p> -<pre><code>tg://resolve?domain=<username>&post=<id>&single&thread=<thread_id>&comment=<comment>&t=<media_timestamp></code></pre> +<pre><code>tg://resolve?domain=<username>&post=<id>&single&thread=<thread>&comment=<comment>&t=<media_timestamp></code></pre> <p><code>tg:</code> syntax (private links):</p> -<pre><code>tg://privatepost?channel=<channelid>&post=<id>&single&thread=<thread_id>&comment=<comment>&t=<media_timestamp></code></pre> +<pre><code>tg://privatepost?channel=<channelid>&post=<id>&single&thread=<thread>&comment=<comment>&t=<media_timestamp></code></pre> <p>Parameters:</p> <table class="table"> <thead> @@ -223,7 +223,7 @@ t.me/c/<channel>/<thread_id>/<id>?single&comment=<messa <td>For albums/grouped media, if set indicates that this is a link to a specific media in the album; otherwise, it is a link to the entire album.</td> </tr> <tr> -<td><code>thread_id</code></td> +<td><code>thread</code></td> <td style="text-align: center;">Optional</td> <td>For <a href="/api/threads">message threads</a>, contains the thread ID.</td> </tr> @@ -1224,27 +1224,6 @@ tg://resolve?domain=<bot_username>&startattach=<start_parameter> </tr> </tbody> </table> -<h3><a class="anchor" href="#emoji-links" id="emoji-links" name="emoji-links"><i class="anchor-icon"></i></a>Emoji links</h3> -<p>Emoji links are merely an abstraction offered by the <a href="/bots/api">bot API</a> to simplify construction of <a href="/constructor/messageEntityCustomEmoji">messageEntityCustomEmoji</a> constructors, and should be ignored by normal clients. </p> -<p><code>tg:</code> syntax:</p> -<pre><code>tg://emoji?id=<id></code></pre> -<p>Parameters:</p> -<table class="table"> -<thead> -<tr> -<th>Name</th> -<th style="text-align: center;">Optional</th> -<th>Description</th> -</tr> -</thead> -<tbody> -<tr> -<td><code>id</code></td> -<td style="text-align: center;">Required</td> -<td><a href="/api/custom-emoji">Custom emoji ID</a></td> -</tr> -</tbody> -</table> <h3><a class="anchor" href="#unsupported-links" id="unsupported-links" name="unsupported-links"><i class="anchor-icon"></i></a>Unsupported links</h3> <p>If a client encounters a <code>tg:</code> link type not listed on this page, <a href="/method/help.getDeepLinkInfo">help.getDeepLinkInfo</a> should be invoked with just the <code>path</code> component of the link. </p> <p>Schema:</p> diff --git a/data/web/corefork.telegram.org/bots/api-changelog.html b/data/web/corefork.telegram.org/bots/api-changelog.html index 7dc431f077..cbc813cf18 100644 --- a/data/web/corefork.telegram.org/bots/api-changelog.html +++ b/data/web/corefork.telegram.org/bots/api-changelog.html @@ -47,16 +47,15 @@ To learn how to create…"> <div id="dev_page_content"><!-- scroll_nav --> <blockquote> -<p>The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram. -To learn how to create and set up a bot, please consult our <a href="https://core.telegram.org/bots"><strong>Introduction to Bots »</strong></a></p> +<p>The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.<br>To learn how to create and set up a bot, please consult our <a href="https://core.telegram.org/bots"><strong>Introduction to Bots »</strong></a></p> </blockquote> <p>You will find all changes to our <a href="/bots/api"><strong>Bot API</strong></a> on this page.</p> -<h3><a class="anchor" href="#recent-changes" id="recent-changes" name="recent-changes"><i class="anchor-icon"></i></a>Recent changes</h3> +<h3><a class="anchor" name="recent-changes" href="#recent-changes"><i class="anchor-icon"></i></a>Recent changes</h3> <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> -<h3><a class="anchor" href="#2023" id="2023" name="2023"><i class="anchor-icon"></i></a>2023</h3> -<h4><a class="anchor" href="#april-21-2023" id="april-21-2023" name="april-21-2023"><i class="anchor-icon"></i></a>April 21, 2023</h4> +<h3><a class="anchor" name="2023" href="#2023"><i class="anchor-icon"></i></a>2023</h3> +<h4><a class="anchor" name="april-21-2023" href="#april-21-2023"><i class="anchor-icon"></i></a>April 21, 2023</h4> <p><strong>Bot API 6.7</strong></p> <ul> <li>Added support for launching <a href="/bots/webapps">Web Apps</a> from inline query results by replacing the parameters <em>switch_pm_text</em> and <em>switch_pm_parameter</em> of the method <a href="/bots/api#answerinlinequery">answerInlineQuery</a> with the parameter <em>button</em> of type <a href="/bots/api#inlinequeryresultsbutton">InlineQueryResultsButton</a>.</li> @@ -65,10 +64,10 @@ To learn how to create and set up a bot, please consult our <a href="https://cor <li>Added the field <em>via_chat_folder_invite_link</em> to the class <a href="/bots/api#chatmemberupdated">ChatMemberUpdated</a>.</li> <li>Added the ability to set different bot names for different user languages using the method <a href="/bots/api#setmyname">setMyName</a>.</li> <li>Added the ability to get the current bot name in the given language as the class <a href="/bots/api#botname">BotName</a> using the method <a href="/bots/api#getmyname">getMyName</a>.</li> -<li>Added the ability to change bot settings from the bot's profile in official Telegram apps, including the ability to set animated profile photos.</li> +<li>Added the ability to change bot settings from the bot's profile in official Telegram apps, including the ability to set animated profile photos.</li> <li>Added the ability to specify custom emoji entities using <a href="/bots/api#html-style">HTML</a> and <a href="/bots/api#markdownv2-style">MarkdownV2</a> formatting options for bots that purchased additional usernames on <a href="https://fragment.com">Fragment</a>.</li> </ul> -<h4><a class="anchor" href="#march-9-2023" id="march-9-2023" name="march-9-2023"><i class="anchor-icon"></i></a>March 9, 2023</h4> +<h4><a class="anchor" name="march-9-2023" href="#march-9-2023"><i class="anchor-icon"></i></a>March 9, 2023</h4> <p><strong>Bot API 6.6</strong></p> <ul> <li>Added the ability to set different bot descriptions for different user languages using the method <a href="/bots/api#setmydescription">setMyDescription</a>.</li> @@ -97,7 +96,7 @@ To learn how to create and set up a bot, please consult our <a href="https://cor <li>Renamed the field <em>thumb_url</em> in the classes <a href="/bots/api#inlinequeryresultphoto">InlineQueryResultPhoto</a> and <a href="/bots/api#inlinequeryresultvideo">InlineQueryResultVideo</a> to <em>thumbnail_url</em>.</li> <li>Renamed the fields <em>thumb_url</em> and <em>thumb_mime_type</em> in the classes <a href="/bots/api#inlinequeryresultgif">InlineQueryResultGif</a>, and <a href="/bots/api#inlinequeryresultmpeg4gif">InlineQueryResultMpeg4Gif</a> to <em>thumbnail_url</em> and <em>thumbnail_mime_type</em> respectively.</li> </ul> -<h4><a class="anchor" href="#february-3-2023" id="february-3-2023" name="february-3-2023"><i class="anchor-icon"></i></a>February 3, 2023</h4> +<h4><a class="anchor" name="february-3-2023" href="#february-3-2023"><i class="anchor-icon"></i></a>February 3, 2023</h4> <p><strong>Bot API 6.5</strong></p> <ul> <li>Added <a href="https://telegram.org/blog/profile-pics-emoji-translations#chat-selection-for-bots">requests for users and chats</a> and support for <a href="https://telegram.org/blog/profile-pics-emoji-translations#granular-media-permissions">granular media permissions</a>.</li> @@ -108,8 +107,8 @@ To learn how to create and set up a bot, please consult our <a href="https://cor <li>Added the parameter <em>use_independent_chat_permissions</em> to the methods <a href="/bots/api#restrictchatmember">restrictChatMember</a> and <a href="/bots/api#setchatpermissions">setChatPermissions</a>.</li> <li>Added the field <em>user_chat_id</em> to the class <a href="/bots/api#chatjoinrequest">ChatJoinRequest</a>.</li> </ul> -<h3><a class="anchor" href="#2022" id="2022" name="2022"><i class="anchor-icon"></i></a>2022</h3> -<h4><a class="anchor" href="#december-30-2022" id="december-30-2022" name="december-30-2022"><i class="anchor-icon"></i></a>December 30, 2022</h4> +<h3><a class="anchor" name="2022" href="#2022"><i class="anchor-icon"></i></a>2022</h3> +<h4><a class="anchor" name="december-30-2022" href="#december-30-2022"><i class="anchor-icon"></i></a>December 30, 2022</h4> <p><strong>Bot API 6.4</strong></p> <ul> <li>Added the field <em>is_persistent</em> to the class <a href="/bots/api#replykeyboardmarkup">ReplyKeyboardMarkup</a>, allowing to control when the keyboard is shown.</li> @@ -127,13 +126,13 @@ To learn how to create and set up a bot, please consult our <a href="https://cor <li>Added the methods <em>showScanQrPopup</em>, <em>closeScanQrPopup</em>, and <em>readTextFromClipboard</em> to the class <a href="/bots/webapps#initializing-web-apps">WebApp</a>.</li> <li>Added the parameter <em>options</em> to the method <em>openLink</em> of the class <a href="/bots/webapps#initializing-web-apps">WebApp</a>.</li> </ul> -<h4><a class="anchor" href="#november-5-2022" id="november-5-2022" name="november-5-2022"><i class="anchor-icon"></i></a>November 5, 2022</h4> +<h4><a class="anchor" name="november-5-2022" href="#november-5-2022"><i class="anchor-icon"></i></a>November 5, 2022</h4> <p><strong>Bot API 6.3</strong></p> <ul> <li>Added support for <a href="https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups">Topics in Groups</a>.</li> <li>Added the field <em>is_forum</em> to the class <a href="/bots/api#chat">Chat</a>.</li> <li>Added the fields <em>is_topic_message</em> and <em>message_thread_id</em> to the class <a href="/bots/api#message">Message</a> to allow detection of messages belonging to a forum topic and their message thread identifier.</li> -<li>Added the classes <a href="/bots/api#forumtopiccreated">ForumTopicCreated</a>, <a href="/bots/api#forumtopicclosed">ForumTopicClosed</a>, and <a href="/bots/api#forumtopicreopened">ForumTopicReopened</a> and the fields <em>forum_topic_created</em>, <em>forum_topic_closed</em>, and <em>forum_topic_reopened</em> to the class <a href="/bots/api#message">Message</a>. Note that service messages about forum topic creation can't be deleted with the <a href="/bots/api#deletemessage">deleteMessage</a> method.</li> +<li>Added the classes <a href="/bots/api#forumtopiccreated">ForumTopicCreated</a>, <a href="/bots/api#forumtopicclosed">ForumTopicClosed</a>, and <a href="/bots/api#forumtopicreopened">ForumTopicReopened</a> and the fields <em>forum_topic_created</em>, <em>forum_topic_closed</em>, and <em>forum_topic_reopened</em> to the class <a href="/bots/api#message">Message</a>. Note that service messages about forum topic creation can't be deleted with the <a href="/bots/api#deletemessage">deleteMessage</a> method.</li> <li>Added the field <em>can_manage_topics</em> to the classes <a href="/bots/api#chatadministratorrights">ChatAdministratorRights</a>, <a href="/bots/api#chatpermissions">ChatPermissions</a>, <a href="/bots/api#chatmemberadministrator">ChatMemberAdministrator</a>, and <a href="/bots/api#chatmemberrestricted">ChatMemberRestricted</a>.</li> <li>Added the parameter <em>can_manage_topics</em> to the method <a href="/bots/api#promotechatmember">promoteChatMember</a>.</li> <li>Added the methods <a href="/bots/api#createforumtopic">createForumTopic</a>, <a href="/bots/api#editforumtopic">editForumTopic</a>, <a href="/bots/api#closeforumtopic">closeForumTopic</a>, <a href="/bots/api#reopenforumtopic">reopenForumTopic</a>, <a href="/bots/api#deleteforumtopic">deleteForumTopic</a>, <a href="/bots/api#unpinallforumtopicmessages">unpinAllForumTopicMessages</a>, and <a href="/bots/api#getforumtopiciconstickers">getForumTopicIconStickers</a> for forum topic management.</li> @@ -141,12 +140,12 @@ To learn how to create and set up a bot, please consult our <a href="https://cor <li>Added support for <a href="https://telegram.org/blog/topics-in-groups-collectible-usernames#collectible-usernames">Multiple Usernames</a> via the field <em>active_usernames</em> in the class <a href="/bots/api#chat">Chat</a>.</li> <li>Added the field <em>emoji_status_custom_emoji_id</em> to the class <a href="/bots/api#chat">Chat</a>.</li> </ul> -<h4><a class="anchor" href="#august-12-2022" id="august-12-2022" name="august-12-2022"><i class="anchor-icon"></i></a>August 12, 2022</h4> +<h4><a class="anchor" name="august-12-2022" href="#august-12-2022"><i class="anchor-icon"></i></a>August 12, 2022</h4> <p><strong>Bot API 6.2</strong></p> <p><strong>Custom Emoji Support</strong></p> <ul> -<li>Added the <a href="/bots/api#messageentity">MessageEntity</a> type "custom_emoji".</li> -<li>Added the field <em>custom_emoji_id</em> to the class <a href="/bots/api#messageentity">MessageEntity</a> for "custom_emoji" entities.</li> +<li>Added the <a href="/bots/api#messageentity">MessageEntity</a> type “custom_emoji”.</li> +<li>Added the field <em>custom_emoji_id</em> to the class <a href="/bots/api#messageentity">MessageEntity</a> for “custom_emoji” entities.</li> <li>Added the method <a href="/bots/api#getcustomemojistickers">getCustomEmojiStickers</a>.</li> <li>Added the fields <em>type</em> and <em>custom_emoji_id</em> to the class <a href="/bots/api#sticker">Sticker</a>.</li> <li>Added the field <em>sticker_type</em> to the class <a href="/bots/api#stickerset">StickerSet</a>, describing the type of stickers in the set.</li> @@ -164,11 +163,11 @@ To learn how to create and set up a bot, please consult our <a href="https://cor <ul> <li>Added the field <em>has_restricted_voice_and_video_messages</em> to the class <a href="/bots/api#chat">Chat</a> to support the <a href="https://telegram.org/blog/custom-emoji#privacy-settings-for-voice-messages">new setting</a>.</li> </ul> -<h4><a class="anchor" href="#june-20-2022" id="june-20-2022" name="june-20-2022"><i class="anchor-icon"></i></a>June 20, 2022</h4> +<h4><a class="anchor" name="june-20-2022" href="#june-20-2022"><i class="anchor-icon"></i></a>June 20, 2022</h4> <p><strong>Bot API 6.1</strong></p> <p><strong>Media in Descriptions</strong></p> <ul> -<li>Added support for photos and videos in the 'What can this bot do?' section (shown on the bot's start screen). Use <a href="https://t.me/BotFather">BotFather</a> to set up media.</li> +<li>Added support for photos and videos in the 'What can this bot do?' section (shown on the bot's start screen). Use <a href="https://t.me/BotFather">BotFather</a> to set up media.</li> </ul> <p><strong>Web App Improvements</strong></p> <ul> @@ -181,7 +180,7 @@ To learn how to create and set up a bot, please consult our <a href="https://cor <p><strong>Join Requests & Payments</strong></p> <ul> <li>Added the fields <em>join_to_send_messages</em> and <em>join_by_request</em> to the class <a href="/bots/api#chat">Chat</a>.</li> -<li>Added the ability to process join requests which were created <a href="https://telegram.org/blog/700-million-and-premium#join-requests-for-public-groups">without an invite link</a>. Bots will receive a "chat_join_request" update as usual.</li> +<li>Added the ability to process join requests which were created <a href="https://telegram.org/blog/700-million-and-premium#join-requests-for-public-groups">without an invite link</a>. Bots will receive a “chat_join_request” update as usual.</li> <li>Added the method <a href="/bots/api#createinvoicelink">createInvoiceLink</a> to generate an HTTP link for an invoice.</li> </ul> <p><strong>Telegram Premium Support</strong> (<a href="https://telegram.org/blog/700-million-and-premium#telegram-premium">more info</a>)</p> @@ -201,15 +200,15 @@ To learn how to create and set up a bot, please consult our <a href="https://cor <li>Added the parameter <em>secret_token</em> to the method <a href="/bots/api#setwebhook">setWebhook</a>.</li> <li>As previously announced, only HTTPS links are now allowed in <em>login_url</em> inline keyboard buttons.</li> </ul> -<h4><a class="anchor" href="#april-16-2022" id="april-16-2022" name="april-16-2022"><i class="anchor-icon"></i></a>April 16, 2022</h4> +<h4><a class="anchor" name="april-16-2022" href="#april-16-2022"><i class="anchor-icon"></i></a>April 16, 2022</h4> <p><strong>Bot API 6.0</strong></p> <ul> <li>Added support for <strong>Web Apps</strong>, see the <a href="/bots/webapps">detailed manual here</a>. (<a href="https://telegram.org/blog/notifications-bots">blog announcement</a>)</li> <li>Added the class <a href="/bots/api#webappinfo">WebAppInfo</a> and the fields <em>web_app</em> to the classes <a href="/bots/api#keyboardbutton">KeyboardButton</a> and <a href="/bots/api#inlinekeyboardbutton">InlineKeyboardButton</a>.</li> -<li>Added the class <a href="/bots/api#sentwebappmessage">SentWebAppMessage</a> and the method <a href="/bots/api#answerwebappquery">answerWebAppQuery</a> for sending an answer to a Web App query, which originated from an inline button of the 'web_app' type.</li> +<li>Added the class <a href="/bots/api#sentwebappmessage">SentWebAppMessage</a> and the method <a href="/bots/api#answerwebappquery">answerWebAppQuery</a> for sending an answer to a Web App query, which originated from an inline button of the 'web_app' type.</li> <li>Added the class <a href="/bots/api#webappdata">WebAppData</a> and the field <em>web_app_data</em> to the class <a href="/bots/api#message">Message</a>.</li> -<li>Added the class <a href="/bots/api#menubutton">MenuButton</a> and the methods <a href="/bots/api#setchatmenubutton">setChatMenuButton</a> and <a href="/bots/api#getchatmenubutton">getChatMenuButton</a> for managing the behavior of the bot's menu button in private chats.</li> -<li>Added the class <a href="/bots/api#chatadministratorrights">ChatAdministratorRights</a> and the methods <a href="/bots/api#setmydefaultadministratorrights">setMyDefaultAdministratorRights</a> and <a href="/bots/api#getmydefaultadministratorrights">getMyDefaultAdministratorRights</a> for managing the bot's default administrator rights.</li> +<li>Added the class <a href="/bots/api#menubutton">MenuButton</a> and the methods <a href="/bots/api#setchatmenubutton">setChatMenuButton</a> and <a href="/bots/api#getchatmenubutton">getChatMenuButton</a> for managing the behavior of the bot's menu button in private chats.</li> +<li>Added the class <a href="/bots/api#chatadministratorrights">ChatAdministratorRights</a> and the methods <a href="/bots/api#setmydefaultadministratorrights">setMyDefaultAdministratorRights</a> and <a href="/bots/api#getmydefaultadministratorrights">getMyDefaultAdministratorRights</a> for managing the bot's default administrator rights.</li> <li>Added support for t.me links that can be used to add the bot to groups and channels as an administrator.</li> <li>Added the field <em>last_synchronization_error_date</em> to the class <a href="/bots/api#webhookinfo">WebhookInfo</a>.</li> <li>Renamed the field <em>can_manage_voice_chats</em> to <em>can_manage_video_chats</em> in the class <a href="/bots/api#chatmemberadministrator">ChatMemberAdministrator</a>. The old field will remain temporarily available.</li> @@ -218,31 +217,30 @@ To learn how to create and set up a bot, please consult our <a href="https://cor </ul> <hr> <blockquote> -<p><strong><img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /> WARNING! <img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /></strong> -After the next update, only HTTPS links will be allowed in <em>login_url</em> inline keyboard buttons.</p> +<p><strong><img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /> WARNING! <img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /></strong><br>After the next update, only HTTPS links will be allowed in <em>login_url</em> inline keyboard buttons.</p> </blockquote> <hr> -<h4><a class="anchor" href="#january-31-2022" id="january-31-2022" name="january-31-2022"><i class="anchor-icon"></i></a>January 31, 2022</h4> +<h4><a class="anchor" name="january-31-2022" href="#january-31-2022"><i class="anchor-icon"></i></a>January 31, 2022</h4> <p><strong>Bot API 5.7</strong></p> <ul> <li>Added support for <a href="https://telegram.org/blog/video-stickers-better-reactions">Video Stickers</a>.</li> <li>Added the field <em>is_video</em> to the classes <a href="/bots/api#sticker">Sticker</a> and <a href="/bots/api#stickerset">StickerSet</a>.</li> <li>Added the parameter <em>webm_sticker</em> to the methods <a href="/bots/api#createnewstickerset">createNewStickerSet</a> and <a href="/bots/api#addstickertoset">addStickerToSet</a>.</li> </ul> -<h3><a class="anchor" href="#2021" id="2021" name="2021"><i class="anchor-icon"></i></a>2021</h3> -<h4><a class="anchor" href="#december-30-2021" id="december-30-2021" name="december-30-2021"><i class="anchor-icon"></i></a>December 30, 2021</h4> +<h3><a class="anchor" name="2021" href="#2021"><i class="anchor-icon"></i></a>2021</h3> +<h4><a class="anchor" name="december-30-2021" href="#december-30-2021"><i class="anchor-icon"></i></a>December 30, 2021</h4> <p><strong>Bot API 5.6</strong></p> <ul> <li>Improved support for <a href="https://telegram.org/blog/protected-content-delete-by-date-and-more#protected-content-in-groups-and-channels">Protected Content</a>.</li> <li>Added the parameter <em>protect_content</em> to the methods <a href="/bots/api#sendmessage">sendMessage</a>, <a href="/bots/api#sendphoto">sendPhoto</a>, <a href="/bots/api#sendvideo">sendVideo</a>, <a href="/bots/api#sendanimation">sendAnimation</a>, <a href="/bots/api#sendaudio">sendAudio</a>, <a href="/bots/api#senddocument">sendDocument</a>, <a href="/bots/api#sendsticker">sendSticker</a>, <a href="/bots/api#sendvideonote">sendVideoNote</a>, <a href="/bots/api#sendvoice">sendVoice</a>, <a href="/bots/api#sendlocation">sendLocation</a>, <a href="/bots/api#sendvenue">sendVenue</a>, <a href="/bots/api#sendcontact">sendContact</a>, <a href="/bots/api#sendpoll">sendPoll</a>, <a href="/bots/api#senddice">sendDice</a>, <a href="/bots/api#sendinvoice">sendInvoice</a>, <a href="/bots/api#sendgame">sendGame</a>, <a href="/bots/api#sendmediagroup">sendMediaGroup</a>, <a href="/bots/api#copymessage">copyMessage</a>, <a href="/bots/api#forwardmessage">forwardMessage</a> to allow sending messages with protected content to any chat.</li> <li>Added support for <a href="https://telegram.org/blog/reactions-spoilers-translations#spoilers">spoiler entities</a>, which will work in Telegram versions released after December 30, 2021. Older clients will display <em>unsupported message</em>.</li> -<li>Added new <a href="/bots/api#messageentity">MessageEntity</a> type "spoiler".</li> +<li>Added new <a href="/bots/api#messageentity">MessageEntity</a> type “spoiler”.</li> <li>Added the ability to specify spoiler entities using <a href="/bots/api#html-style">HTML</a> and <a href="/bots/api#markdownv2-style">MarkdownV2</a> formatting options.</li> </ul> -<h4><a class="anchor" href="#december-7-2021" id="december-7-2021" name="december-7-2021"><i class="anchor-icon"></i></a>December 7, 2021</h4> +<h4><a class="anchor" name="december-7-2021" href="#december-7-2021"><i class="anchor-icon"></i></a>December 7, 2021</h4> <p><strong>Bot API 5.5</strong></p> <ul> -<li>Bots are now allowed to contact users who sent a join request to a chat where the bot is an administrator with the <em>can_invite_users</em> administrator right – even if the user never interacted with the bot before.</li> +<li>Bots are now allowed to contact users who sent a join request to a chat where the bot is an administrator with the <em>can_invite_users</em> administrator right – even if the user never interacted with the bot before.</li> <li>Added support for mentioning users by their ID in inline keyboards. This will only work in Telegram versions released after December 7, 2021. Older clients will display <em>unsupported message</em>.</li> <li>Added the methods <a href="/bots/api#banchatsenderchat">banChatSenderChat</a> and <a href="/bots/api#unbanchatsenderchat">unbanChatSenderChat</a> for banning and unbanning channel chats in supergroups and channels.</li> <li>Added the field <em>has_private_forwards</em> to the class <a href="/bots/api#chat">Chat</a> for private chats, which can be used to check the possibility of mentioning the user by their ID.</li> @@ -252,7 +250,7 @@ After the next update, only HTTPS links will be allowed in <em>login_url</em> in <p><strong>Note:</strong> After this update it will become impossible to forward messages from some chats. Use the fields <em>has_protected_content</em> in the classes <a href="/bots/api#message">Message</a> and <a href="/bots/api#chat">Chat</a> to check this.</p> <p><strong>Note:</strong> After this update users are able to send messages on behalf of channels they own. Bots are expected to use the field <em>sender_chat</em> in the class <a href="/bots/api#message">Message</a> to correctly support such messages.</p> <p><strong>Note:</strong> As previously announced, user identifiers can now have up to 52 significant bits and require a 64-bit integer or double-precision float type to be stored safely.</p> -<h4><a class="anchor" href="#november-5-2021" id="november-5-2021" name="november-5-2021"><i class="anchor-icon"></i></a>November 5, 2021</h4> +<h4><a class="anchor" name="november-5-2021" href="#november-5-2021"><i class="anchor-icon"></i></a>November 5, 2021</h4> <p><strong>Bot API 5.4</strong></p> <ul> <li>Added the the parameter <code>creates_join_request</code> to the methods <a href="/bots/api#createchatinvitelink">createChatInviteLink</a> and <a href="/bots/api#editchatinvitelink">editChatInviteLink</a> for managing chat invite links that create join requests (read more about this on our <a href="https://telegram.org/blog/shared-media-scrolling-calendar-join-requests-and-more#join-requests-for-groups-and-channels">blog</a>).</li> @@ -264,11 +262,10 @@ After the next update, only HTTPS links will be allowed in <em>login_url</em> in </ul> <hr> <blockquote> -<p><strong><img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /> WARNING! <img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /></strong> -User identifiers will become bigger than <code>2^31 - 1</code> before the end of this year and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.</p> +<p><strong><img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /> WARNING! <img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /></strong><br>User identifiers will become bigger than <code>2^31 - 1</code> before the end of this year and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.</p> </blockquote> <hr> -<h4><a class="anchor" href="#june-25-2021" id="june-25-2021" name="june-25-2021"><i class="anchor-icon"></i></a>June 25, 2021</h4> +<h4><a class="anchor" name="june-25-2021" href="#june-25-2021"><i class="anchor-icon"></i></a>June 25, 2021</h4> <p><strong>Bot API 5.3</strong></p> <p><strong>Personalized Commands</strong></p> <ul> @@ -276,8 +273,8 @@ User identifiers will become bigger than <code>2^31 - 1</code> before the end of <li>Added the class <a href="/bots/api#botcommandscope">BotCommandScope</a>, describing the scope to which bot commands apply.</li> <li>Added the parameters <code>scope</code> and <code>language_code</code> to the method <a href="/bots/api#setmycommands">setMyCommands</a> to allow bots specify different commands for different chats and users.</li> <li>Added the parameters <code>scope</code> and <code>language_code</code> to the method <a href="/bots/api#getmycommands">getMyCommands</a>.</li> -<li>Added the method <a href="/bots/api#deletemycommands">deleteMyCommands</a> to allow deletion of the bot's commands for the given scope and user language.</li> -<li>Improved visibility of bot commands in Telegram apps with the new 'Menu' button in chats with bots, read more on the <a href="https://telegram.org/blog/animated-backgrounds#bot-menu">blog</a>.</li> +<li>Added the method <a href="/bots/api#deletemycommands">deleteMyCommands</a> to allow deletion of the bot's commands for the given scope and user language.</li> +<li>Improved visibility of bot commands in Telegram apps with the new 'Menu' button in chats with bots, read more on the <a href="https://telegram.org/blog/animated-backgrounds#bot-menu">blog</a>.</li> </ul> <p><strong>Custom Placeholders</strong></p> <ul> @@ -292,39 +289,35 @@ User identifiers will become bigger than <code>2^31 - 1</code> before the end of </ul> <hr> <blockquote> -<p><strong><img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /> WARNING! <img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /></strong> -After one of the upcoming Bot API updates, user identifiers will become bigger than <code>2^31 - 1</code> and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.</p> +<p><strong><img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /> WARNING! <img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /></strong><br>After one of the upcoming Bot API updates, user identifiers will become bigger than <code>2^31 - 1</code> and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.</p> </blockquote> <hr> -<h4><a class="anchor" href="#april-26-2021" id="april-26-2021" name="april-26-2021"><i class="anchor-icon"></i></a>April 26, 2021</h4> +<h4><a class="anchor" name="april-26-2021" href="#april-26-2021"><i class="anchor-icon"></i></a>April 26, 2021</h4> <p><strong>Bot API 5.2</strong></p> <ul> <li>Support for <a href="https://telegram.org/blog/payments-2-0-scheduled-voice-chats">Payments 2.0</a>, see <a href="https://core.telegram.org/bots/payments">this manual</a> for more details about the <strong>Bot Payments API</strong>.</li> <li>Added the type <a href="/bots/api#inputinvoicemessagecontent">InputInvoiceMessageContent</a> to support sending invoices as inline query results.</li> <li>Allowed sending invoices to group, supergroup and channel chats.</li> <li>Added the fields <em>max_tip_amount</em> and <em>suggested_tip_amounts</em> to the method <a href="/bots/api#sendinvoice">sendInvoice</a> to allow adding optional tips to the payment.</li> -<li>The parameter <em>start_parameter</em> of the method <a href="/bots/api#sendinvoice">sendInvoice</a> became optional. If the parameter isn't specified, the invoice can be paid directly from forwarded messages.</li> +<li>The parameter <em>start_parameter</em> of the method <a href="/bots/api#sendinvoice">sendInvoice</a> became optional. If the parameter isn't specified, the invoice can be paid directly from forwarded messages.</li> <li>Added the field <em>chat_type</em> to the class <a href="/bots/api#inlinequery">InlineQuery</a>, containing the type of the chat, from which the inline request was sent.</li> <li>Added the type <a href="/bots/api#voicechatscheduled">VoiceChatScheduled</a> and the field <em>voice_chat_scheduled</em> to the class <a href="/bots/api#message">Message</a>.</li> -<li>Fixed an error in <a href="/bots/api#sendchataction">sendChatAction</a> documentation to correctly mention "record_voice" and "upload_voice" instead of "record_audio" and "upload_audio" for related to voice note actions. Old action names will still work for backward compatibility.</li> +<li>Fixed an error in <a href="/bots/api#sendchataction">sendChatAction</a> documentation to correctly mention “record_voice” and “upload_voice” instead of “record_audio” and “upload_audio” for related to voice note actions. Old action names will still work for backward compatibility.</li> </ul> <hr> <blockquote> -<p><strong><img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /> WARNING! <img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /></strong> -After the next Bot API update (Bot API 5.3) there will be a one-time change of the value of the field <code>file_unique_id</code> in objects of the type <a href="/bots/api#photosize">PhotoSize</a> and of the fields <code>small_file_unique_id</code> and <code>big_file_unique_id</code> in objects of the type <a href="/bots/api#chatphoto">ChatPhoto</a>.</p> +<p><strong><img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /> WARNING! <img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /></strong><br>After the next Bot API update (Bot API 5.3) there will be a one-time change of the value of the field <code>file_unique_id</code> in objects of the type <a href="/bots/api#photosize">PhotoSize</a> and of the fields <code>small_file_unique_id</code> and <code>big_file_unique_id</code> in objects of the type <a href="/bots/api#chatphoto">ChatPhoto</a>.</p> </blockquote> <hr> <blockquote> -<p><strong><img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /> WARNING! <img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /></strong> -Service messages about non-bot users joining the chat will be soon removed from large groups. We recommend using the "chat_member" update as a replacement.</p> +<p><strong><img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /> WARNING! <img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /></strong><br>Service messages about non-bot users joining the chat will be soon removed from large groups. We recommend using the “chat_member” update as a replacement.</p> </blockquote> <hr> <blockquote> -<p><strong><img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /> WARNING! <img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /></strong> -After one of the upcoming Bot API updates, user identifiers will become bigger than <code>2^31 - 1</code> and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.</p> +<p><strong><img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /> WARNING! <img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /></strong><br>After one of the upcoming Bot API updates, user identifiers will become bigger than <code>2^31 - 1</code> and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.</p> </blockquote> <hr> -<h4><a class="anchor" href="#march-9-2021" id="march-9-2021" name="march-9-2021"><i class="anchor-icon"></i></a>March 9, 2021</h4> +<h4><a class="anchor" name="march-9-2021" href="#march-9-2021"><i class="anchor-icon"></i></a>March 9, 2021</h4> <p><strong>Bot API 5.1</strong></p> <p><strong>Added two new update types</strong></p> <ul> @@ -353,16 +346,15 @@ After one of the upcoming Bot API updates, user identifiers will become bigger t </ul> <hr> <blockquote> -<p><strong><img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /> WARNING! <img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /></strong> -After one of the upcoming Bot API updates, some user identifiers will become bigger than <code>2^31 - 1</code> and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.</p> +<p><strong><img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /> WARNING! <img class="emoji" src="//telegram.org/img/emoji/40/E29AA0.png" width="20" height="20" alt="⚠️" /></strong><br>After one of the upcoming Bot API updates, some user identifiers will become bigger than <code>2^31 - 1</code> and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.</p> </blockquote> <hr> -<h3><a class="anchor" href="#2020" id="2020" name="2020"><i class="anchor-icon"></i></a>2020</h3> -<h4><a class="anchor" href="#november-4-2020" id="november-4-2020" name="november-4-2020"><i class="anchor-icon"></i></a>November 4, 2020</h4> +<h3><a class="anchor" name="2020" href="#2020"><i class="anchor-icon"></i></a>2020</h3> +<h4><a class="anchor" name="november-4-2020" href="#november-4-2020"><i class="anchor-icon"></i></a>November 4, 2020</h4> <p>Introducing <strong>Bot API 5.0</strong></p> <p><strong>Run Your Own Bot API Server</strong></p> <ul> -<li>Bot API source code is now available at <a href="https://github.com/tdlib/telegram-bot-api">telegram-bot-api</a>. You can now run your <strong>own Bot API server</strong> locally, boosting your bots' performance.</li> +<li>Bot API source code is now available at <a href="https://github.com/tdlib/telegram-bot-api">telegram-bot-api</a>. You can now run your <strong>own Bot API server</strong> locally, boosting your bots' performance.</li> <li>Added the method <a href="/bots/api#logout">logOut</a>, which can be used to log out from the cloud Bot API server before launching your bot locally. You <strong>must</strong> log out the bot before running it locally, otherwise there is no guarantee that the bot will receive all updates.</li> <li>Added the method <a href="/bots/api#close">close</a>, which can be used to close the bot instance before moving it from one local server to another.</li> </ul> @@ -378,7 +370,7 @@ After one of the upcoming Bot API updates, some user identifiers will become big </ul> <p><strong>Working with Groups</strong></p> <ul> -<li>The <a href="/bots/api#getchat">getChat</a> request now returns the user's bio for private chats if available.</li> +<li>The <a href="/bots/api#getchat">getChat</a> request now returns the user's bio for private chats if available.</li> <li>The <a href="/bots/api#getchat">getChat</a> request now returns the identifier of the linked chat for supergroups and channels, i.e. the discussion group identifier for a channel and vice versa.</li> <li>The <a href="/bots/api#getchat">getChat</a> request now returns the location to which the supergroup is connected (see <a href="https://telegram.org/blog/contacts-local-groups">Local Groups</a>). Added the class <a href="/bots/api#chatlocation">ChatLocation</a> to represent the location.</li> <li>Added the parameter <em>only_if_banned</em> to the method <a href="/bots/api#unbanchatmember">unbanChatMember</a> to allow safe unban.</li> @@ -401,7 +393,7 @@ After one of the upcoming Bot API updates, some user identifiers will become big <p><strong>Live Locations</strong></p> <ul> <li>Added the field <em>live_period</em> to the class <a href="/bots/api#location">Location</a>, representing a maximum period for which the live location can be updated.</li> -<li>Added support for live location [heading](<a href="https://en.wikipedia.org/wiki/Heading_(navigation&#41">https://en.wikipedia.org/wiki/Heading_(navigation&#41</a>;): added the field <em>heading</em> to the classes <a href="/bots/api#location">Location</a>, <a href="/bots/api#inlinequeryresultlocation">InlineQueryResultLocation</a>, <a href="/bots/api#inputlocationmessagecontent">InputLocationMessageContent</a> and the parameter <em>heading</em> to the methods <a href="/bots/api#sendlocation">sendLocation</a> and <a href="/bots/api#editmessagelivelocation">editMessageLiveLocation</a>.</li> +<li>Added support for live location <a href="https://en.wikipedia.org/wiki/Heading_(navigation)">heading</a>: added the field <em>heading</em> to the classes <a href="/bots/api#location">Location</a>, <a href="/bots/api#inlinequeryresultlocation">InlineQueryResultLocation</a>, <a href="/bots/api#inputlocationmessagecontent">InputLocationMessageContent</a> and the parameter <em>heading</em> to the methods <a href="/bots/api#sendlocation">sendLocation</a> and <a href="/bots/api#editmessagelivelocation">editMessageLiveLocation</a>.</li> <li>Added support for proximity alerts in live locations: added the field <em>proximity_alert_radius</em> to the classes <a href="/bots/api#location">Location</a>, <a href="/bots/api#inlinequeryresultlocation">InlineQueryResultLocation</a>, <a href="/bots/api#inputlocationmessagecontent">InputLocationMessageContent</a> and the parameter <em>proximity_alert_radius</em> to the methods <a href="/bots/api#sendlocation">sendLocation</a> and <a href="/bots/api#editmessagelivelocation">editMessageLiveLocation</a>.</li> <li>Added the type <a href="/bots/api#proximityalerttriggered">ProximityAlertTriggered</a> and the field <em>proximity_alert_triggered</em> to the class <a href="/bots/api#message">Message</a>.</li> <li>Added possibility to specify the horizontal accuracy of a location. Added the field <em>horizontal_accuracy</em> to the classes <a href="/bots/api#location">Location</a>, <a href="/bots/api#inlinequeryresultlocation">InlineQueryResultLocation</a>, <a href="/bots/api#inputlocationmessagecontent">InputLocationMessageContent</a> and the parameter <em>horizontal_accuracy</em> to the methods <a href="/bots/api#sendlocation">sendLocation</a> and <a href="/bots/api#editmessagelivelocation">editMessageLiveLocation</a>.</li> @@ -425,14 +417,14 @@ After one of the upcoming Bot API updates, some user identifiers will become big <ul> <li>Supported the new <strong>football</strong> and <strong>slot machine</strong> animations for the random <a href="/bots/api#dice">dice</a>. Choose between different animations (dice, darts, basketball, football, slot machine) by specifying the <em>emoji</em> parameter in the method <a href="/bots/api#senddice">sendDice</a>.</li> </ul> -<h4><a class="anchor" href="#june-4-2020" id="june-4-2020" name="june-4-2020"><i class="anchor-icon"></i></a>June 4, 2020</h4> +<h4><a class="anchor" name="june-4-2020" href="#june-4-2020"><i class="anchor-icon"></i></a>June 4, 2020</h4> <p><strong>Bot API 4.9</strong></p> <ul> <li>Added the new field <em>via_bot</em> to the <a href="/bots/api#message">Message</a> object. You can now know which bot was used to send a message.</li> <li>Supported video thumbnails for inline <a href="/bots/api#inlinequeryresultgif">GIF</a> and <a href="/bots/api#inlinequeryresultmpeg4gif">MPEG4</a> animations.</li> <li>Supported the new basketball animation for the random <a href="/bots/api#dice">dice</a>. Choose between different animations (dice, darts, basketball) by specifying the <em>emoji</em> parameter in the method <a href="/bots/api#senddice">sendDice</a>.</li> </ul> -<h4><a class="anchor" href="#april-24-2020" id="april-24-2020" name="april-24-2020"><i class="anchor-icon"></i></a>April 24, 2020</h4> +<h4><a class="anchor" name="april-24-2020" href="#april-24-2020"><i class="anchor-icon"></i></a>April 24, 2020</h4> <p><strong>Bot API 4.8</strong></p> <ul> <li>Supported explanations for <a href="https://telegram.org/blog/400-million#better-quizzes">Quizzes 2.0</a>. Add explanations by specifying the parameters <em>explanation</em> and <em>explanation_parse_mode</em> in the method <a href="/bots/api#sendpoll">sendPoll</a>.</li> @@ -442,19 +434,19 @@ After one of the upcoming Bot API updates, some user identifiers will become big <li>Supported the new <a href="https://telegram.org/blog/400-million#bullseye">darts</a> animation for the dice mini-game. Choose between the default dice animation and darts animation by specifying the parameter <em>emoji</em> in the method <a href="/bots/api#senddice">sendDice</a>.</li> <li>Added the field <em>emoji</em> to the <a href="/bots/api#dice">Dice</a> object.</li> </ul> -<h4><a class="anchor" href="#march-30-2020" id="march-30-2020" name="march-30-2020"><i class="anchor-icon"></i></a>March 30, 2020</h4> +<h4><a class="anchor" name="march-30-2020" href="#march-30-2020"><i class="anchor-icon"></i></a>March 30, 2020</h4> <p><strong>Bot API 4.7</strong></p> <ul> -<li>Added the method <a href="/bots/api#senddice">sendDice</a> for sending a dice message, which will have a random value from 1 to 6. (Yes, we're aware of the <em>"proper"</em> singular of <em>die</em>. But it's awkward, and we decided to help it change. One dice at a time!)</li> +<li>Added the method <a href="/bots/api#senddice">sendDice</a> for sending a dice message, which will have a random value from 1 to 6. (Yes, we're aware of the <em>“proper”</em> singular of <em>die</em>. But it's awkward, and we decided to help it change. One dice at a time!)</li> <li>Added the field <a href="/bots/api#dice">dice</a> to the <a href="/bots/api#message">Message</a> object.</li> -<li>Added the method <a href="/bots/api#getmycommands">getMyCommands</a> for getting the current list of the bot's commands.</li> -<li>Added the method <a href="/bots/api#setmycommands">setMyCommands</a> for changing the list of the bot's commands through the Bot API instead of <a href="https://t.me/botfather">@BotFather</a>.</li> +<li>Added the method <a href="/bots/api#getmycommands">getMyCommands</a> for getting the current list of the bot's commands.</li> +<li>Added the method <a href="/bots/api#setmycommands">setMyCommands</a> for changing the list of the bot's commands through the Bot API instead of <a href="https://t.me/botfather">@BotFather</a>.</li> <li>Added the ability to create animated sticker sets by specifying the parameter <em>tgs_sticker</em> instead of <em>png_sticker</em> in the method <a href="/bots/api#createnewstickerset">createNewStickerSet</a>.</li> <li>Added the ability to add animated stickers to sets created by the bot by specifying the parameter <em>tgs_sticker</em> instead of <em>png_sticker</em> in the method <a href="/bots/api#addstickertoset">addStickerToSet</a>.</li> <li>Added the field <em>thumb</em> to the <a href="/bots/api#stickerset">StickerSet</a> object.</li> <li>Added the ability to change thumbnails of sticker sets created by the bot using the method <a href="/bots/api#setstickersetthumb">setStickerSetThumb</a>.</li> </ul> -<h4><a class="anchor" href="#january-23-2020" id="january-23-2020" name="january-23-2020"><i class="anchor-icon"></i></a>January 23, 2020</h4> +<h4><a class="anchor" name="january-23-2020" href="#january-23-2020"><i class="anchor-icon"></i></a>January 23, 2020</h4> <p><strong>Bot API 4.6</strong></p> <ul> <li>Supported <a href="https://telegram.org/blog/polls-2-0-vmq">Polls 2.0</a>.</li> @@ -466,20 +458,20 @@ After one of the upcoming Bot API updates, some user identifiers will become big <li>Added more information about the bot in response to the <a href="/bots/api#getme">getMe</a> request: added the fields <em>can_join_groups</em>, <em>can_read_all_group_messages</em> and <em>supports_inline_queries</em> to the <a href="/bots/api#user">User</a> object.</li> <li>Added the optional field <em>language</em> to the <a href="/bots/api#messageentity">MessageEntity</a> object.</li> </ul> -<h3><a class="anchor" href="#2019" id="2019" name="2019"><i class="anchor-icon"></i></a>2019</h3> -<h4><a class="anchor" href="#december-31-2019" id="december-31-2019" name="december-31-2019"><i class="anchor-icon"></i></a>December 31, 2019</h4> +<h3><a class="anchor" name="2019" href="#2019"><i class="anchor-icon"></i></a>2019</h3> +<h4><a class="anchor" name="december-31-2019" href="#december-31-2019"><i class="anchor-icon"></i></a>December 31, 2019</h4> <p><strong>Bot API 4.5</strong></p> <ul> <li>Added support for two new <a href="/bots/api#messageentity">MessageEntity</a> types, <em>underline</em> and <em>strikethrough</em>.</li> <li>Added support for nested <a href="/bots/api#messageentity">MessageEntity</a> objects. Entities can now contain other entities. If two entities have common characters then one of them is fully contained inside the other.</li> <li>Added support for nested entities and the new tags <code><u>/<ins></code> (for underlined text) and <code><s>/<strike>/<del></code> (for strikethrough text) in parse mode HTML.</li> <li>Added a new parse mode, <a href="/bots/api#markdownv2-style">MarkdownV2</a>, which supports nested entities and two new entities <code>__</code> (for underlined text) and <code>~</code> (for strikethrough text). Parse mode <a href="/bots/api#markdown-style">Markdown</a> remains unchanged for backward compatibility.</li> -<li>Added the field <em>file_unique_id</em> to the objects <a href="/bots/api#animation">Animation</a>, <a href="/bots/api#audio">Audio</a>, <a href="/bots/api#document">Document</a>, <a href="/bots/api#passportfile">PassportFile</a>, <a href="/bots/api#photosize">PhotoSize</a>, <a href="/bots/api#sticker">Sticker</a>, <a href="/bots/api#video">Video</a>, <a href="/bots/api#videonote">VideoNote</a>, <a href="/bots/api#voice">Voice</a>, <a href="/bots/api#file">File</a> and the fields <em>small_file_unique_id</em> and <em>big_file_unique_id</em> to the object <a href="/bots/api#chatphoto">ChatPhoto</a>. The new fields contain a unique file identifier, which is supposed to be the same over time and for different bots, but can't be used to download or reuse the file.</li> +<li>Added the field <em>file_unique_id</em> to the objects <a href="/bots/api#animation">Animation</a>, <a href="/bots/api#audio">Audio</a>, <a href="/bots/api#document">Document</a>, <a href="/bots/api#passportfile">PassportFile</a>, <a href="/bots/api#photosize">PhotoSize</a>, <a href="/bots/api#sticker">Sticker</a>, <a href="/bots/api#video">Video</a>, <a href="/bots/api#videonote">VideoNote</a>, <a href="/bots/api#voice">Voice</a>, <a href="/bots/api#file">File</a> and the fields <em>small_file_unique_id</em> and <em>big_file_unique_id</em> to the object <a href="/bots/api#chatphoto">ChatPhoto</a>. The new fields contain a unique file identifier, which is supposed to be the same over time and for different bots, but can't be used to download or reuse the file.</li> <li>Added the field <em>custom_title</em> to the <a href="/bots/api#chatmember">ChatMember</a> object.</li> <li>Added the new method <a href="/bots/api#setchatadministratorcustomtitle">setChatAdministratorCustomTitle</a> to manage the custom titles of administrators promoted by the bot.</li> <li>Added the field <em>slow_mode_delay</em> to the <a href="/bots/api#chat">Chat</a> object.</li> </ul> -<h4><a class="anchor" href="#july-29-2019" id="july-29-2019" name="july-29-2019"><i class="anchor-icon"></i></a>July 29, 2019</h4> +<h4><a class="anchor" name="july-29-2019" href="#july-29-2019"><i class="anchor-icon"></i></a>July 29, 2019</h4> <p><strong>Bot API 4.4</strong></p> <ul> <li>Added support for <a href="https://telegram.org/blog/animated-stickers"><strong>animated stickers</strong></a>. New field <em>is_animated</em> in <a href="/bots/api#sticker">Sticker</a> and <a href="/bots/api#stickerset">StickerSet</a> objects, animated stickers can now be used in <a href="/bots/api#sendsticker">sendSticker</a> and <a href="/bots/api#inlinequeryresultcachedsticker">InlineQueryResultCachedSticker</a>.</li> @@ -487,49 +479,50 @@ After one of the upcoming Bot API updates, some user identifiers will become big <li>The field <em>all_members_are_administrators</em> has been removed from the documentation for the <a href="/bots/api#chat">Chat</a> object. The field is still returned in the object for backward compatibility, but new bots should use the <em>permissions</em> field instead.</li> <li>Added support for more permissions for group and supergroup members: added the new field <em>can_send_polls</em> to <a href="/bots/api#chatmember">ChatMember</a> object, added <em>can_change_info</em>, <em>can_invite_users</em>, <em>can_pin_messages</em> in <a href="/bots/api#chatmember">ChatMember</a> object for restricted users (previously available only for administrators).</li> <li>The method <a href="/bots/api#restrictchatmember">restrictChatMember</a> now takes the new user permissions in a single argument of the type <a href="/bots/api#chatpermissions">ChatPermissions</a>. The old way of passing parameters will keep working for a while for backward compatibility.</li> -<li>Added <em>description</em> support for basic groups (previously available in supergroups and channel chats). You can pass a group's chat_id to <a href="/bots/api#setchatdescription">setChatDescription</a> and receive the group's description in the <a href="/bots/api#chat">Chat</a> object in the response to <a href="/bots/api#getchat">getChat</a> method.</li> -<li>Added <em>invite_link</em> support for basic groups (previously available in supergroups and channel chats). You can pass a group's chat_id to <a href="/bots/api#exportchatinvitelink">exportChatInviteLink</a> and receive the group's invite link in the <a href="/bots/api#chat">Chat</a> object in the response to <a href="/bots/api#getchat">getChat</a> method.</li> +<li>Added <em>description</em> support for basic groups (previously available in supergroups and channel chats). You can pass a group's chat_id to <a href="/bots/api#setchatdescription">setChatDescription</a> and receive the group's description in the <a href="/bots/api#chat">Chat</a> object in the response to <a href="/bots/api#getchat">getChat</a> method.</li> +<li>Added <em>invite_link</em> support for basic groups (previously available in supergroups and channel chats). You can pass a group's chat_id to <a href="/bots/api#exportchatinvitelink">exportChatInviteLink</a> and receive the group's invite link in the <a href="/bots/api#chat">Chat</a> object in the response to <a href="/bots/api#getchat">getChat</a> method.</li> <li>File identifiers from the <a href="/bots/api#chatphoto">ChatPhoto</a> object are now invalidated and can no longer be used whenever the photo is changed.</li> -<li>All <strong>webhook requests</strong> from the Bot API are now coming from the subnets <code>149.154.160.0/20</code> and <code>91.108.4.0/22</code>. Most users won't need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: <a href="/bots/webhooks">https://core.telegram.org/bots/webhooks</a>.</li> +<li>All <strong>webhook requests</strong> from the Bot API are now coming from the subnets <code>149.154.160.0/20</code> and <code>91.108.4.0/22</code>. Most users won't need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: <a href="/bots/webhooks"><a href="https://core.telegram.org/bots/webhooks">https://core.telegram.org/bots/webhooks</a></a>.</li> <li>As of the <strong>next Bot API</strong> update (<strong>version 4.5</strong>), nested <a href="/bots/api#messageentity">MessageEntity</a> objects will be allowed in message texts and captions. Please make sure that your code can correctly handle such entities.</li> </ul> -<h4><a class="anchor" href="#may-31-2019" id="may-31-2019" name="may-31-2019"><i class="anchor-icon"></i></a>May 31, 2019</h4> +<h4><a class="anchor" name="may-31-2019" href="#may-31-2019"><i class="anchor-icon"></i></a>May 31, 2019</h4> <p><strong>Bot API 4.3</strong></p> <ul> <li>Added support for <a href="https://telegram.org/blog/privacy-discussions-web-bots#meet-seamless-web-bots"><strong>Seamless Telegram Login</strong></a> on external websites.</li> <li>Added the new object <a href="/bots/api#loginurl">LoginUrl</a> and the new field <em>login_url</em> to the <a href="/bots/api#inlinekeyboardbutton">InlineKeyboardButton</a> object which allows to <strong>automatically authorize</strong> users before they go to a URL specified by the bot. Users will be asked to confirm authorization in their Telegram app (needs version 5.7 or higher) when they press the button:</li> </ul> <div class="blog_image_wrap"> - <a href="/file/811140015/1734/8VZFkwWXalM.97872/6127fa62d8a0bf2b3c" target="_blank"><img src="/file/811140909/1631/20k1Z53eiyY.23995/c541e89b74253623d9" title="TITLE" alt="TITLE" srcset="/file/811140015/1734/8VZFkwWXalM.97872/6127fa62d8a0bf2b3c , 2x"></a> + <a href="/file/811140015/1734/8VZFkwWXalM.97872/6127fa62d8a0bf2b3c" target="_blank"><img src="/file/811140909/1631/20k1Z53eiyY.23995/c541e89b74253623d9" title="TITLE" alt="TITLE" srcset="/file/811140015/1734/8VZFkwWXalM.97872/6127fa62d8a0bf2b3c , 2x" /></a> </div> + <p><strong>Also in this update:</strong></p> <ul> <li>Added the field <code>reply_markup</code> to the <a href="/bots/api#message">Message</a> object, containing the inline keyboard attached to the message.</li> <li>If a message with an inline keyboard is forwarded, the forwarded message will now have an inline keyboard if the keyboard contained only <em>url</em> and <em>login_url</em> buttons or if the message was sent via a bot and the keyboard contained only <em>url</em>, <em>login_url</em>, <em>switch_inline_query</em> or <em>switch_inline_query_current_chat</em> buttons. In the latter case, <em>switch_inline_query_current_chat</em> buttons are replaced with <em>switch_inline_query</em> buttons.</li> <li>Bots now receive the <em>edited_message</em> <a href="/bots/api#update">Update</a> even if only <em>Message.reply_markup</em> has changed.</li> <li>Bots that have the <em>can_edit_messages</em> right in a channel can now use the method <a href="/bots/api#editmessagereplymarkup">editMessageReplyMarkup</a> for messages written by other administrators forever without the 48 hours limit.</li> -<li>Don't forget that starting in <strong>July 2019</strong>, <strong>webhook requests</strong> from Bot API will be coming from the subnets <code>149.154.160.0/20</code> and <code>91.108.4.0/22</code>. Most users won't need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: <a href="/bots/webhooks">https://core.telegram.org/bots/webhooks</a>.</li> +<li>Don't forget that starting in <strong>July 2019</strong>, <strong>webhook requests</strong> from Bot API will be coming from the subnets <code>149.154.160.0/20</code> and <code>91.108.4.0/22</code>. Most users won't need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: <a href="/bots/webhooks"><a href="https://core.telegram.org/bots/webhooks">https://core.telegram.org/bots/webhooks</a></a>.</li> </ul> -<h4><a class="anchor" href="#april-14-2019" id="april-14-2019" name="april-14-2019"><i class="anchor-icon"></i></a>April 14, 2019</h4> +<h4><a class="anchor" name="april-14-2019" href="#april-14-2019"><i class="anchor-icon"></i></a>April 14, 2019</h4> <p><strong>Bot API 4.2</strong></p> <ul> <li>Added support for native polls: added the object <a href="/bots/api#poll">Poll</a>, the methods <a href="/bots/api#sendpoll">sendPoll</a> and <a href="/bots/api#stoppoll">stopPoll</a> and the field <em>poll</em> in the <a href="/bots/api#message">Message</a> and <a href="/bots/api#update">Update</a> objects.</li> <li>The method <a href="/bots/api#deletemessage">deleteMessage</a> can now be used to delete messages sent by a user to the bot in private chats within 48 hours.</li> -<li>Added support for pinned messages in basic groups in addition to supergroups and channel chats: you can pass group's chat_id to <a href="/bots/api#pinchatmessage">pinChatMessage</a> and <a href="/bots/api#unpinchatmessage">unpinChatMessage</a>, and receive the pinned group message in <a href="/bots/api#chat">Chat</a> object.</li> +<li>Added support for pinned messages in basic groups in addition to supergroups and channel chats: you can pass group's chat_id to <a href="/bots/api#pinchatmessage">pinChatMessage</a> and <a href="/bots/api#unpinchatmessage">unpinChatMessage</a>, and receive the pinned group message in <a href="/bots/api#chat">Chat</a> object.</li> <li>Added the field <em>is_member</em> to the <a href="/bots/api#chatmember">ChatMember</a> object, which can be used to find whether a restricted user is a member of the chat.</li> <li>Added the field <em>forward_sender_name</em> to the <a href="/bots/api#message">Message</a> object, containing name of the sender who has opted to hide their account.</li> -<li>Starting in July 2019, webhook requests from Bot API will be coming from the subnets <code>149.154.160.0/20</code> and <code>91.108.4.0/22</code>. Most users won't need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: <a href="/bots/webhooks">https://core.telegram.org/bots/webhooks</a>.</li> +<li>Starting in July 2019, webhook requests from Bot API will be coming from the subnets <code>149.154.160.0/20</code> and <code>91.108.4.0/22</code>. Most users won't need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: <a href="/bots/webhooks"><a href="https://core.telegram.org/bots/webhooks">https://core.telegram.org/bots/webhooks</a></a>.</li> <li>Document thumbnails now should be inscribed in a 320x320 square instead of 90x90.</li> </ul> -<h3><a class="anchor" href="#2018" id="2018" name="2018"><i class="anchor-icon"></i></a>2018</h3> -<h4><a class="anchor" href="#august-27-2018" id="august-27-2018" name="august-27-2018"><i class="anchor-icon"></i></a>August 27, 2018</h4> +<h3><a class="anchor" name="2018" href="#2018"><i class="anchor-icon"></i></a>2018</h3> +<h4><a class="anchor" name="august-27-2018" href="#august-27-2018"><i class="anchor-icon"></i></a>August 27, 2018</h4> <p><strong>Bot API 4.1</strong></p> <ul> <li>Added support for translated versions of documents in <a href="/passport">Telegram Passport</a>.</li> <li>New field <em>translation</em> in <a href="/bots/api#encryptedpassportelement">EncryptedPassportElement</a>.</li> <li>New errors: <a href="/bots/api#passportelementerrortranslationfile">PassportElementErrorTranslationFile</a> and <a href="/bots/api#passportelementerrortranslationfile">PassportElementErrorTranslationFiles</a> and <a href="/bots/api#passportelementerrorunspecified">PassportElementErrorUnspecified</a>.</li> </ul> -<h4><a class="anchor" href="#july-26-2018" id="july-26-2018" name="july-26-2018"><i class="anchor-icon"></i></a>July 26, 2018</h4> +<h4><a class="anchor" name="july-26-2018" href="#july-26-2018"><i class="anchor-icon"></i></a>July 26, 2018</h4> <p><strong>Bot API 4.0</strong>.</p> <ul> <li>Added support for <a href="https://telegram.org/blog/passport"><strong>Telegram Passport</strong></a>. See the official announcement on the <a href="https://telegram.org/blog">blog</a> and the <a href="https://core.telegram.org/passport">manual</a> for details.</li> @@ -541,36 +534,36 @@ After one of the upcoming Bot API updates, some user identifiers will become big <li>Added the field <a href="/bots/api#animation">animation</a> to the <a href="/bots/api#message">Message</a> object. For backward compatibility, when this field is set, the <em>document</em> field will be also set.</li> <li>Added two new <a href="/bots/api#messageentity">MessageEntity</a> types: <em>cashtag</em> and <em>phone_number</em>.</li> <li>Added support for Foursquare venues: added the new field <em>foursquare_type</em> to the objects <a href="/bots/api#venue">Venue</a>, <a href="/bots/api#inlinequeryresultvenue">InlineQueryResultVenue</a> and <a href="/bots/api#inputvenuemessagecontent">InputVenueMessageContent</a>, and the parameter <em>foursquare_type</em> to the <a href="/bots/api#sendvenue">sendVenue</a> method.</li> -<li>You can now create inline mentions of users, who have pressed your bot's callback buttons.</li> +<li>You can now create inline mentions of users, who have pressed your bot's callback buttons.</li> <li>You can now use the <code>Retry-After</code> response header to configure the delay after which the Bot API will retry the request after an unsuccessful response from a webhook.</li> <li>If a webhook returns the HTTP error <code>410 Gone</code> for all requests for more than 23 hours successively, it can be automatically removed.</li> <li>Added <a href="https://en.wikipedia.org/wiki/VCard">vCard</a> support when sharing contacts: added the field <em>vcard</em> to the objects <a href="/bots/api#contact">Contact</a>, <a href="/bots/api#inlinequeryresultcontact">InlineQueryResultContact</a>, <a href="/bots/api#inputcontactmessagecontent">InputContactMessageContent</a> and the method <a href="/bots/api#sendcontact">sendContact</a>.</li> </ul> -<h4><a class="anchor" href="#february-13-2018" id="february-13-2018" name="february-13-2018"><i class="anchor-icon"></i></a>February 13, 2018</h4> +<h4><a class="anchor" name="february-13-2018" href="#february-13-2018"><i class="anchor-icon"></i></a>February 13, 2018</h4> <p><strong>Bot API 3.6</strong>.</p> <ul> <li>Supported <a href="https://core.telegram.org/bots/api#formatting-options">text formatting</a> in media captions. Specify the desired <em>parse_mode</em> (<a href="https://core.telegram.org/bots/api#markdown-style">Markdown</a> or <a href="https://core.telegram.org/bots/api#html-style">HTML</a>) when you provide a caption.</li> -<li>In supergroups, if the bot receives a message that is a reply, it will also receive the message to which that message is replying – even if the original message is inaccessible due to the bot's privacy settings. (In other words, replying to any message in a supergroup with a message that mentions the bot or features a command for it acts as forwarding the original message to the bot). </li> -<li>Added the new field <em>connected_website</em> to <a href="/bots/api#message">Message</a>. The bot will receive a message with this field in a private chat when a user logs in on the bot's connected website using the <a href="https://core.telegram.org/widgets/login">Login Widget</a> and allows sending messages from your bot.</li> +<li>In supergroups, if the bot receives a message that is a reply, it will also receive the message to which that message is replying – even if the original message is inaccessible due to the bot's privacy settings. (In other words, replying to any message in a supergroup with a message that mentions the bot or features a command for it acts as forwarding the original message to the bot). </li> +<li>Added the new field <em>connected_website</em> to <a href="/bots/api#message">Message</a>. The bot will receive a message with this field in a private chat when a user logs in on the bot's connected website using the <a href="https://core.telegram.org/widgets/login">Login Widget</a> and allows sending messages from your bot.</li> <li>Added the new parameter <em>supports_streaming</em> to the <a href="/bots/api#sendvideo">sendVideo</a> method and a field with the same name to the <a href="/bots/api#inputmediavideo">InputMediaVideo</a> object.</li> </ul> -<h3><a class="anchor" href="#2017" id="2017" name="2017"><i class="anchor-icon"></i></a>2017</h3> -<h4><a class="anchor" href="#november-17-2017" id="november-17-2017" name="november-17-2017"><i class="anchor-icon"></i></a>November 17, 2017</h4> +<h3><a class="anchor" name="2017" href="#2017"><i class="anchor-icon"></i></a>2017</h3> +<h4><a class="anchor" name="november-17-2017" href="#november-17-2017"><i class="anchor-icon"></i></a>November 17, 2017</h4> <p><strong>Bot API 3.5</strong>.</p> <ul> <li>Added the new method <a href="/bots/api#sendmediagroup">sendMediaGroup</a> and two kinds of <a href="/bots/api#inputmedia">InputMedia</a> objects to support the new <a href="https://telegram.org/blog/albums-saved-messages">albums feature</a>.</li> <li>Added support for pinning messages in channels. <a href="/bots/api#pinchatmessage">pinChatMessage</a> and <a href="/bots/api#unpinchatmessage">unpinChatMessage</a> accept channels.</li> <li>Added the new fields <em>provider_data</em>, <em>send_phone_number_to_provider</em>, <em>send_email_to_provider</em> to <a href="/bots/api#sendinvoice">sendInvoice</a> for sharing information about the invoice with the payment provider.</li> </ul> -<h4><a class="anchor" href="#october-11-2017" id="october-11-2017" name="october-11-2017"><i class="anchor-icon"></i></a>October 11, 2017</h4> +<h4><a class="anchor" name="october-11-2017" href="#october-11-2017"><i class="anchor-icon"></i></a>October 11, 2017</h4> <p><strong>Bot API 3.4</strong>.</p> <ul> <li>Bots can now send and receive <a href="https://telegram.org/blog/live-locations">Live Locations</a>. Added new field <em>live_period</em> to the <a href="/bots/api#sendlocation">sendLocation</a> method and the <a href="/bots/api#editmessagelivelocation">editMessageLiveLocation</a> and <a href="/bots/api#stopmessagelivelocation">stopMessageLiveLocation</a> methods as well as the necessary objects for inline bots.</li> <li>Bots can use the new <a href="/bots/api#setchatstickerset">setChatStickerSet</a> and <a href="/bots/api#deletechatstickerset">deleteChatStickerSet</a> methods to manage <a href="https://telegram.org/blog#stickers-of-the-group">group sticker sets</a>.</li> -<li>The <a href="/bots/api#getchat">getChat</a> request now returns the group's sticker set for supergroups if available.</li> +<li>The <a href="/bots/api#getchat">getChat</a> request now returns the group's sticker set for supergroups if available.</li> <li>Bots now receive entities from media captions in the new field <em>caption_entities</em> in <a href="/bots/api#message">Message</a>.</li> </ul> -<h4><a class="anchor" href="#august-23-2017" id="august-23-2017" name="august-23-2017"><i class="anchor-icon"></i></a>August 23, 2017</h4> +<h4><a class="anchor" name="august-23-2017" href="#august-23-2017"><i class="anchor-icon"></i></a>August 23, 2017</h4> <p><strong>Bot API 3.3</strong>.</p> <ul> <li>Bots can now mention users via <a href="/bots/api#formatting-options">inline mentions</a>, without using usernames.</li> @@ -578,13 +571,13 @@ After one of the upcoming Bot API updates, some user identifiers will become big <li>Added the new fields <em>author_signature</em> and <em>forward_signature</em> to the <a href="/bots/api#message">Message</a> object.</li> <li>Added the new field <em>is_bot</em> to the <a href="/bots/api#user">User</a> object.</li> </ul> -<h4><a class="anchor" href="#july-21-2017" id="july-21-2017" name="july-21-2017"><i class="anchor-icon"></i></a>July 21, 2017</h4> +<h4><a class="anchor" name="july-21-2017" href="#july-21-2017"><i class="anchor-icon"></i></a>July 21, 2017</h4> <p><strong>Bot API 3.2</strong>. Teach your bot to handle <a href="/bots/api#stickers">stickers and sticker sets</a>.</p> <ul> <li>Added new methods for working with stickers: <a href="/bots/api#getstickerset">getStickerSet</a>, <a href="/bots/api#uploadstickerfile">uploadStickerFile</a>, <a href="/bots/api#createnewstickerset">createNewStickerSet</a>, <a href="/bots/api#addstickertoset">addStickerToSet</a>, <a href="/bots/api#setstickerpositioninset">setStickerPositionInSet</a>, and <a href="/bots/api#deletestickerfromset">deleteStickerFromSet</a>.</li> <li>Added the fields <em>set_name</em> and <em>mask_position</em> to the <a href="/bots/api#sticker">Sticker</a> object, plus two new objects, <a href="/bots/api#stickerset">StickerSet</a>, and <a href="/bots/api#maskposition">MaskPosition</a>.</li> </ul> -<h4><a class="anchor" href="#june-30-2017" id="june-30-2017" name="june-30-2017"><i class="anchor-icon"></i></a>June 30, 2017</h4> +<h4><a class="anchor" name="june-30-2017" href="#june-30-2017"><i class="anchor-icon"></i></a>June 30, 2017</h4> <p><strong>Bot API 3.1</strong>. Build your own robotic police force for supergoups with these new methods for admin bots:</p> <ul> <li>Added new methods <a href="/bots/api#restrictchatmember">restrictChatMember</a> and <a href="/bots/api#promotechatmember">promoteChatMember</a> to manage users and admins, added new parameter <em>until_date</em> to <a href="/bots/api#kickchatmember">kickChatMember</a> for temporary bans.</li> @@ -592,10 +585,10 @@ After one of the upcoming Bot API updates, some user identifiers will become big <li>Added the new fields <em>photo</em>, <em>description</em> and <em>invite_link</em> to the <a href="/bots/api#chat">Chat</a> object.</li> <li>Added the new fields <em>until_date</em>, <em>can_be_edited</em>, <em>can_change_info</em>, <em>can_post_messages</em>, <em>can_edit_messages</em>, <em>can_delete_messages</em>, <em>can_invite_users</em>, <em>can_restrict_members</em>, <em>can_pin_messages</em>, <em>can_promote_members</em>, <em>can_send_messages</em>, <em>can_send_media_messages</em>, <em>can_send_other_messages</em> and <em>can_add_web_page_previews</em> to the <a href="/bots/api#chatmember">ChatMember</a> object.</li> </ul> -<h4><a class="anchor" href="#may-18-2017" id="may-18-2017" name="may-18-2017"><i class="anchor-icon"></i></a>May 18, 2017</h4> +<h4><a class="anchor" name="may-18-2017" href="#may-18-2017"><i class="anchor-icon"></i></a>May 18, 2017</h4> <p>Introducing <strong>Bot API 3.0</strong>.</p> <p><strong>NEW Payment Platform</strong></p> -<p>See <a href="/bots/payments">Introduction to Bot Payments</a> for a brief overview. If you're not a developer, you may like <a href="https://telegram.org/blog/payments">this user-friendly blog post</a> better.</p> +<p>See <a href="/bots/payments">Introduction to Bot Payments</a> for a brief overview. If you're not a developer, you may like <a href="https://telegram.org/blog/payments">this user-friendly blog post</a> better.</p> <ul> <li>Your bot can now accept <a href="/bots/api#payments">payments</a> for goods and services via Telegram. </li> <li>Added new kinds of <a href="/bots/api#update">updates</a>, <em>shipping_query</em> and <em>pre_checkout_query</em>, and new types of <a href="/bots/api#message">message</a> content, <em>invoice</em> and <em>successful_payment</em>.</li> @@ -609,7 +602,7 @@ After one of the upcoming Bot API updates, some user identifiers will become big </ul> <p><strong>NEW Multilingual Bots</strong></p> <ul> -<li>The <a href="/bots/api#user">User</a> object now may have a <em>language_code</em> field that contains the <a href="https://en.wikipedia.org/wiki/IETF_language_tag">IETF language tag</a> of the user's language.</li> +<li>The <a href="/bots/api#user">User</a> object now may have a <em>language_code</em> field that contains the <a href="https://en.wikipedia.org/wiki/IETF_language_tag">IETF language tag</a> of the user's language.</li> <li>Thanks to this, your bot can now offer localized responses to users that speak different languages.</li> </ul> <p><strong>More power to admin bots</strong></p> @@ -623,45 +616,30 @@ After one of the upcoming Bot API updates, some user identifiers will become big <li><a href="https://core.telegram.org/bots/api#inlinekeyboardbutton">Inline keyboards</a> with <em>switch_inline_query</em> and <em>switch_inline_query_current_chat</em> can no longer be sent to channels because they are useless there.</li> <li>New fields <em>gif_duration</em> in <a href="/bots/api#inlinequeryresultgif">InlineQueryResultGif</a> and <em>mpeg4_duration</em> in <a href="/bots/api#inlinequeryresultmpeg4gif">InlineQueryResultMpeg4Gif</a>.</li> </ul> -<h3><a class="anchor" href="#2016" id="2016" name="2016"><i class="anchor-icon"></i></a>2016</h3> -<h4><a class="anchor" href="#december-4-2016" id="december-4-2016" name="december-4-2016"><i class="anchor-icon"></i></a>December 4, 2016</h4> +<h3><a class="anchor" name="2016" href="#2016"><i class="anchor-icon"></i></a>2016</h3> +<h4><a class="anchor" name="december-4-2016" href="#december-4-2016"><i class="anchor-icon"></i></a>December 4, 2016</h4> <p>Introducing <strong>Bot API 2.3.1</strong>, a nifty little update that will give you more control over how your bot gets its updates.</p> <ul> -<li>Use the new field <em>max_connections</em> in <a href="/bots/api#setwebhook">setWebhook</a> to optimize your bot's server load</li> +<li>Use the new field <em>max_connections</em> in <a href="/bots/api#setwebhook">setWebhook</a> to optimize your bot's server load</li> <li>Use <em>allowed_updates</em> in <a href="/bots/api#setwebhook">setWebhook</a> and <a href="/bots/api#getupdates">getUpdates</a> to selectively subscribe to updates of a certain type. Among other things, this allows you to stop getting updates about new posts in channels where your bot is an admin.</li> <li><a href="/bots/api#deletewebhook">deleteWebhook</a> moved out of <a href="/bots/api#setwebhook">setWebhook</a> to get a whole separate method for itself.</li> </ul> -<h4><a class="anchor" href="#november-21-2016" id="november-21-2016" name="november-21-2016"><i class="anchor-icon"></i></a>November 21, 2016</h4> +<h4><a class="anchor" name="november-21-2016" href="#november-21-2016"><i class="anchor-icon"></i></a>November 21, 2016</h4> <p><strong>Bot API 2.3</strong></p> <ul> -<li> -<p>Modified <a href="/bots/faq#what-messages-will-my-bot-get"><strong>bot privacy mode</strong></a> for the sake of consistency. </p> +<li>Modified <a href="/bots/faq#what-messages-will-my-bot-get"><strong>bot privacy mode</strong></a> for the sake of consistency. </li> +<li><p>Your bot can now get <strong>updates about posts in channels</strong>. Added new fields <em>channel_post</em> and <em>edited_channel_post</em> to <a href="/bots/#update">Update</a>.</p> </li> -<li> -<p>Your bot can now get <strong>updates about posts in channels</strong>. Added new fields <em>channel_post</em> and <em>edited_channel_post</em> to <a href="/bots/#update">Update</a>.</p> -</li> -<li> -<p>You can now update high scores to a lower value by using the new <em>force</em> parameter in <a href="/bots/#setgamescore">setGameScore</a>. Handy for punishing <strong>cheaters</strong> or fixing errors in your game's High Score table.</p> -</li> -<li> -<p>Starting today, messages with high scores will be updated with new high scores by default. Use <em>disable_edit_message</em> in <a href="/bots/#setgamescore">setGameScore</a> if you don't want this.</p> -</li> -<li> -<p>The <em>edit_message</em> parameter from <a href="/bots/#setgamescore">setGameScore</a> is no longer in use. For backward compatibility, it will be taken into account for a while, unless <em>disable_edit_message</em> is passed explicitly.</p> -</li> -<li> -<p>Added the new field <em>forward_from_message_id</em> to <a href="/bots/#message">Message</a>.</p> -</li> -<li> -<p>Added the new parameter <em>cache_time</em> to <a href="/bots/#answercallbackquery">answerCallbackQuery</a>. Will eventually work in Telegram apps — somewhere after version 3.14, maybe 3.15.</p> -</li> -<li> -<p>Renamed <em>hide_keyboard</em> to <em>remove_keyboard</em> in <a href="/bots/#replykeyboardremove">ReplyKeyboardRemove</a> for clarity. <em>hide_keyboard</em> will still work for a while for backward compatibility.</p> +<li><p>You can now update high scores to a lower value by using the new <em>force</em> parameter in <a href="/bots/#setgamescore">setGameScore</a>. Handy for punishing <strong>cheaters</strong> or fixing errors in your game's High Score table.</p> </li> +<li>Starting today, messages with high scores will be updated with new high scores by default. Use <em>disable_edit_message</em> in <a href="/bots/#setgamescore">setGameScore</a> if you don't want this.</li> +<li>The <em>edit_message</em> parameter from <a href="/bots/#setgamescore">setGameScore</a> is no longer in use. For backward compatibility, it will be taken into account for a while, unless <em>disable_edit_message</em> is passed explicitly.</li> +<li>Added the new field <em>forward_from_message_id</em> to <a href="/bots/#message">Message</a>.</li> +<li>Added the new parameter <em>cache_time</em> to <a href="/bots/#answercallbackquery">answerCallbackQuery</a>. Will eventually work in Telegram apps — somewhere after version 3.14, maybe 3.15.</li> +<li>Renamed <em>hide_keyboard</em> to <em>remove_keyboard</em> in <a href="/bots/#replykeyboardremove">ReplyKeyboardRemove</a> for clarity. <em>hide_keyboard</em> will still work for a while for backward compatibility.</li> </ul> -<h4><a class="anchor" href="#october-3-2016" id="october-3-2016" name="october-3-2016"><i class="anchor-icon"></i></a>October 3, 2016</h4> -<p><strong>Bot API 2.2.</strong> <a href="/bots/games">Introducing a new Gaming Platform!</a> See <a href="/bots/games">this introduction</a> for a brief overview. -If you're not a developer, you may like <a href="https://telegram.org/blog/games"><strong>this user-friendly blog post</strong></a> better.</p> +<h4><a class="anchor" name="october-3-2016" href="#october-3-2016"><i class="anchor-icon"></i></a>October 3, 2016</h4> +<p><strong>Bot API 2.2.</strong> <a href="/bots/games">Introducing a new Gaming Platform!</a> See <a href="/bots/games">this introduction</a> for a brief overview.<br>If you're not a developer, you may like <a href="https://telegram.org/blog/games"><strong>this user-friendly blog post</strong></a> better.</p> <ul> <li>New tools for building <a href="/bots/api#games"><strong>HTML5 games</strong></a>.</li> <li>New method <a href="/bots/api#sendgame">sendGame</a>, new object <a href="/bots/api#inlinequeryresultgame">InlineQueryResultGame</a>, new field <em>game</em> in <a href="/bots/api#message">Message</a>.</li> @@ -671,50 +649,40 @@ If you're not a developer, you may like <a href="https://telegram.org/blog/games </ul> <p><strong>Other changes</strong></p> <ul> -<li> -<p>Making life easier for webhook users. Added a detailed <a href="https://core.telegram.org/bots/webhooks"><strong>Guide to All Things Webhook</strong></a> that describes every pothole you can run into on the webhook road.</p> +<li>Making life easier for webhook users. Added a detailed <a href="https://core.telegram.org/bots/webhooks"><strong>Guide to All Things Webhook</strong></a> that describes every pothole you can run into on the webhook road.</li> +<li><p>New method <a href="/bots/api#getwebhookinfo">getWebhookInfo</a> to check current webhook status.</p> </li> -<li> -<p>New method <a href="/bots/api#getwebhookinfo">getWebhookInfo</a> to check current webhook status.</p> -</li> -<li> -<p>Added the option to specify an <strong>HTTP URL</strong> for a file in all methods where <a href="/bots/api#inputfile">InputFile</a> or <em>file_id</em> can be used (except voice messages). Telegram will get the file from the specified URL and send it to the user. Files must be smaller than 5 MB for photos and smaller than 20 MB for all other types of content.</p> -</li> -<li> -<p>Use the new <em>url</em> parameter in <a href="/bots/api#answercallbackquery">answerCallbackQuery</a> to create buttons that open your bot with user-specific parameters.</p> -</li> -<li> -<p>Added new field <em>switch_inline_query_current_chat</em> in <a href="/bots/api#inlinekeyboardbutton">InlineKeyboardButton</a>.</p> -</li> -<li> -<p>Added <em>caption</em> fields to <a href="/bots/api#sendaudio">sendAudio</a>, <a href="/bots/api#sendvoice">sendVoice</a>, <a href="/bots/api#inlinequeryresultaudio">InlineQueryResultAudio</a>, <a href="/bots/api#inlinequeryresultvoice">InlineQueryResultVoice</a>, <a href="/bots/api#inlinequeryresultcachedaudio">InlineQueryResultCachedAudio</a>, and <a href="/bots/api#inlinequeryresultcachedvoice">InlineQueryResultCachedVoice</a>.</p> +<li><p>Added the option to specify an <strong>HTTP URL</strong> for a file in all methods where <a href="/bots/api#inputfile">InputFile</a> or <em>file_id</em> can be used (except voice messages). Telegram will get the file from the specified URL and send it to the user. Files must be smaller than 5 MB for photos and smaller than 20 MB for all other types of content.</p> </li> +<li>Use the new <em>url</em> parameter in <a href="/bots/api#answercallbackquery">answerCallbackQuery</a> to create buttons that open your bot with user-specific parameters.</li> +<li>Added new field <em>switch_inline_query_current_chat</em> in <a href="/bots/api#inlinekeyboardbutton">InlineKeyboardButton</a>.</li> +<li>Added <em>caption</em> fields to <a href="/bots/api#sendaudio">sendAudio</a>, <a href="/bots/api#sendvoice">sendVoice</a>, <a href="/bots/api#inlinequeryresultaudio">InlineQueryResultAudio</a>, <a href="/bots/api#inlinequeryresultvoice">InlineQueryResultVoice</a>, <a href="/bots/api#inlinequeryresultcachedaudio">InlineQueryResultCachedAudio</a>, and <a href="/bots/api#inlinequeryresultcachedvoice">InlineQueryResultCachedVoice</a>.</li> </ul> <ul> <li>New field <em>all_members_are_administrators</em> in the <a href="/bots/api#chat">Chat</a> object.</li> <li>Certain server responses may now contain the new <a href="/bots/api#responseparameters"><em>parameters</em></a> field with expanded info on errors that occurred while processing your requests.</li> </ul> -<h4><a class="anchor" href="#may-25-2016" id="may-25-2016" name="may-25-2016"><i class="anchor-icon"></i></a>May 25, 2016</h4> +<h4><a class="anchor" name="may-25-2016" href="#may-25-2016"><i class="anchor-icon"></i></a>May 25, 2016</h4> <ul> <li><a href="/bots/api#inlinekeyboardmarkup">Inline keyboards</a> may now be used in group chats. Channels coming soon.</li> <li>Check out <a href="https://telegram.me/vote">@vote</a> and <a href="https://telegram.me/like">@like</a> for examples.</li> </ul> -<h4><a class="anchor" href="#may-22-2016" id="may-22-2016" name="may-22-2016"><i class="anchor-icon"></i></a>May 22, 2016</h4> +<h4><a class="anchor" name="may-22-2016" href="#may-22-2016"><i class="anchor-icon"></i></a>May 22, 2016</h4> <ul> -<li><strong>Bot API 2.1.</strong> Added more tools for group administrator bots. Your bot can now get a list of administrators and members count in a group, check a user's current status (administrator, creator, left the group, kicked from the group), and leave a group.</li> +<li><strong>Bot API 2.1.</strong> Added more tools for group administrator bots. Your bot can now get a list of administrators and members count in a group, check a user's current status (administrator, creator, left the group, kicked from the group), and leave a group.</li> <li>Added new methods: <a href="/bots/api#getchat">getChat</a>, <a href="/bots/api#leavechat">leaveChat</a>, <a href="/bots/api#getchatadministrators">getChatAdministrators</a>, <a href="/bots/api#getchatmember">getChatMember</a>, <a href="/bots/api#getchatmemberscount">getChatMembersCount</a>.</li> <li>Added support for <a href="https://telegram.org/blog/edit">edited messages</a> and <a href="https://telegram.org/blog/edit#new-mentions">new mentions</a> from Telegram v.3.9. New fields: <em>edited_message</em> in <a href="/bots/api#update">Update</a>, <em>edit_date</em> in <a href="/bots/api#message">Message</a>, <em>user</em> in <a href="/bots/api#messageentity">MessageEntity</a>. New value <em>text_mention</em> for the <em>type</em> field in <a href="/bots/api#messageentity">MessageEntity</a>.</li> </ul> -<h4><a class="anchor" href="#may-12-2016" id="may-12-2016" name="may-12-2016"><i class="anchor-icon"></i></a>May 12, 2016</h4> +<h4><a class="anchor" name="may-12-2016" href="#may-12-2016"><i class="anchor-icon"></i></a>May 12, 2016</h4> <ul> <li>Added consistency to what messages bots get in groups and supergroups. <a href="/bots/faq#what-messages-will-my-bot-get">See updated FAQ for details »</a></li> </ul> -<h4><a class="anchor" href="#may-6-2016" id="may-6-2016" name="may-6-2016"><i class="anchor-icon"></i></a>May 6, 2016</h4> +<h4><a class="anchor" name="may-6-2016" href="#may-6-2016"><i class="anchor-icon"></i></a>May 6, 2016</h4> <ul> <li>Added the field <em>emoji</em> to the <a href="/bots/api#sticker">Sticker</a> object. Your bot can now know the emoji a sticker corresponds to.</li> <li>Added the field <em>forward_from_chat</em> to the <a href="/bots/api#message">Message</a> object for messages forwarded from channels.</li> </ul> -<h4><a class="anchor" href="#april-9-2016" id="april-9-2016" name="april-9-2016"><i class="anchor-icon"></i></a>April 9, 2016</h4> +<h4><a class="anchor" name="april-9-2016" href="#april-9-2016"><i class="anchor-icon"></i></a>April 9, 2016</h4> <p>Introducing <strong>Bot API 2.0</strong>. Check out <a href="/bots/2-0-intro">this page</a> for a review of this major update.</p> <ul> <li>New <a href="/bots/2-0-intro#new-inline-keyboards"><strong>inline keyboards</strong></a> with <strong>callback</strong> and <strong>URL buttons</strong>. Added new objects <a href="/bots/api#inlinekeyboardmarkup">InlineKeyboardMarkup</a>, <a href="/bots/api#inlinekeyboardbutton">InlineKeyboardButton</a> and <a href="/bots/api#callbackquery">CallbackQuery</a>, added <em>reply_markup</em> fields to all <a href="/bots/api#inlinequeryresult">InlineQueryResult</a> objects. Added field <em>callback_query</em> to the <a href="/bots/api#update">Update</a> object, new method <a href="/bots/api#answercallbackquery">answerCallbackQuery</a>.</li> @@ -734,71 +702,72 @@ If you're not a developer, you may like <a href="https://telegram.org/blog/games <li>Added fields <em>venue</em>, <em>pinned_message</em> and <em>entities</em> to the <a href="/bots/api#message">Message</a> object. Added new objects <a href="/bots/api#messageentity">MessageEntity</a> and <a href="/bots/api#venue">Venue</a>, new methods <a href="/bots/api#sendvenue">sendVenue</a> and <a href="/bots/api#sendcontact">sendContact</a>.</li> <li>Renamed the fields <em>new_chat_participant</em> and <em>left_chat_participant</em> of the <a href="/bots/api#message">Message</a> object to <em>new_chat_member</em> and <em>left_chat_member</em>.</li> </ul> -<h4><a class="anchor" href="#february-20-2016" id="february-20-2016" name="february-20-2016"><i class="anchor-icon"></i></a>February 20, 2016</h4> +<h4><a class="anchor" name="february-20-2016" href="#february-20-2016"><i class="anchor-icon"></i></a>February 20, 2016</h4> <ul> <li>Added the <em>disable_notification</em> parameter to all methods that send messages or any kind.</li> <li>Removed backward compatibility from the method <a href="/bots/api#sendaudio">sendAudio</a>. Voice messages now must be sent using the method <a href="/bots/api#sendvoice">sendVoice</a>. There is no more need to specify a non-empty title or performer while sending the audio by <em>file_id</em>.</li> </ul> -<h4><a class="anchor" href="#january-20-2016" id="january-20-2016" name="january-20-2016"><i class="anchor-icon"></i></a>January 20, 2016</h4> +<h4><a class="anchor" name="january-20-2016" href="#january-20-2016"><i class="anchor-icon"></i></a>January 20, 2016</h4> <ul> -<li>By the way, you can use both HTML-style and markdown-style formatting in your bot's messages to send bold, italic or fixed-width text and inline links. All official Telegram clients support this. See <a href="/bots/api#formatting-options">Formatting options</a> for details.</li> +<li>By the way, you can use both HTML-style and markdown-style formatting in your bot's messages to send bold, italic or fixed-width text and inline links. All official Telegram clients support this. See <a href="/bots/api#formatting-options">Formatting options</a> for details.</li> </ul> -<h4><a class="anchor" href="#january-14-2016" id="january-14-2016" name="january-14-2016"><i class="anchor-icon"></i></a>January 14, 2016</h4> +<h4><a class="anchor" name="january-14-2016" href="#january-14-2016"><i class="anchor-icon"></i></a>January 14, 2016</h4> <ul> <li>You can now <a href="/bots/inline#collecting-feedback">collect feedback</a> on which results provided by your inline bot get chosen by the users. Added the <code>setinlinefeedback</code> command for Botfather, new type <a href="/bots/api#choseninlineresult">ChosenInlineResult</a>, new field <em>chosen_inline_result</em> to the <a href="/bots/api#update">Update</a> object.</li> </ul> -<h4><a class="anchor" href="#january-4-2016" id="january-4-2016" name="january-4-2016"><i class="anchor-icon"></i></a>January 4, 2016</h4> +<h4><a class="anchor" name="january-4-2016" href="#january-4-2016"><i class="anchor-icon"></i></a>January 4, 2016</h4> <ul> <li>Added support for <a href="/bots/inline">Inline Mode</a>, a new way for people to contact your bot by typing its username and a query in the text input field in any chat. Enable by sending <code>/setinline</code> to <a href="https://telegram.me/botfather">@BotFather</a>.</li> <li>New optional field <em>inline_query</em> added to the <a href="/bots/api#update">Update</a> object.</li> <li>Added new method <a href="/bots/api#answerinlinequery">answerInlineQuery</a> and new objects <a href="/bots/api#inlinequery">InlineQuery</a>, <a href="/bots/api#inlinequeryresultarticle">InlineQueryResultArticle</a>, <a href="/bots/api#inlinequeryresultphoto">InlineQueryResultPhoto</a>, <a href="/bots/api#inlinequeryresultgif">InlineQueryResultGif</a>, <a href="/bots/api#inlinequeryresultmpeg4gif">InlineQueryResultMpeg4Gif</a> and <a href="/bots/api#inlinequeryresultvideo">InlineQueryResultVideo</a>.</li> </ul> -<h3><a class="anchor" href="#2015" id="2015" name="2015"><i class="anchor-icon"></i></a>2015</h3> -<h4><a class="anchor" href="#november-2015" id="november-2015" name="november-2015"><i class="anchor-icon"></i></a>November, 2015</h4> +<h3><a class="anchor" name="2015" href="#2015"><i class="anchor-icon"></i></a>2015</h3> +<h4><a class="anchor" name="november-2015" href="#november-2015"><i class="anchor-icon"></i></a>November, 2015</h4> <ul> -<li>Added support for <a href="https://telegram.org/blog/supergroups">supergroups</a>. The <em>Type</em> field in the <a href="/bots/api#chat">Chat</a> object can now contain 'supergroup'.</li> +<li>Added support for <a href="https://telegram.org/blog/supergroups">supergroups</a>. The <em>Type</em> field in the <a href="/bots/api#chat">Chat</a> object can now contain 'supergroup'.</li> <li>New optional fields added to the <a href="/bots/api#message">Message</a> object: <em>supergroup_chat_created</em>, <em>migrate_to_chat_id</em>, <em>migrate_from_chat_id</em> and <em>channel_chat_created</em>.</li> </ul> -<h4><a class="anchor" href="#october-8-2015" id="october-8-2015" name="october-8-2015"><i class="anchor-icon"></i></a>October 8, 2015</h4> +<h4><a class="anchor" name="october-8-2015" href="#october-8-2015"><i class="anchor-icon"></i></a>October 8, 2015</h4> <ul> <li>Added initial channel support for bots (no Telegram clients support this at the moment, please wait for updates):</li> <li>The <em>Chat</em> field in the <a href="/bots/api#message">Message</a> is now of the new type <a href="/bots/api#chat">Chat</a>.</li> -<li>You can now pass a channel username (in the format <code>@channelusername</code>) in the place of <em>chat_id</em> in all methods (and instead of <em>from_chat_id</em> in <a href="/bots/api#forwardmessage">forwardMessage</a>). For this to work, the bot must be an administrator in the channel (and that's exactly what Telegram clients don't support yet — adding bots as administrators coming soon).</li> +<li>You can now pass a channel username (in the format <code>@channelusername</code>) in the place of <em>chat_id</em> in all methods (and instead of <em>from_chat_id</em> in <a href="/bots/api#forwardmessage">forwardMessage</a>). For this to work, the bot must be an administrator in the channel (and that's exactly what Telegram clients don't support yet — adding bots as administrators coming soon).</li> </ul> -<h4><a class="anchor" href="#september-18-2015" id="september-18-2015" name="september-18-2015"><i class="anchor-icon"></i></a>September 18, 2015</h4> +<h4><a class="anchor" name="september-18-2015" href="#september-18-2015"><i class="anchor-icon"></i></a>September 18, 2015</h4> <ul> <li>Bots can now download files and media sent by users.</li> <li>Added <a href="/bots/api#getfile">getFile</a> and <a href="/bots/api#file">File</a>.</li> </ul> -<h4><a class="anchor" href="#september-7-2015" id="september-7-2015" name="september-7-2015"><i class="anchor-icon"></i></a>September 7, 2015</h4> +<h4><a class="anchor" name="september-7-2015" href="#september-7-2015"><i class="anchor-icon"></i></a>September 7, 2015</h4> <ul> -<li>You can now <a href="/bots/api#making-requests">pass parameters</a> using <em>application/json</em> (please note that this doesn't work for file uploads: use <em>multipart/form-data</em> to upload files).</li> +<li>You can now <a href="/bots/api#making-requests">pass parameters</a> using <em>application/json</em> (please note that this doesn't work for file uploads: use <em>multipart/form-data</em> to upload files).</li> <li>Added very basic <a href="/bots/api#using-markdown">markdown support</a>. New field <em>parse_mode</em> added to <a href="/bots/api#sendmessage">sendMessage</a>. For the moment messages with markdown will be displayed correctly only in Telegram for <strong>Android</strong>. Other official apps will catch up soon.</li> </ul> -<h4><a class="anchor" href="#august-29-2015" id="august-29-2015" name="august-29-2015"><i class="anchor-icon"></i></a>August 29, 2015</h4> +<h4><a class="anchor" name="august-29-2015" href="#august-29-2015"><i class="anchor-icon"></i></a>August 29, 2015</h4> <ul> <li>Added support for self-signed certificates: upload your certificate using the <em>certificate</em> parameter in the <a href="/bots/api#setwebhook">setWebhook</a> method.</li> <li>You can now make <a href="/bots/api#making-requests-when-getting-updates">new requests</a> when responding to webhook updates.</li> </ul> -<h4><a class="anchor" href="#august-15-2015" id="august-15-2015" name="august-15-2015"><i class="anchor-icon"></i></a>August 15, 2015</h4> +<h4><a class="anchor" name="august-15-2015" href="#august-15-2015"><i class="anchor-icon"></i></a>August 15, 2015</h4> <ul> <li>Added new type <strong><a href="/bots/api#voice">Voice</a></strong> and new method <a href="/bots/api#sendvoice"><strong>sendVoice</strong></a> for sending voice messages.</li> <li>Earlier <strong><a href="/bots/api#audio">Audio</a></strong> and <strong><a href="/bots/api#sendaudio">sendAudio</a></strong> should now be used for sending music files. Telegram clients will show such files in the in-app music player. If you were using <a href="/bots/api#sendaudio"><strong>sendAudio</strong></a> for your bot to send voice messages, please use <a href="/bots/api#sendaudio"><strong>sendVoice</strong></a> instead.</li> <li>Added optional fields <em>performer</em>, <em>title</em> to the <a href="/bots/api#audio"><strong>Audio</strong></a> object and <a href="/bots/api#sendaudio"><strong>sendAudio</strong></a> method.</li> <li>Added optional field <em>voice</em> to the <a href="/bots/api#message"><strong>Message</strong></a> object.</li> </ul> -<h4><a class="anchor" href="#july-2015" id="july-2015" name="july-2015"><i class="anchor-icon"></i></a>July 2015</h4> +<h4><a class="anchor" name="july-2015" href="#july-2015"><i class="anchor-icon"></i></a>July 2015</h4> <ul> <li>The <strong>thumb</strong> field is now optional for <a href="/bots/api#video">Video</a>, <a href="/bots/api#sticker">Sticker</a> and <a href="/bots/api#document">Document</a> objects</li> <li>The API now supports both video and photo captions. The <strong>caption</strong> field has been removed from the <a href="/bots/api#video">Video</a> object and added to the <a href="/bots/api#message">Message</a> object instead. </li> <li><strong>caption</strong> and <strong>duration</strong> optional fields have been added to the <a href="/bots/api#sendvideo">sendVideo</a> method.</li> <li>Fixed typo: <strong>user_id</strong> in the Contact object is now correctly labeled as Integer, not String</li> </ul> -<h4><a class="anchor" href="#june-24-2015" id="june-24-2015" name="june-24-2015"><i class="anchor-icon"></i></a>June 24, 2015</h4> +<h4><a class="anchor" name="june-24-2015" href="#june-24-2015"><i class="anchor-icon"></i></a>June 24, 2015</h4> <p>The bot platform is <a href="https://telegram.org/blog/bot-revolution">officially launched</a>.</p> <blockquote> <p><strong><a href="/bots/api">Back to the Bot API Manual »</a></strong></p> -</blockquote></div> +</blockquote> +</div> </div> diff --git a/data/web/corefork.telegram.org/bots/api.html b/data/web/corefork.telegram.org/bots/api.html index 93bbd2d1bb..5c081cc088 100644 --- a/data/web/corefork.telegram.org/bots/api.html +++ b/data/web/corefork.telegram.org/bots/api.html @@ -47,14 +47,13 @@ To learn how to create…"> <div id="dev_page_content"><!-- scroll_nav --> <blockquote> -<p>The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram. -To learn how to create and set up a bot, please consult our <a href="/bots"><strong>Introduction to Bots</strong></a> and <a href="/bots/faq"><strong>Bot FAQ</strong></a>.</p> +<p>The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.<br>To learn how to create and set up a bot, please consult our <a href="/bots"><strong>Introduction to Bots</strong></a> and <a href="/bots/faq"><strong>Bot FAQ</strong></a>.</p> </blockquote> -<h3><a class="anchor" href="#recent-changes" id="recent-changes" name="recent-changes"><i class="anchor-icon"></i></a>Recent changes</h3> +<h3><a class="anchor" name="recent-changes" href="#recent-changes"><i class="anchor-icon"></i></a>Recent changes</h3> <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" href="#april-21-2023" id="april-21-2023" name="april-21-2023"><i class="anchor-icon"></i></a>April 21, 2023</h4> +<h4><a class="anchor" name="april-21-2023" href="#april-21-2023"><i class="anchor-icon"></i></a>April 21, 2023</h4> <p><strong>Bot API 6.7</strong></p> <ul> <li>Added support for launching <a href="/bots/webapps">Web Apps</a> from inline query results by replacing the parameters <em>switch_pm_text</em> and <em>switch_pm_parameter</em> of the method <a href="#answerinlinequery">answerInlineQuery</a> with the parameter <em>button</em> of type <a href="#inlinequeryresultsbutton">InlineQueryResultsButton</a>.</li> @@ -63,10 +62,10 @@ To learn how to create and set up a bot, please consult our <a href="/bots"><str <li>Added the field <em>via_chat_folder_invite_link</em> to the class <a href="#chatmemberupdated">ChatMemberUpdated</a>.</li> <li>Added the ability to set different bot names for different user languages using the method <a href="#setmyname">setMyName</a>.</li> <li>Added the ability to get the current bot name in the given language as the class <a href="#botname">BotName</a> using the method <a href="#getmyname">getMyName</a>.</li> -<li>Added the ability to change bot settings from the bot's profile in official Telegram apps, including the ability to set animated profile photos.</li> +<li>Added the ability to change bot settings from the bot's profile in official Telegram apps, including the ability to set animated profile photos.</li> <li>Added the ability to specify custom emoji entities using <a href="#html-style">HTML</a> and <a href="#markdownv2-style">MarkdownV2</a> formatting options for bots that purchased additional usernames on <a href="https://fragment.com">Fragment</a>.</li> </ul> -<h4><a class="anchor" href="#march-9-2023" id="march-9-2023" name="march-9-2023"><i class="anchor-icon"></i></a>March 9, 2023</h4> +<h4><a class="anchor" name="march-9-2023" href="#march-9-2023"><i class="anchor-icon"></i></a>March 9, 2023</h4> <p><strong>Bot API 6.6</strong></p> <ul> <li>Added the ability to set different bot descriptions for different user languages using the method <a href="#setmydescription">setMyDescription</a>.</li> @@ -95,7 +94,7 @@ To learn how to create and set up a bot, please consult our <a href="/bots"><str <li>Renamed the field <em>thumb_url</em> in the classes <a href="#inlinequeryresultphoto">InlineQueryResultPhoto</a> and <a href="#inlinequeryresultvideo">InlineQueryResultVideo</a> to <em>thumbnail_url</em>.</li> <li>Renamed the fields <em>thumb_url</em> and <em>thumb_mime_type</em> in the classes <a href="#inlinequeryresultgif">InlineQueryResultGif</a>, and <a href="#inlinequeryresultmpeg4gif">InlineQueryResultMpeg4Gif</a> to <em>thumbnail_url</em> and <em>thumbnail_mime_type</em> respectively.</li> </ul> -<h4><a class="anchor" href="#february-3-2023" id="february-3-2023" name="february-3-2023"><i class="anchor-icon"></i></a>February 3, 2023</h4> +<h4><a class="anchor" name="february-3-2023" href="#february-3-2023"><i class="anchor-icon"></i></a>February 3, 2023</h4> <p><strong>Bot API 6.5</strong></p> <ul> <li>Added <a href="https://telegram.org/blog/profile-pics-emoji-translations#chat-selection-for-bots">requests for users and chats</a> and support for <a href="https://telegram.org/blog/profile-pics-emoji-translations#granular-media-permissions">granular media permissions</a>.</li> @@ -107,9 +106,9 @@ To learn how to create and set up a bot, please consult our <a href="/bots"><str <li>Added the field <em>user_chat_id</em> to the class <a href="#chatjoinrequest">ChatJoinRequest</a>.</li> </ul> <p><strong><a href="/bots/api-changelog">See earlier changes »</a></strong></p> -<h3><a class="anchor" href="#authorizing-your-bot" id="authorizing-your-bot" name="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'll use simply <strong><token></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> -<h3><a class="anchor" href="#making-requests" id="making-requests" name="making-requests"><i class="anchor-icon"></i></a>Making requests</h3> +<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'll use simply <strong><token></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> +<h3><a class="anchor" name="making-requests" href="#making-requests"><i class="anchor-icon"></i></a>Making requests</h3> <p>All queries to the Telegram Bot API must be served over HTTPS and need to be presented in this form: <code>https://api.telegram.org/bot<token>/METHOD_NAME</code>. Like this for example:</p> <pre><code>https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getMe</code></pre> <p>We support <strong>GET</strong> and <strong>POST</strong> HTTP methods. We support four ways of passing parameters in Bot API requests:</p> @@ -119,17 +118,17 @@ To learn how to create and set up a bot, please consult our <a href="/bots"><str <li>application/json (except for uploading files)</li> <li>multipart/form-data (use to upload files)</li> </ul> -<p>The response contains a JSON object, which always has a Boolean field 'ok' and may have an optional String field 'description' with a human-readable description of the result. If 'ok' equals <em>True</em>, the request was successful and the result of the query can be found in the 'result' field. In case of an unsuccessful request, 'ok' equals false and the error is explained in the 'description'. An Integer 'error_code' field is also returned, but its contents are subject to change in the future. Some errors may also have an optional field 'parameters' of the type <a href="#responseparameters">ResponseParameters</a>, which can help to automatically handle the error.</p> +<p>The response contains a JSON object, which always has a Boolean field 'ok' and may have an optional String field 'description' with a human-readable description of the result. If 'ok' equals <em>True</em>, the request was successful and the result of the query can be found in the 'result' field. In case of an unsuccessful request, 'ok' equals false and the error is explained in the 'description'. An Integer 'error_code' field is also returned, but its contents are subject to change in the future. Some errors may also have an optional field 'parameters' of the type <a href="#responseparameters">ResponseParameters</a>, which can help to automatically handle the error.</p> <ul> <li>All methods in the Bot API are case-insensitive.</li> <li>All queries must be made using UTF-8.</li> </ul> -<h4><a class="anchor" href="#making-requests-when-getting-updates" id="making-requests-when-getting-updates" name="making-requests-when-getting-updates"><i class="anchor-icon"></i></a>Making requests when getting updates</h4> -<p>If you're using <a href="#getting-updates"><strong>webhooks</strong></a>, you can perform a request to the Bot API while sending an answer to the webhook. Use either <em>application/json</em> or <em>application/x-www-form-urlencoded</em> or <em>multipart/form-data</em> response content type for passing parameters. Specify the method to be invoked in the <em>method</em> parameter of the request. It's not possible to know that such a request was successful or get its result.</p> +<h4><a class="anchor" name="making-requests-when-getting-updates" href="#making-requests-when-getting-updates"><i class="anchor-icon"></i></a>Making requests when getting updates</h4> +<p>If you're using <a href="#getting-updates"><strong>webhooks</strong></a>, you can perform a request to the Bot API while sending an answer to the webhook. Use either <em>application/json</em> or <em>application/x-www-form-urlencoded</em> or <em>multipart/form-data</em> response content type for passing parameters. Specify the method to be invoked in the <em>method</em> parameter of the request. It's not possible to know that such a request was successful or get its result.</p> <blockquote> <p>Please see our <a href="/bots/faq#how-can-i-make-requests-in-response-to-updates">FAQ</a> for examples.</p> </blockquote> -<h3><a class="anchor" href="#using-a-local-bot-api-server" id="using-a-local-bot-api-server" name="using-a-local-bot-api-server"><i class="anchor-icon"></i></a>Using a Local Bot API Server</h3> +<h3><a class="anchor" name="using-a-local-bot-api-server" href="#using-a-local-bot-api-server"><i class="anchor-icon"></i></a>Using a Local Bot API Server</h3> <p>The Bot API server source code is available at <a href="https://github.com/tdlib/telegram-bot-api">telegram-bot-api</a>. You can run it locally and send the requests to your own server instead of <code>https://api.telegram.org</code>. If you switch to a local Bot API server, your bot will be able to:</p> <ul> <li>Download files without a size limit.</li> @@ -141,14 +140,13 @@ To learn how to create and set up a bot, please consult our <a href="/bots"><str <li>Set <em>max_webhook_connections</em> up to 100000.</li> <li>Receive the absolute local path as a value of the <em>file_path</em> field without the need to download the file after a <a href="#getfile">getFile</a> request.</li> </ul> -<h4><a class="anchor" href="#do-i-need-a-local-bot-api-server" id="do-i-need-a-local-bot-api-server" name="do-i-need-a-local-bot-api-server"><i class="anchor-icon"></i></a>Do I need a Local Bot API Server</h4> -<p>The majority of bots will be OK with the default configuration, running on our servers. But if you feel that you need one of <a href="#using-a-local-bot-api-server">these features</a>, you're welcome to switch to your own at any time.</p> -<h3><a class="anchor" href="#getting-updates" id="getting-updates" name="getting-updates"><i class="anchor-icon"></i></a>Getting updates</h3> +<h4><a class="anchor" name="do-i-need-a-local-bot-api-server" href="#do-i-need-a-local-bot-api-server"><i class="anchor-icon"></i></a>Do I need a Local Bot API Server</h4> +<p>The majority of bots will be OK with the default configuration, running on our servers. But if you feel that you need one of <a href="#using-a-local-bot-api-server">these features</a>, you're welcome to switch to your own at any time.</p> +<h3><a class="anchor" name="getting-updates" href="#getting-updates"><i class="anchor-icon"></i></a>Getting updates</h3> <p>There are two mutually exclusive ways of receiving updates for your bot - the <a href="#getupdates">getUpdates</a> method on one hand and <a href="#setwebhook">webhooks</a> on the other. Incoming updates are stored on the server until the bot receives them either way, but they will not be kept longer than 24 hours.</p> <p>Regardless of which option you choose, you will receive JSON-serialized <a href="#update">Update</a> objects as a result.</p> -<h4><a class="anchor" href="#update" id="update" name="update"><i class="anchor-icon"></i></a>Update</h4> -<p>This <a href="#available-types">object</a> represents an incoming update. -At most <strong>one</strong> of the optional parameters can be present in any given update.</p> +<h4><a class="anchor" name="update" href="#update"><i class="anchor-icon"></i></a>Update</h4> +<p>This <a href="#available-types">object</a> represents an incoming update.<br>At most <strong>one</strong> of the optional parameters can be present in any given update.</p> <table class="table"> <thead> <tr> @@ -161,7 +159,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>update_id</td> <td>Integer</td> -<td>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 <a href="#setwebhook">webhooks</a>, 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.</td> +<td>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 <a href="#setwebhook">webhooks</a>, 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.</td> </tr> <tr> <td>message</td> @@ -221,12 +219,12 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>my_chat_member</td> <td><a href="#chatmemberupdated">ChatMemberUpdated</a></td> -<td><em>Optional</em>. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.</td> +<td><em>Optional</em>. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.</td> </tr> <tr> <td>chat_member</td> <td><a href="#chatmemberupdated">ChatMemberUpdated</a></td> -<td><em>Optional</em>. 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 <em>allowed_updates</em> to receive these updates.</td> +<td><em>Optional</em>. 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 <em>allowed_updates</em> to receive these updates.</td> </tr> <tr> <td>chat_join_request</td> @@ -235,7 +233,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#getupdates" id="getupdates" name="getupdates"><i class="anchor-icon"></i></a>getUpdates</h4> +<h4><a class="anchor" name="getupdates" href="#getupdates"><i class="anchor-icon"></i></a>getUpdates</h4> <p>Use this method to receive incoming updates using long polling (<a href="https://en.wikipedia.org/wiki/Push_technology#Long_polling">wiki</a>). Returns an Array of <a href="#update">Update</a> objects.</p> <table class="table"> <thead> @@ -269,18 +267,16 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <td>allowed_updates</td> <td>Array of String</td> <td>Optional</td> -<td>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 <a href="#update">Update</a> for a complete list of available update types. Specify an empty list to receive all update types except <em>chat_member</em> (default). If not specified, the previous setting will be used. <br><br>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.</td> +<td>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 <a href="#update">Update</a> for a complete list of available update types. Specify an empty list to receive all update types except <em>chat_member</em> (default). If not specified, the previous setting will be used.<br><br>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.</td> </tr> </tbody> </table> <blockquote> -<p><strong>Notes</strong> -<strong>1.</strong> This method will not work if an outgoing webhook is set up. -<strong>2.</strong> In order to avoid getting duplicate updates, recalculate <em>offset</em> after each server response.</p> +<p><strong>Notes</strong><br><strong>1.</strong> This method will not work if an outgoing webhook is set up.<br><strong>2.</strong> In order to avoid getting duplicate updates, recalculate <em>offset</em> after each server response.</p> </blockquote> -<h4><a class="anchor" href="#setwebhook" id="setwebhook" name="setwebhook"><i class="anchor-icon"></i></a>setWebhook</h4> +<h4><a class="anchor" name="setwebhook" href="#setwebhook"><i class="anchor-icon"></i></a>setWebhook</h4> <p>Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized <a href="#update">Update</a>. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns <em>True</em> on success.</p> -<p>If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter <em>secret_token</em>. If specified, the request will contain a header "X-Telegram-Bot-Api-Secret-Token" with the secret token as content.</p> +<p>If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter <em>secret_token</em>. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.</p> <table class="table"> <thead> <tr> @@ -313,13 +309,13 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <td>max_connections</td> <td>Integer</td> <td>Optional</td> -<td>The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to <em>40</em>. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.</td> +<td>The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to <em>40</em>. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.</td> </tr> <tr> <td>allowed_updates</td> <td>Array of String</td> <td>Optional</td> -<td>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 <a href="#update">Update</a> for a complete list of available update types. Specify an empty list to receive all update types except <em>chat_member</em> (default). If not specified, the previous setting will be used. <br>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.</td> +<td>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 <a href="#update">Update</a> for a complete list of available update types. Specify an empty list to receive all update types except <em>chat_member</em> (default). If not specified, the previous setting will be used.<br>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.</td> </tr> <tr> <td>drop_pending_updates</td> @@ -331,20 +327,15 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <td>secret_token</td> <td>String</td> <td>Optional</td> -<td>A secret token to be sent in a header "X-Telegram-Bot-Api-Secret-Token" in every webhook request, 1-256 characters. Only characters <code>A-Z</code>, <code>a-z</code>, <code>0-9</code>, <code>_</code> and <code>-</code> are allowed. The header is useful to ensure that the request comes from a webhook set by you.</td> +<td>A secret token to be sent in a header “X-Telegram-Bot-Api-Secret-Token” in every webhook request, 1-256 characters. Only characters <code>A-Z</code>, <code>a-z</code>, <code>0-9</code>, <code>_</code> and <code>-</code> are allowed. The header is useful to ensure that the request comes from a webhook set by you.</td> </tr> </tbody> </table> <blockquote> -<p><strong>Notes</strong> -<strong>1.</strong> You will not be able to receive updates using <a href="#getupdates">getUpdates</a> for as long as an outgoing webhook is set up. -<strong>2.</strong> To use a self-signed certificate, you need to upload your <a href="/bots/self-signed">public key certificate</a> using <em>certificate</em> parameter. Please upload as InputFile, sending a String will not work. -<strong>3.</strong> Ports currently supported <em>for webhooks</em>: <strong>443, 80, 88, 8443</strong>.</p> +<p><strong>Notes</strong><br><strong>1.</strong> You will not be able to receive updates using <a href="#getupdates">getUpdates</a> for as long as an outgoing webhook is set up.<br><strong>2.</strong> To use a self-signed certificate, you need to upload your <a href="/bots/self-signed">public key certificate</a> using <em>certificate</em> parameter. Please upload as InputFile, sending a String will not work.<br><strong>3.</strong> Ports currently supported <em>for webhooks</em>: <strong>443, 80, 88, 8443</strong>.</p> +<p>If you're having any trouble setting up webhooks, please check out this <a href="/bots/webhooks">amazing guide to webhooks</a>.</p> </blockquote> -<blockquote> -<p>If you're having any trouble setting up webhooks, please check out this <a href="/bots/webhooks">amazing guide to webhooks</a>.</p> -</blockquote> -<h4><a class="anchor" href="#deletewebhook" id="deletewebhook" name="deletewebhook"><i class="anchor-icon"></i></a>deleteWebhook</h4> +<h4><a class="anchor" name="deletewebhook" href="#deletewebhook"><i class="anchor-icon"></i></a>deleteWebhook</h4> <p>Use this method to remove webhook integration if you decide to switch back to <a href="#getupdates">getUpdates</a>. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -364,9 +355,9 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#getwebhookinfo" id="getwebhookinfo" name="getwebhookinfo"><i class="anchor-icon"></i></a>getWebhookInfo</h4> +<h4><a class="anchor" name="getwebhookinfo" href="#getwebhookinfo"><i class="anchor-icon"></i></a>getWebhookInfo</h4> <p>Use this method to get current webhook status. Requires no parameters. On success, returns a <a href="#webhookinfo">WebhookInfo</a> object. If the bot is using <a href="#getupdates">getUpdates</a>, will return an object with the <em>url</em> field empty.</p> -<h4><a class="anchor" href="#webhookinfo" id="webhookinfo" name="webhookinfo"><i class="anchor-icon"></i></a>WebhookInfo</h4> +<h4><a class="anchor" name="webhookinfo" href="#webhookinfo"><i class="anchor-icon"></i></a>WebhookInfo</h4> <p>Describes the current status of a webhook.</p> <table class="table"> <thead> @@ -424,13 +415,13 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h3><a class="anchor" href="#available-types" id="available-types" name="available-types"><i class="anchor-icon"></i></a>Available types</h3> +<h3><a class="anchor" name="available-types" href="#available-types"><i class="anchor-icon"></i></a>Available types</h3> <p>All types used in the Bot API responses are represented as JSON-objects.</p> <p>It is safe to use 32-bit signed integers for storing all <strong>Integer</strong> fields unless otherwise noted.</p> <blockquote> <p><strong>Optional</strong> fields may be not returned when irrelevant.</p> </blockquote> -<h4><a class="anchor" href="#user" id="user" name="user"><i class="anchor-icon"></i></a>User</h4> +<h4><a class="anchor" name="user" href="#user"><i class="anchor-icon"></i></a>User</h4> <p>This object represents a Telegram user or bot.</p> <table class="table"> <thead> @@ -454,22 +445,22 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>first_name</td> <td>String</td> -<td>User's or bot's first name</td> +<td>User's or bot's first name</td> </tr> <tr> <td>last_name</td> <td>String</td> -<td><em>Optional</em>. User's or bot's last name</td> +<td><em>Optional</em>. User's or bot's last name</td> </tr> <tr> <td>username</td> <td>String</td> -<td><em>Optional</em>. User's or bot's username</td> +<td><em>Optional</em>. User's or bot's username</td> </tr> <tr> <td>language_code</td> <td>String</td> -<td><em>Optional</em>. <a href="https://en.wikipedia.org/wiki/IETF_language_tag">IETF language tag</a> of the user's language</td> +<td><em>Optional</em>. <a href="https://en.wikipedia.org/wiki/IETF_language_tag">IETF language tag</a> of the user's language</td> </tr> <tr> <td>is_premium</td> @@ -498,7 +489,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#chat" id="chat" name="chat"><i class="anchor-icon"></i></a>Chat</h4> +<h4><a class="anchor" name="chat" href="#chat"><i class="anchor-icon"></i></a>Chat</h4> <p>This object represents a chat.</p> <table class="table"> <thead> @@ -517,7 +508,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>type</td> <td>String</td> -<td>Type of chat, can be either "private", "group", "supergroup" or "channel"</td> +<td>Type of chat, can be either “private”, “group”, “supergroup” or “channel”</td> </tr> <tr> <td>title</td> @@ -627,7 +618,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>has_protected_content</td> <td>True</td> -<td><em>Optional</em>. <em>True</em>, if messages from the chat can't be forwarded to other chats. Returned only in <a href="#getchat">getChat</a>.</td> +<td><em>Optional</em>. <em>True</em>, if messages from the chat can't be forwarded to other chats. Returned only in <a href="#getchat">getChat</a>.</td> </tr> <tr> <td>sticker_set_name</td> @@ -651,7 +642,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#message" id="message" name="message"><i class="anchor-icon"></i></a>Message</h4> +<h4><a class="anchor" name="message" href="#message"><i class="anchor-icon"></i></a>Message</h4> <p>This object represents a message.</p> <table class="table"> <thead> @@ -715,7 +706,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>forward_sender_name</td> <td>String</td> -<td><em>Optional</em>. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages</td> +<td><em>Optional</em>. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages</td> </tr> <tr> <td>forward_date</td> @@ -750,7 +741,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>has_protected_content</td> <td>True</td> -<td><em>Optional</em>. <em>True</em>, if the message can't be forwarded</td> +<td><em>Optional</em>. <em>True</em>, if the message can't be forwarded</td> </tr> <tr> <td>media_group_id</td> @@ -890,12 +881,12 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>supergroup_chat_created</td> <td>True</td> -<td><em>Optional</em>. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.</td> +<td><em>Optional</em>. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.</td> </tr> <tr> <td>channel_chat_created</td> <td>True</td> -<td><em>Optional</em>. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.</td> +<td><em>Optional</em>. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.</td> </tr> <tr> <td>message_auto_delete_timer_changed</td> @@ -955,7 +946,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>proximity_alert_triggered</td> <td><a href="#proximityalerttriggered">ProximityAlertTriggered</a></td> -<td><em>Optional</em>. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.</td> +<td><em>Optional</em>. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.</td> </tr> <tr> <td>forum_topic_created</td> @@ -980,12 +971,12 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>general_forum_topic_hidden</td> <td><a href="#generalforumtopichidden">GeneralForumTopicHidden</a></td> -<td><em>Optional</em>. Service message: the 'General' forum topic hidden</td> +<td><em>Optional</em>. Service message: the 'General' forum topic hidden</td> </tr> <tr> <td>general_forum_topic_unhidden</td> <td><a href="#generalforumtopicunhidden">GeneralForumTopicUnhidden</a></td> -<td><em>Optional</em>. Service message: the 'General' forum topic unhidden</td> +<td><em>Optional</em>. Service message: the 'General' forum topic unhidden</td> </tr> <tr> <td>video_chat_scheduled</td> @@ -1019,7 +1010,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#messageid" id="messageid" name="messageid"><i class="anchor-icon"></i></a>MessageId</h4> +<h4><a class="anchor" name="messageid" href="#messageid"><i class="anchor-icon"></i></a>MessageId</h4> <p>This object represents a unique message identifier.</p> <table class="table"> <thead> @@ -1037,7 +1028,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#messageentity" id="messageentity" name="messageentity"><i class="anchor-icon"></i></a>MessageEntity</h4> +<h4><a class="anchor" name="messageentity" href="#messageentity"><i class="anchor-icon"></i></a>MessageEntity</h4> <p>This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.</p> <table class="table"> <thead> @@ -1051,7 +1042,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>type</td> <td>String</td> -<td>Type of the entity. Currently, can be "mention" (<code>@username</code>), "hashtag" (<code>#hashtag</code>), "cashtag" (<code>$USD</code>), "bot_command" (<code>/start@jobs_bot</code>), "url" (<code>https://telegram.org</code>), "email" (<code>do-not-reply@telegram.org</code>), "phone_number" (<code>+1-212-555-0123</code>), "bold" (<strong>bold text</strong>), "italic" (<em>italic text</em>), "underline" (underlined text), "strikethrough" (strikethrough text), "spoiler" (spoiler message), "code" (monowidth string), "pre" (monowidth block), "text_link" (for clickable text URLs), "text_mention" (for users <a href="https://telegram.org/blog/edit#new-mentions">without usernames</a>), "custom_emoji" (for inline custom emoji stickers)</td> +<td>Type of the entity. Currently, can be “mention” (<code>@username</code>), “hashtag” (<code>#hashtag</code>), “cashtag” (<code>$USD</code>), “bot_command” (<code>/start@jobs_bot</code>), “url” (<code>https://telegram.org</code>), “email” (<code>do-not-reply@telegram.org</code>), “phone_number” (<code>+1-212-555-0123</code>), “bold” (<strong>bold text</strong>), “italic” (<em>italic text</em>), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users <a href="https://telegram.org/blog/edit#new-mentions">without usernames</a>), “custom_emoji” (for inline custom emoji stickers)</td> </tr> <tr> <td>offset</td> @@ -1066,26 +1057,26 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>url</td> <td>String</td> -<td><em>Optional</em>. For "text_link" only, URL that will be opened after user taps on the text</td> +<td><em>Optional</em>. For “text_link” only, URL that will be opened after user taps on the text</td> </tr> <tr> <td>user</td> <td><a href="#user">User</a></td> -<td><em>Optional</em>. For "text_mention" only, the mentioned user</td> +<td><em>Optional</em>. For “text_mention” only, the mentioned user</td> </tr> <tr> <td>language</td> <td>String</td> -<td><em>Optional</em>. For "pre" only, the programming language of the entity text</td> +<td><em>Optional</em>. For “pre” only, the programming language of the entity text</td> </tr> <tr> <td>custom_emoji_id</td> <td>String</td> -<td><em>Optional</em>. For "custom_emoji" only, unique identifier of the custom emoji. Use <a href="#getcustomemojistickers">getCustomEmojiStickers</a> to get full information about the sticker</td> +<td><em>Optional</em>. For “custom_emoji” only, unique identifier of the custom emoji. Use <a href="#getcustomemojistickers">getCustomEmojiStickers</a> to get full information about the sticker</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#photosize" id="photosize" name="photosize"><i class="anchor-icon"></i></a>PhotoSize</h4> +<h4><a class="anchor" name="photosize" href="#photosize"><i class="anchor-icon"></i></a>PhotoSize</h4> <p>This object represents one size of a photo or a <a href="#document">file</a> / <a href="#sticker">sticker</a> thumbnail.</p> <table class="table"> <thead> @@ -1104,7 +1095,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>file_unique_id</td> <td>String</td> -<td>Unique 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.</td> +<td>Unique 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.</td> </tr> <tr> <td>width</td> @@ -1123,7 +1114,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#animation" id="animation" name="animation"><i class="anchor-icon"></i></a>Animation</h4> +<h4><a class="anchor" name="animation" href="#animation"><i class="anchor-icon"></i></a>Animation</h4> <p>This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).</p> <table class="table"> <thead> @@ -1142,7 +1133,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>file_unique_id</td> <td>String</td> -<td>Unique 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.</td> +<td>Unique 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.</td> </tr> <tr> <td>width</td> @@ -1181,7 +1172,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#audio" id="audio" name="audio"><i class="anchor-icon"></i></a>Audio</h4> +<h4><a class="anchor" name="audio" href="#audio"><i class="anchor-icon"></i></a>Audio</h4> <p>This object represents an audio file to be treated as music by the Telegram clients.</p> <table class="table"> <thead> @@ -1200,7 +1191,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>file_unique_id</td> <td>String</td> -<td>Unique 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.</td> +<td>Unique 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.</td> </tr> <tr> <td>duration</td> @@ -1239,7 +1230,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#document" id="document" name="document"><i class="anchor-icon"></i></a>Document</h4> +<h4><a class="anchor" name="document" href="#document"><i class="anchor-icon"></i></a>Document</h4> <p>This object represents a general file (as opposed to <a href="#photosize">photos</a>, <a href="#voice">voice messages</a> and <a href="#audio">audio files</a>).</p> <table class="table"> <thead> @@ -1258,7 +1249,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>file_unique_id</td> <td>String</td> -<td>Unique 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.</td> +<td>Unique 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.</td> </tr> <tr> <td>thumbnail</td> @@ -1282,7 +1273,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#video" id="video" name="video"><i class="anchor-icon"></i></a>Video</h4> +<h4><a class="anchor" name="video" href="#video"><i class="anchor-icon"></i></a>Video</h4> <p>This object represents a video file.</p> <table class="table"> <thead> @@ -1301,7 +1292,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>file_unique_id</td> <td>String</td> -<td>Unique 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.</td> +<td>Unique 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.</td> </tr> <tr> <td>width</td> @@ -1340,7 +1331,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#videonote" id="videonote" name="videonote"><i class="anchor-icon"></i></a>VideoNote</h4> +<h4><a class="anchor" name="videonote" href="#videonote"><i class="anchor-icon"></i></a>VideoNote</h4> <p>This object represents a <a href="https://telegram.org/blog/video-messages-and-telescope">video message</a> (available in Telegram apps as of <a href="https://telegram.org/blog/video-messages-and-telescope">v.4.0</a>).</p> <table class="table"> <thead> @@ -1359,7 +1350,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>file_unique_id</td> <td>String</td> -<td>Unique 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.</td> +<td>Unique 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.</td> </tr> <tr> <td>length</td> @@ -1383,7 +1374,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#voice" id="voice" name="voice"><i class="anchor-icon"></i></a>Voice</h4> +<h4><a class="anchor" name="voice" href="#voice"><i class="anchor-icon"></i></a>Voice</h4> <p>This object represents a voice note.</p> <table class="table"> <thead> @@ -1402,7 +1393,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>file_unique_id</td> <td>String</td> -<td>Unique 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.</td> +<td>Unique 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.</td> </tr> <tr> <td>duration</td> @@ -1421,7 +1412,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#contact" id="contact" name="contact"><i class="anchor-icon"></i></a>Contact</h4> +<h4><a class="anchor" name="contact" href="#contact"><i class="anchor-icon"></i></a>Contact</h4> <p>This object represents a phone contact.</p> <table class="table"> <thead> @@ -1435,22 +1426,22 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>phone_number</td> <td>String</td> -<td>Contact's phone number</td> +<td>Contact's phone number</td> </tr> <tr> <td>first_name</td> <td>String</td> -<td>Contact's first name</td> +<td>Contact's first name</td> </tr> <tr> <td>last_name</td> <td>String</td> -<td><em>Optional</em>. Contact's last name</td> +<td><em>Optional</em>. Contact's last name</td> </tr> <tr> <td>user_id</td> <td>Integer</td> -<td><em>Optional</em>. Contact's user identifier in Telegram. 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.</td> +<td><em>Optional</em>. Contact's user identifier in Telegram. 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.</td> </tr> <tr> <td>vcard</td> @@ -1459,7 +1450,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#dice" id="dice" name="dice"><i class="anchor-icon"></i></a>Dice</h4> +<h4><a class="anchor" name="dice" href="#dice"><i class="anchor-icon"></i></a>Dice</h4> <p>This object represents an animated emoji that displays a random value.</p> <table class="table"> <thead> @@ -1478,11 +1469,11 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>value</td> <td>Integer</td> -<td>Value of the dice, 1-6 for "<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />", "<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EAF.png" width="20" height="20" alt="🎯" />" and "<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB3.png" width="20" height="20" alt="🎳" />" base emoji, 1-5 for "<img class="emoji" src="//telegram.org/img/emoji/40/F09F8F80.png" width="20" height="20" alt="🏀" />" and "<img class="emoji" src="//telegram.org/img/emoji/40/E29ABD.png" width="20" height="20" alt="⚽" />" base emoji, 1-64 for "<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB0.png" width="20" height="20" alt="🎰" />" base emoji</td> +<td>Value of the dice, 1-6 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EAF.png" width="20" height="20" alt="🎯" />” and “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB3.png" width="20" height="20" alt="🎳" />” base emoji, 1-5 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8F80.png" width="20" height="20" alt="🏀" />” and “<img class="emoji" src="//telegram.org/img/emoji/40/E29ABD.png" width="20" height="20" alt="⚽" />” base emoji, 1-64 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB0.png" width="20" height="20" alt="🎰" />” base emoji</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#polloption" id="polloption" name="polloption"><i class="anchor-icon"></i></a>PollOption</h4> +<h4><a class="anchor" name="polloption" href="#polloption"><i class="anchor-icon"></i></a>PollOption</h4> <p>This object contains information about one answer option in a poll.</p> <table class="table"> <thead> @@ -1505,7 +1496,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#pollanswer" id="pollanswer" name="pollanswer"><i class="anchor-icon"></i></a>PollAnswer</h4> +<h4><a class="anchor" name="pollanswer" href="#pollanswer"><i class="anchor-icon"></i></a>PollAnswer</h4> <p>This object represents an answer of a user in a non-anonymous poll.</p> <table class="table"> <thead> @@ -1533,7 +1524,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#poll" id="poll" name="poll"><i class="anchor-icon"></i></a>Poll</h4> +<h4><a class="anchor" name="poll" href="#poll"><i class="anchor-icon"></i></a>Poll</h4> <p>This object contains information about a poll.</p> <table class="table"> <thead> @@ -1577,7 +1568,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>type</td> <td>String</td> -<td>Poll type, currently can be "regular" or "quiz"</td> +<td>Poll type, currently can be “regular” or “quiz”</td> </tr> <tr> <td>allows_multiple_answers</td> @@ -1611,7 +1602,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#location" id="location" name="location"><i class="anchor-icon"></i></a>Location</h4> +<h4><a class="anchor" name="location" href="#location"><i class="anchor-icon"></i></a>Location</h4> <p>This object represents a point on the map.</p> <table class="table"> <thead> @@ -1654,7 +1645,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#venue" id="venue" name="venue"><i class="anchor-icon"></i></a>Venue</h4> +<h4><a class="anchor" name="venue" href="#venue"><i class="anchor-icon"></i></a>Venue</h4> <p>This object represents a venue.</p> <table class="table"> <thead> @@ -1668,7 +1659,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>location</td> <td><a href="#location">Location</a></td> -<td>Venue location. Can't be a live location</td> +<td>Venue location. Can't be a live location</td> </tr> <tr> <td>title</td> @@ -1688,7 +1679,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>foursquare_type</td> <td>String</td> -<td><em>Optional</em>. Foursquare type of the venue. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".)</td> +<td><em>Optional</em>. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)</td> </tr> <tr> <td>google_place_id</td> @@ -1702,7 +1693,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#webappdata" id="webappdata" name="webappdata"><i class="anchor-icon"></i></a>WebAppData</h4> +<h4><a class="anchor" name="webappdata" href="#webappdata"><i class="anchor-icon"></i></a>WebAppData</h4> <p>Describes data sent from a <a href="/bots/webapps">Web App</a> to the bot.</p> <table class="table"> <thead> @@ -1725,7 +1716,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#proximityalerttriggered" id="proximityalerttriggered" name="proximityalerttriggered"><i class="anchor-icon"></i></a>ProximityAlertTriggered</h4> +<h4><a class="anchor" name="proximityalerttriggered" href="#proximityalerttriggered"><i class="anchor-icon"></i></a>ProximityAlertTriggered</h4> <p>This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.</p> <table class="table"> <thead> @@ -1753,7 +1744,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#messageautodeletetimerchanged" id="messageautodeletetimerchanged" name="messageautodeletetimerchanged"><i class="anchor-icon"></i></a>MessageAutoDeleteTimerChanged</h4> +<h4><a class="anchor" name="messageautodeletetimerchanged" href="#messageautodeletetimerchanged"><i class="anchor-icon"></i></a>MessageAutoDeleteTimerChanged</h4> <p>This object represents a service message about a change in auto-delete timer settings.</p> <table class="table"> <thead> @@ -1771,7 +1762,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#forumtopiccreated" id="forumtopiccreated" name="forumtopiccreated"><i class="anchor-icon"></i></a>ForumTopicCreated</h4> +<h4><a class="anchor" name="forumtopiccreated" href="#forumtopiccreated"><i class="anchor-icon"></i></a>ForumTopicCreated</h4> <p>This object represents a service message about a new forum topic created in the chat.</p> <table class="table"> <thead> @@ -1799,9 +1790,9 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#forumtopicclosed" id="forumtopicclosed" name="forumtopicclosed"><i class="anchor-icon"></i></a>ForumTopicClosed</h4> +<h4><a class="anchor" name="forumtopicclosed" href="#forumtopicclosed"><i class="anchor-icon"></i></a>ForumTopicClosed</h4> <p>This object represents a service message about a forum topic closed in the chat. Currently holds no information.</p> -<h4><a class="anchor" href="#forumtopicedited" id="forumtopicedited" name="forumtopicedited"><i class="anchor-icon"></i></a>ForumTopicEdited</h4> +<h4><a class="anchor" name="forumtopicedited" href="#forumtopicedited"><i class="anchor-icon"></i></a>ForumTopicEdited</h4> <p>This object represents a service message about an edited forum topic.</p> <table class="table"> <thead> @@ -1824,13 +1815,13 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#forumtopicreopened" id="forumtopicreopened" name="forumtopicreopened"><i class="anchor-icon"></i></a>ForumTopicReopened</h4> +<h4><a class="anchor" name="forumtopicreopened" href="#forumtopicreopened"><i class="anchor-icon"></i></a>ForumTopicReopened</h4> <p>This object represents a service message about a forum topic reopened in the chat. Currently holds no information.</p> -<h4><a class="anchor" href="#generalforumtopichidden" id="generalforumtopichidden" name="generalforumtopichidden"><i class="anchor-icon"></i></a>GeneralForumTopicHidden</h4> +<h4><a class="anchor" name="generalforumtopichidden" href="#generalforumtopichidden"><i class="anchor-icon"></i></a>GeneralForumTopicHidden</h4> <p>This object represents a service message about General forum topic hidden in the chat. Currently holds no information.</p> -<h4><a class="anchor" href="#generalforumtopicunhidden" id="generalforumtopicunhidden" name="generalforumtopicunhidden"><i class="anchor-icon"></i></a>GeneralForumTopicUnhidden</h4> +<h4><a class="anchor" name="generalforumtopicunhidden" href="#generalforumtopicunhidden"><i class="anchor-icon"></i></a>GeneralForumTopicUnhidden</h4> <p>This object represents a service message about General forum topic unhidden in the chat. Currently holds no information.</p> -<h4><a class="anchor" href="#usershared" id="usershared" name="usershared"><i class="anchor-icon"></i></a>UserShared</h4> +<h4><a class="anchor" name="usershared" href="#usershared"><i class="anchor-icon"></i></a>UserShared</h4> <p>This object contains information about the user whose identifier was shared with the bot using a <a href="#keyboardbuttonrequestuser">KeyboardButtonRequestUser</a> button.</p> <table class="table"> <thead> @@ -1853,7 +1844,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#chatshared" id="chatshared" name="chatshared"><i class="anchor-icon"></i></a>ChatShared</h4> +<h4><a class="anchor" name="chatshared" href="#chatshared"><i class="anchor-icon"></i></a>ChatShared</h4> <p>This object contains information about the chat whose identifier was shared with the bot using a <a href="#keyboardbuttonrequestchat">KeyboardButtonRequestChat</a> button.</p> <table class="table"> <thead> @@ -1876,7 +1867,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#writeaccessallowed" id="writeaccessallowed" name="writeaccessallowed"><i class="anchor-icon"></i></a>WriteAccessAllowed</h4> +<h4><a class="anchor" name="writeaccessallowed" href="#writeaccessallowed"><i class="anchor-icon"></i></a>WriteAccessAllowed</h4> <p>This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link.</p> <table class="table"> <thead> @@ -1894,7 +1885,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#videochatscheduled" id="videochatscheduled" name="videochatscheduled"><i class="anchor-icon"></i></a>VideoChatScheduled</h4> +<h4><a class="anchor" name="videochatscheduled" href="#videochatscheduled"><i class="anchor-icon"></i></a>VideoChatScheduled</h4> <p>This object represents a service message about a video chat scheduled in the chat.</p> <table class="table"> <thead> @@ -1912,9 +1903,9 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#videochatstarted" id="videochatstarted" name="videochatstarted"><i class="anchor-icon"></i></a>VideoChatStarted</h4> +<h4><a class="anchor" name="videochatstarted" href="#videochatstarted"><i class="anchor-icon"></i></a>VideoChatStarted</h4> <p>This object represents a service message about a video chat started in the chat. Currently holds no information.</p> -<h4><a class="anchor" href="#videochatended" id="videochatended" name="videochatended"><i class="anchor-icon"></i></a>VideoChatEnded</h4> +<h4><a class="anchor" name="videochatended" href="#videochatended"><i class="anchor-icon"></i></a>VideoChatEnded</h4> <p>This object represents a service message about a video chat ended in the chat.</p> <table class="table"> <thead> @@ -1932,7 +1923,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#videochatparticipantsinvited" id="videochatparticipantsinvited" name="videochatparticipantsinvited"><i class="anchor-icon"></i></a>VideoChatParticipantsInvited</h4> +<h4><a class="anchor" name="videochatparticipantsinvited" href="#videochatparticipantsinvited"><i class="anchor-icon"></i></a>VideoChatParticipantsInvited</h4> <p>This object represents a service message about new members invited to a video chat.</p> <table class="table"> <thead> @@ -1950,8 +1941,8 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#userprofilephotos" id="userprofilephotos" name="userprofilephotos"><i class="anchor-icon"></i></a>UserProfilePhotos</h4> -<p>This object represent a user's profile pictures.</p> +<h4><a class="anchor" name="userprofilephotos" href="#userprofilephotos"><i class="anchor-icon"></i></a>UserProfilePhotos</h4> +<p>This object represent a user's profile pictures.</p> <table class="table"> <thead> <tr> @@ -1973,7 +1964,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#file" id="file" name="file"><i class="anchor-icon"></i></a>File</h4> +<h4><a class="anchor" name="file" href="#file"><i class="anchor-icon"></i></a>File</h4> <p>This object represents a file ready to be downloaded. The file can be downloaded via the link <code>https://api.telegram.org/file/bot<token>/<file_path></code>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling <a href="#getfile">getFile</a>.</p> <blockquote> <p>The maximum file size to download is 20 MB</p> @@ -1995,7 +1986,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>file_unique_id</td> <td>String</td> -<td>Unique 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.</td> +<td>Unique 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.</td> </tr> <tr> <td>file_size</td> @@ -2009,7 +2000,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#webappinfo" id="webappinfo" name="webappinfo"><i class="anchor-icon"></i></a>WebAppInfo</h4> +<h4><a class="anchor" name="webappinfo" href="#webappinfo"><i class="anchor-icon"></i></a>WebAppInfo</h4> <p>Describes a <a href="/bots/webapps">Web App</a>.</p> <table class="table"> <thead> @@ -2027,7 +2018,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#replykeyboardmarkup" id="replykeyboardmarkup" name="replykeyboardmarkup"><i class="anchor-icon"></i></a>ReplyKeyboardMarkup</h4> +<h4><a class="anchor" name="replykeyboardmarkup" href="#replykeyboardmarkup"><i class="anchor-icon"></i></a>ReplyKeyboardMarkup</h4> <p>This object represents a <a href="/bots/features#keyboards">custom keyboard</a> with reply options (see <a href="/bots/features#keyboards">Introduction to bots</a> for details and examples).</p> <table class="table"> <thead> @@ -2051,12 +2042,12 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>resize_keyboard</td> <td>Boolean</td> -<td><em>Optional</em>. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to <em>false</em>, in which case the custom keyboard is always of the same height as the app's standard keyboard.</td> +<td><em>Optional</em>. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to <em>false</em>, in which case the custom keyboard is always of the same height as the app's standard keyboard.</td> </tr> <tr> <td>one_time_keyboard</td> <td>Boolean</td> -<td><em>Optional</em>. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to <em>false</em>.</td> +<td><em>Optional</em>. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to <em>false</em>.</td> </tr> <tr> <td>input_field_placeholder</td> @@ -2066,11 +2057,11 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>selective</td> <td>Boolean</td> -<td><em>Optional</em>. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the <em>text</em> of the <a href="#message">Message</a> object; 2) if the bot's message is a reply (has <em>reply_to_message_id</em>), sender of the original message.<br><br><em>Example:</em> 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.</td> +<td><em>Optional</em>. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the <em>text</em> of the <a href="#message">Message</a> object; 2) if the bot's message is a reply (has <em>reply_to_message_id</em>), sender of the original message.<br><br><em>Example:</em> 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.</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#keyboardbutton" id="keyboardbutton" name="keyboardbutton"><i class="anchor-icon"></i></a>KeyboardButton</h4> +<h4><a class="anchor" name="keyboardbutton" href="#keyboardbutton"><i class="anchor-icon"></i></a>KeyboardButton</h4> <p>This object represents one button of the reply keyboard. For simple text buttons, <em>String</em> can be used instead of this object to specify the button text. The optional fields <em>web_app</em>, <em>request_user</em>, <em>request_chat</em>, <em>request_contact</em>, <em>request_location</em>, and <em>request_poll</em> are mutually exclusive.</p> <table class="table"> <thead> @@ -2089,22 +2080,22 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>request_user</td> <td><a href="#keyboardbuttonrequestuser">KeyboardButtonRequestUser</a></td> -<td><em>Optional.</em> 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.</td> +<td><em>Optional.</em> 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.</td> </tr> <tr> <td>request_chat</td> <td><a href="#keyboardbuttonrequestchat">KeyboardButtonRequestChat</a></td> -<td><em>Optional.</em> If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a "chat_shared" service message. Available in private chats only.</td> +<td><em>Optional.</em> If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only.</td> </tr> <tr> <td>request_contact</td> <td>Boolean</td> -<td><em>Optional</em>. If <em>True</em>, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only.</td> +<td><em>Optional</em>. If <em>True</em>, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only.</td> </tr> <tr> <td>request_location</td> <td>Boolean</td> -<td><em>Optional</em>. If <em>True</em>, the user's current location will be sent when the button is pressed. Available in private chats only.</td> +<td><em>Optional</em>. If <em>True</em>, the user's current location will be sent when the button is pressed. Available in private chats only.</td> </tr> <tr> <td>request_poll</td> @@ -2114,15 +2105,12 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>web_app</td> <td><a href="#webappinfo">WebAppInfo</a></td> -<td><em>Optional</em>. If specified, the described <a href="/bots/webapps">Web App</a> will be launched when the button is pressed. The Web App will be able to send a "web_app_data" service message. Available in private chats only.</td> +<td><em>Optional</em>. If specified, the described <a href="/bots/webapps">Web App</a> will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only.</td> </tr> </tbody> </table> -<p><strong>Note:</strong> <em>request_contact</em> and <em>request_location</em> options will only work in Telegram versions released after 9 April, 2016. Older clients will display <em>unsupported message</em>. -<strong>Note:</strong> <em>request_poll</em> option will only work in Telegram versions released after 23 January, 2020. Older clients will display <em>unsupported message</em>. -<strong>Note:</strong> <em>web_app</em> option will only work in Telegram versions released after 16 April, 2022. Older clients will display <em>unsupported message</em>. -<strong>Note:</strong> <em>request_user</em> and <em>request_chat</em> options will only work in Telegram versions released after 3 February, 2023. Older clients will display <em>unsupported message</em>.</p> -<h4><a class="anchor" href="#keyboardbuttonrequestuser" id="keyboardbuttonrequestuser" name="keyboardbuttonrequestuser"><i class="anchor-icon"></i></a>KeyboardButtonRequestUser</h4> +<p><strong>Note:</strong> <em>request_contact</em> and <em>request_location</em> options will only work in Telegram versions released after 9 April, 2016. Older clients will display <em>unsupported message</em>.<br><strong>Note:</strong> <em>request_poll</em> option will only work in Telegram versions released after 23 January, 2020. Older clients will display <em>unsupported message</em>.<br><strong>Note:</strong> <em>web_app</em> option will only work in Telegram versions released after 16 April, 2022. Older clients will display <em>unsupported message</em>.<br><strong>Note:</strong> <em>request_user</em> and <em>request_chat</em> options will only work in Telegram versions released after 3 February, 2023. Older clients will display <em>unsupported message</em>.</p> +<h4><a class="anchor" name="keyboardbuttonrequestuser" href="#keyboardbuttonrequestuser"><i class="anchor-icon"></i></a>KeyboardButtonRequestUser</h4> <p>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. <a href="/bots/features#chat-and-user-selection">More about requesting users »</a></p> <table class="table"> <thead> @@ -2150,7 +2138,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#keyboardbuttonrequestchat" id="keyboardbuttonrequestchat" name="keyboardbuttonrequestchat"><i class="anchor-icon"></i></a>KeyboardButtonRequestChat</h4> +<h4><a class="anchor" name="keyboardbuttonrequestchat" href="#keyboardbuttonrequestchat"><i class="anchor-icon"></i></a>KeyboardButtonRequestChat</h4> <p>This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed. <a href="/bots/features#chat-and-user-selection">More about requesting chats »</a></p> <table class="table"> <thead> @@ -2203,7 +2191,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#keyboardbuttonpolltype" id="keyboardbuttonpolltype" name="keyboardbuttonpolltype"><i class="anchor-icon"></i></a>KeyboardButtonPollType</h4> +<h4><a class="anchor" name="keyboardbuttonpolltype" href="#keyboardbuttonpolltype"><i class="anchor-icon"></i></a>KeyboardButtonPollType</h4> <p>This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.</p> <table class="table"> <thead> @@ -2221,7 +2209,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#replykeyboardremove" id="replykeyboardremove" name="replykeyboardremove"><i class="anchor-icon"></i></a>ReplyKeyboardRemove</h4> +<h4><a class="anchor" name="replykeyboardremove" href="#replykeyboardremove"><i class="anchor-icon"></i></a>ReplyKeyboardRemove</h4> <p>Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a>).</p> <table class="table"> <thead> @@ -2240,11 +2228,11 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>selective</td> <td>Boolean</td> -<td><em>Optional</em>. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the <em>text</em> of the <a href="#message">Message</a> object; 2) if the bot's message is a reply (has <em>reply_to_message_id</em>), sender of the original message.<br><br><em>Example:</em> 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.</td> +<td><em>Optional</em>. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the <em>text</em> of the <a href="#message">Message</a> object; 2) if the bot's message is a reply (has <em>reply_to_message_id</em>), sender of the original message.<br><br><em>Example:</em> 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.</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#inlinekeyboardmarkup" id="inlinekeyboardmarkup" name="inlinekeyboardmarkup"><i class="anchor-icon"></i></a>InlineKeyboardMarkup</h4> +<h4><a class="anchor" name="inlinekeyboardmarkup" href="#inlinekeyboardmarkup"><i class="anchor-icon"></i></a>InlineKeyboardMarkup</h4> <p>This object represents an <a href="/bots/features#inline-keyboards">inline keyboard</a> that appears right next to the message it belongs to.</p> <table class="table"> <thead> @@ -2263,7 +2251,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tbody> </table> <p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will display <em>unsupported message</em>.</p> -<h4><a class="anchor" href="#inlinekeyboardbutton" id="inlinekeyboardbutton" name="inlinekeyboardbutton"><i class="anchor-icon"></i></a>InlineKeyboardButton</h4> +<h4><a class="anchor" name="inlinekeyboardbutton" href="#inlinekeyboardbutton"><i class="anchor-icon"></i></a>InlineKeyboardButton</h4> <p>This object represents one button of an inline keyboard. You <strong>must</strong> use exactly one of the optional fields.</p> <table class="table"> <thead> @@ -2302,17 +2290,17 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>switch_inline_query</td> <td>String</td> -<td><em>Optional</em>. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted.<br><br><strong>Note:</strong> This offers an easy way for users to start using your bot in <a href="/bots/inline">inline mode</a> when they are currently in a private chat with it. Especially useful when combined with <a href="#answerinlinequery"><em>switch_pm...</em></a> actions - in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen.</td> +<td><em>Optional</em>. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted.</td> </tr> <tr> <td>switch_inline_query_current_chat</td> <td>String</td> -<td><em>Optional</em>. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted.<br><br>This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options.</td> +<td><em>Optional</em>. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted.<br><br>This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options.</td> </tr> <tr> <td>switch_inline_query_chosen_chat</td> <td><a href="#switchinlinequerychosenchat">SwitchInlineQueryChosenChat</a></td> -<td><em>Optional</em>. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field</td> +<td><em>Optional</em>. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field</td> </tr> <tr> <td>callback_game</td> @@ -2326,11 +2314,12 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#loginurl" id="loginurl" name="loginurl"><i class="anchor-icon"></i></a>LoginUrl</h4> +<h4><a class="anchor" name="loginurl" href="#loginurl"><i class="anchor-icon"></i></a>LoginUrl</h4> <p>This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the <a href="/widgets/login">Telegram Login Widget</a> when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in:</p> <div class="blog_image_wrap"> - <a href="/file/811140015/1734/8VZFkwWXalM.97872/6127fa62d8a0bf2b3c" target="_blank"><img src="/file/811140909/1631/20k1Z53eiyY.23995/c541e89b74253623d9" title="TITLE" alt="TITLE" srcset="/file/811140015/1734/8VZFkwWXalM.97872/6127fa62d8a0bf2b3c , 2x"></a> + <a href="/file/811140015/1734/8VZFkwWXalM.97872/6127fa62d8a0bf2b3c" target="_blank"><img src="/file/811140909/1631/20k1Z53eiyY.23995/c541e89b74253623d9" title="TITLE" alt="TITLE" srcset="/file/811140015/1734/8VZFkwWXalM.97872/6127fa62d8a0bf2b3c , 2x" /></a> </div> + <p>Telegram apps support these buttons as of <a href="https://telegram.org/blog/privacy-discussions-web-bots#meet-seamless-web-bots">version 5.7</a>.</p> <blockquote> <p>Sample bot: <a href="https://t.me/discussbot">@discussbot</a></p> @@ -2357,7 +2346,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>bot_username</td> <td>String</td> -<td><em>Optional</em>. Username of a bot, which will be used for user authorization. See <a href="/widgets/login#setting-up-a-bot">Setting up a bot</a> for more details. If not specified, the current bot's username will be assumed. The <em>url</em>'s domain must be the same as the domain linked with the bot. See <a href="/widgets/login#linking-your-domain-to-the-bot">Linking your domain to the bot</a> for more details.</td> +<td><em>Optional</em>. Username of a bot, which will be used for user authorization. See <a href="/widgets/login#setting-up-a-bot">Setting up a bot</a> for more details. If not specified, the current bot's username will be assumed. The <em>url</em>'s domain must be the same as the domain linked with the bot. See <a href="/widgets/login#linking-your-domain-to-the-bot">Linking your domain to the bot</a> for more details.</td> </tr> <tr> <td>request_write_access</td> @@ -2366,7 +2355,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#switchinlinequerychosenchat" id="switchinlinequerychosenchat" name="switchinlinequerychosenchat"><i class="anchor-icon"></i></a>SwitchInlineQueryChosenChat</h4> +<h4><a class="anchor" name="switchinlinequerychosenchat" href="#switchinlinequerychosenchat"><i class="anchor-icon"></i></a>SwitchInlineQueryChosenChat</h4> <p>This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.</p> <table class="table"> <thead> @@ -2380,7 +2369,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>query</td> <td>String</td> -<td><em>Optional</em>. The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted</td> +<td><em>Optional</em>. The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted</td> </tr> <tr> <td>allow_user_chats</td> @@ -2404,7 +2393,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#callbackquery" id="callbackquery" name="callbackquery"><i class="anchor-icon"></i></a>CallbackQuery</h4> +<h4><a class="anchor" name="callbackquery" href="#callbackquery"><i class="anchor-icon"></i></a>CallbackQuery</h4> <p>This object represents an incoming callback query from a callback button in an <a href="/bots/features#inline-keyboards">inline keyboard</a>. If the button that originated the query was attached to a message sent by the bot, the field <em>message</em> will be present. If the button was attached to a message sent via the bot (in <a href="#inline-mode">inline mode</a>), the field <em>inline_message_id</em> will be present. Exactly one of the fields <em>data</em> or <em>game_short_name</em> will be present.</p> <table class="table"> <thead> @@ -2455,8 +2444,8 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <blockquote> <p><strong>NOTE:</strong> After the user presses a callback button, Telegram clients will display a progress bar until you call <a href="#answercallbackquery">answerCallbackQuery</a>. It is, therefore, necessary to react by calling <a href="#answercallbackquery">answerCallbackQuery</a> even if no notification to the user is needed (e.g., without specifying any of the optional parameters).</p> </blockquote> -<h4><a class="anchor" href="#forcereply" id="forcereply" name="forcereply"><i class="anchor-icon"></i></a>ForceReply</h4> -<p>Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice <a href="/bots/features#privacy-mode">privacy mode</a>.</p> +<h4><a class="anchor" name="forcereply" href="#forcereply"><i class="anchor-icon"></i></a>ForceReply</h4> +<p>Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice <a href="/bots/features#privacy-mode">privacy mode</a>.</p> <table class="table"> <thead> <tr> @@ -2469,7 +2458,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>force_reply</td> <td>True</td> -<td>Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply'</td> +<td>Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply'</td> </tr> <tr> <td>input_field_placeholder</td> @@ -2479,7 +2468,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>selective</td> <td>Boolean</td> -<td><em>Optional</em>. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the <em>text</em> of the <a href="#message">Message</a> object; 2) if the bot's message is a reply (has <em>reply_to_message_id</em>), sender of the original message.</td> +<td><em>Optional</em>. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the <em>text</em> of the <a href="#message">Message</a> object; 2) if the bot's message is a reply (has <em>reply_to_message_id</em>), sender of the original message.</td> </tr> </tbody> </table> @@ -2487,11 +2476,11 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <p><strong>Example:</strong> A <a href="https://t.me/PollBot">poll bot</a> for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:</p> <ul> <li>Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.</li> -<li>Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.</li> +<li>Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.</li> </ul> -<p>The last option is definitely more attractive. And if you use <a href="#forcereply">ForceReply</a> in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.</p> +<p>The last option is definitely more attractive. And if you use <a href="#forcereply">ForceReply</a> in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.</p> </blockquote> -<h4><a class="anchor" href="#chatphoto" id="chatphoto" name="chatphoto"><i class="anchor-icon"></i></a>ChatPhoto</h4> +<h4><a class="anchor" name="chatphoto" href="#chatphoto"><i class="anchor-icon"></i></a>ChatPhoto</h4> <p>This object represents a chat photo.</p> <table class="table"> <thead> @@ -2510,7 +2499,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>small_file_unique_id</td> <td>String</td> -<td>Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.</td> +<td>Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.</td> </tr> <tr> <td>big_file_id</td> @@ -2520,11 +2509,11 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>big_file_unique_id</td> <td>String</td> -<td>Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.</td> +<td>Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#chatinvitelink" id="chatinvitelink" name="chatinvitelink"><i class="anchor-icon"></i></a>ChatInviteLink</h4> +<h4><a class="anchor" name="chatinvitelink" href="#chatinvitelink"><i class="anchor-icon"></i></a>ChatInviteLink</h4> <p>Represents an invite link for a chat.</p> <table class="table"> <thead> @@ -2538,7 +2527,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>invite_link</td> <td>String</td> -<td>The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with "...".</td> +<td>The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”.</td> </tr> <tr> <td>creator</td> @@ -2582,7 +2571,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#chatadministratorrights" id="chatadministratorrights" name="chatadministratorrights"><i class="anchor-icon"></i></a>ChatAdministratorRights</h4> +<h4><a class="anchor" name="chatadministratorrights" href="#chatadministratorrights"><i class="anchor-icon"></i></a>ChatAdministratorRights</h4> <p>Represents the rights of an administrator in a chat.</p> <table class="table"> <thead> @@ -2596,7 +2585,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>is_anonymous</td> <td>Boolean</td> -<td><em>True</em>, if the user's presence in the chat is hidden</td> +<td><em>True</em>, if the user's presence in the chat is hidden</td> </tr> <tr> <td>can_manage_chat</td> @@ -2655,7 +2644,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#chatmember" id="chatmember" name="chatmember"><i class="anchor-icon"></i></a>ChatMember</h4> +<h4><a class="anchor" name="chatmember" href="#chatmember"><i class="anchor-icon"></i></a>ChatMember</h4> <p>This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:</p> <ul> <li><a href="#chatmemberowner">ChatMemberOwner</a></li> @@ -2665,7 +2654,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <li><a href="#chatmemberleft">ChatMemberLeft</a></li> <li><a href="#chatmemberbanned">ChatMemberBanned</a></li> </ul> -<h4><a class="anchor" href="#chatmemberowner" id="chatmemberowner" name="chatmemberowner"><i class="anchor-icon"></i></a>ChatMemberOwner</h4> +<h4><a class="anchor" name="chatmemberowner" href="#chatmemberowner"><i class="anchor-icon"></i></a>ChatMemberOwner</h4> <p>Represents a <a href="#chatmember">chat member</a> that owns the chat and has all administrator privileges.</p> <table class="table"> <thead> @@ -2679,7 +2668,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>status</td> <td>String</td> -<td>The member's status in the chat, always "creator"</td> +<td>The member's status in the chat, always “creator”</td> </tr> <tr> <td>user</td> @@ -2689,7 +2678,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>is_anonymous</td> <td>Boolean</td> -<td><em>True</em>, if the user's presence in the chat is hidden</td> +<td><em>True</em>, if the user's presence in the chat is hidden</td> </tr> <tr> <td>custom_title</td> @@ -2698,7 +2687,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#chatmemberadministrator" id="chatmemberadministrator" name="chatmemberadministrator"><i class="anchor-icon"></i></a>ChatMemberAdministrator</h4> +<h4><a class="anchor" name="chatmemberadministrator" href="#chatmemberadministrator"><i class="anchor-icon"></i></a>ChatMemberAdministrator</h4> <p>Represents a <a href="#chatmember">chat member</a> that has some additional privileges.</p> <table class="table"> <thead> @@ -2712,7 +2701,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>status</td> <td>String</td> -<td>The member's status in the chat, always "administrator"</td> +<td>The member's status in the chat, always “administrator”</td> </tr> <tr> <td>user</td> @@ -2727,7 +2716,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>is_anonymous</td> <td>Boolean</td> -<td><em>True</em>, if the user's presence in the chat is hidden</td> +<td><em>True</em>, if the user's presence in the chat is hidden</td> </tr> <tr> <td>can_manage_chat</td> @@ -2791,7 +2780,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#chatmembermember" id="chatmembermember" name="chatmembermember"><i class="anchor-icon"></i></a>ChatMemberMember</h4> +<h4><a class="anchor" name="chatmembermember" href="#chatmembermember"><i class="anchor-icon"></i></a>ChatMemberMember</h4> <p>Represents a <a href="#chatmember">chat member</a> that has no additional privileges or restrictions.</p> <table class="table"> <thead> @@ -2805,7 +2794,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>status</td> <td>String</td> -<td>The member's status in the chat, always "member"</td> +<td>The member's status in the chat, always “member”</td> </tr> <tr> <td>user</td> @@ -2814,7 +2803,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#chatmemberrestricted" id="chatmemberrestricted" name="chatmemberrestricted"><i class="anchor-icon"></i></a>ChatMemberRestricted</h4> +<h4><a class="anchor" name="chatmemberrestricted" href="#chatmemberrestricted"><i class="anchor-icon"></i></a>ChatMemberRestricted</h4> <p>Represents a <a href="#chatmember">chat member</a> that is under certain restrictions in the chat. Supergroups only.</p> <table class="table"> <thead> @@ -2828,7 +2817,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>status</td> <td>String</td> -<td>The member's status in the chat, always "restricted"</td> +<td>The member's status in the chat, always “restricted”</td> </tr> <tr> <td>user</td> @@ -2917,8 +2906,8 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#chatmemberleft" id="chatmemberleft" name="chatmemberleft"><i class="anchor-icon"></i></a>ChatMemberLeft</h4> -<p>Represents a <a href="#chatmember">chat member</a> that isn't currently a member of the chat, but may join it themselves.</p> +<h4><a class="anchor" name="chatmemberleft" href="#chatmemberleft"><i class="anchor-icon"></i></a>ChatMemberLeft</h4> +<p>Represents a <a href="#chatmember">chat member</a> that isn't currently a member of the chat, but may join it themselves.</p> <table class="table"> <thead> <tr> @@ -2931,7 +2920,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>status</td> <td>String</td> -<td>The member's status in the chat, always "left"</td> +<td>The member's status in the chat, always “left”</td> </tr> <tr> <td>user</td> @@ -2940,8 +2929,8 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#chatmemberbanned" id="chatmemberbanned" name="chatmemberbanned"><i class="anchor-icon"></i></a>ChatMemberBanned</h4> -<p>Represents a <a href="#chatmember">chat member</a> that was banned in the chat and can't return to the chat or view chat messages.</p> +<h4><a class="anchor" name="chatmemberbanned" href="#chatmemberbanned"><i class="anchor-icon"></i></a>ChatMemberBanned</h4> +<p>Represents a <a href="#chatmember">chat member</a> that was banned in the chat and can't return to the chat or view chat messages.</p> <table class="table"> <thead> <tr> @@ -2954,7 +2943,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>status</td> <td>String</td> -<td>The member's status in the chat, always "kicked"</td> +<td>The member's status in the chat, always “kicked”</td> </tr> <tr> <td>user</td> @@ -2968,7 +2957,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#chatmemberupdated" id="chatmemberupdated" name="chatmemberupdated"><i class="anchor-icon"></i></a>ChatMemberUpdated</h4> +<h4><a class="anchor" name="chatmemberupdated" href="#chatmemberupdated"><i class="anchor-icon"></i></a>ChatMemberUpdated</h4> <p>This object represents changes in the status of a chat member.</p> <table class="table"> <thead> @@ -3016,7 +3005,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#chatjoinrequest" id="chatjoinrequest" name="chatjoinrequest"><i class="anchor-icon"></i></a>ChatJoinRequest</h4> +<h4><a class="anchor" name="chatjoinrequest" href="#chatjoinrequest"><i class="anchor-icon"></i></a>ChatJoinRequest</h4> <p>Represents a join request sent to a chat.</p> <table class="table"> <thead> @@ -3059,7 +3048,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#chatpermissions" id="chatpermissions" name="chatpermissions"><i class="anchor-icon"></i></a>ChatPermissions</h4> +<h4><a class="anchor" name="chatpermissions" href="#chatpermissions"><i class="anchor-icon"></i></a>ChatPermissions</h4> <p>Describes actions that a non-administrator user is allowed to take in a chat.</p> <table class="table"> <thead> @@ -3142,7 +3131,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#chatlocation" id="chatlocation" name="chatlocation"><i class="anchor-icon"></i></a>ChatLocation</h4> +<h4><a class="anchor" name="chatlocation" href="#chatlocation"><i class="anchor-icon"></i></a>ChatLocation</h4> <p>Represents a location to which a chat is connected.</p> <table class="table"> <thead> @@ -3156,7 +3145,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>location</td> <td><a href="#location">Location</a></td> -<td>The location to which the supergroup is connected. Can't be a live location.</td> +<td>The location to which the supergroup is connected. Can't be a live location.</td> </tr> <tr> <td>address</td> @@ -3165,7 +3154,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#forumtopic" id="forumtopic" name="forumtopic"><i class="anchor-icon"></i></a>ForumTopic</h4> +<h4><a class="anchor" name="forumtopic" href="#forumtopic"><i class="anchor-icon"></i></a>ForumTopic</h4> <p>This object represents a forum topic.</p> <table class="table"> <thead> @@ -3198,7 +3187,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#botcommand" id="botcommand" name="botcommand"><i class="anchor-icon"></i></a>BotCommand</h4> +<h4><a class="anchor" name="botcommand" href="#botcommand"><i class="anchor-icon"></i></a>BotCommand</h4> <p>This object represents a bot command.</p> <table class="table"> <thead> @@ -3221,7 +3210,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#botcommandscope" id="botcommandscope" name="botcommandscope"><i class="anchor-icon"></i></a>BotCommandScope</h4> +<h4><a class="anchor" name="botcommandscope" href="#botcommandscope"><i class="anchor-icon"></i></a>BotCommandScope</h4> <p>This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:</p> <ul> <li><a href="#botcommandscopedefault">BotCommandScopeDefault</a></li> @@ -3232,7 +3221,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <li><a href="#botcommandscopechatadministrators">BotCommandScopeChatAdministrators</a></li> <li><a href="#botcommandscopechatmember">BotCommandScopeChatMember</a></li> </ul> -<h4><a class="anchor" href="#determining-list-of-commands" id="determining-list-of-commands" name="determining-list-of-commands"><i class="anchor-icon"></i></a>Determining list of commands</h4> +<h4><a class="anchor" name="determining-list-of-commands" href="#determining-list-of-commands"><i class="anchor-icon"></i></a>Determining list of commands</h4> <p>The following algorithm is used to determine the list of commands for a particular user viewing the bot menu. The first list of commands which is set is returned:</p> <p><strong>Commands in the chat with the bot</strong></p> <ul> @@ -3258,7 +3247,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <li>botCommandScopeDefault + language_code</li> <li>botCommandScopeDefault</li> </ul> -<h4><a class="anchor" href="#botcommandscopedefault" id="botcommandscopedefault" name="botcommandscopedefault"><i class="anchor-icon"></i></a>BotCommandScopeDefault</h4> +<h4><a class="anchor" name="botcommandscopedefault" href="#botcommandscopedefault"><i class="anchor-icon"></i></a>BotCommandScopeDefault</h4> <p>Represents the default <a href="#botcommandscope">scope</a> of bot commands. Default commands are used if no commands with a <a href="#determining-list-of-commands">narrower scope</a> are specified for the user.</p> <table class="table"> <thead> @@ -3276,7 +3265,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#botcommandscopeallprivatechats" id="botcommandscopeallprivatechats" name="botcommandscopeallprivatechats"><i class="anchor-icon"></i></a>BotCommandScopeAllPrivateChats</h4> +<h4><a class="anchor" name="botcommandscopeallprivatechats" href="#botcommandscopeallprivatechats"><i class="anchor-icon"></i></a>BotCommandScopeAllPrivateChats</h4> <p>Represents the <a href="#botcommandscope">scope</a> of bot commands, covering all private chats.</p> <table class="table"> <thead> @@ -3294,7 +3283,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#botcommandscopeallgroupchats" id="botcommandscopeallgroupchats" name="botcommandscopeallgroupchats"><i class="anchor-icon"></i></a>BotCommandScopeAllGroupChats</h4> +<h4><a class="anchor" name="botcommandscopeallgroupchats" href="#botcommandscopeallgroupchats"><i class="anchor-icon"></i></a>BotCommandScopeAllGroupChats</h4> <p>Represents the <a href="#botcommandscope">scope</a> of bot commands, covering all group and supergroup chats.</p> <table class="table"> <thead> @@ -3312,7 +3301,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#botcommandscopeallchatadministrators" id="botcommandscopeallchatadministrators" name="botcommandscopeallchatadministrators"><i class="anchor-icon"></i></a>BotCommandScopeAllChatAdministrators</h4> +<h4><a class="anchor" name="botcommandscopeallchatadministrators" href="#botcommandscopeallchatadministrators"><i class="anchor-icon"></i></a>BotCommandScopeAllChatAdministrators</h4> <p>Represents the <a href="#botcommandscope">scope</a> of bot commands, covering all group and supergroup chat administrators.</p> <table class="table"> <thead> @@ -3330,7 +3319,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#botcommandscopechat" id="botcommandscopechat" name="botcommandscopechat"><i class="anchor-icon"></i></a>BotCommandScopeChat</h4> +<h4><a class="anchor" name="botcommandscopechat" href="#botcommandscopechat"><i class="anchor-icon"></i></a>BotCommandScopeChat</h4> <p>Represents the <a href="#botcommandscope">scope</a> of bot commands, covering a specific chat.</p> <table class="table"> <thead> @@ -3353,7 +3342,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#botcommandscopechatadministrators" id="botcommandscopechatadministrators" name="botcommandscopechatadministrators"><i class="anchor-icon"></i></a>BotCommandScopeChatAdministrators</h4> +<h4><a class="anchor" name="botcommandscopechatadministrators" href="#botcommandscopechatadministrators"><i class="anchor-icon"></i></a>BotCommandScopeChatAdministrators</h4> <p>Represents the <a href="#botcommandscope">scope</a> of bot commands, covering all administrators of a specific group or supergroup chat.</p> <table class="table"> <thead> @@ -3376,7 +3365,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#botcommandscopechatmember" id="botcommandscopechatmember" name="botcommandscopechatmember"><i class="anchor-icon"></i></a>BotCommandScopeChatMember</h4> +<h4><a class="anchor" name="botcommandscopechatmember" href="#botcommandscopechatmember"><i class="anchor-icon"></i></a>BotCommandScopeChatMember</h4> <p>Represents the <a href="#botcommandscope">scope</a> of bot commands, covering a specific member of a group or supergroup chat.</p> <table class="table"> <thead> @@ -3404,8 +3393,8 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#botname" id="botname" name="botname"><i class="anchor-icon"></i></a>BotName</h4> -<p>This object represents the bot's name.</p> +<h4><a class="anchor" name="botname" href="#botname"><i class="anchor-icon"></i></a>BotName</h4> +<p>This object represents the bot's name.</p> <table class="table"> <thead> <tr> @@ -3418,12 +3407,12 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>name</td> <td>String</td> -<td>The bot's name</td> +<td>The bot's name</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#botdescription" id="botdescription" name="botdescription"><i class="anchor-icon"></i></a>BotDescription</h4> -<p>This object represents the bot's description.</p> +<h4><a class="anchor" name="botdescription" href="#botdescription"><i class="anchor-icon"></i></a>BotDescription</h4> +<p>This object represents the bot's description.</p> <table class="table"> <thead> <tr> @@ -3436,12 +3425,12 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>description</td> <td>String</td> -<td>The bot's description</td> +<td>The bot's description</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#botshortdescription" id="botshortdescription" name="botshortdescription"><i class="anchor-icon"></i></a>BotShortDescription</h4> -<p>This object represents the bot's short description.</p> +<h4><a class="anchor" name="botshortdescription" href="#botshortdescription"><i class="anchor-icon"></i></a>BotShortDescription</h4> +<p>This object represents the bot's short description.</p> <table class="table"> <thead> <tr> @@ -3454,20 +3443,20 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>short_description</td> <td>String</td> -<td>The bot's short description</td> +<td>The bot's short description</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#menubutton" id="menubutton" name="menubutton"><i class="anchor-icon"></i></a>MenuButton</h4> -<p>This object describes the bot's menu button in a private chat. It should be one of</p> +<h4><a class="anchor" name="menubutton" href="#menubutton"><i class="anchor-icon"></i></a>MenuButton</h4> +<p>This object describes the bot's menu button in a private chat. It should be one of</p> <ul> <li><a href="#menubuttoncommands">MenuButtonCommands</a></li> <li><a href="#menubuttonwebapp">MenuButtonWebApp</a></li> <li><a href="#menubuttondefault">MenuButtonDefault</a></li> </ul> <p>If a menu button other than <a href="#menubuttondefault">MenuButtonDefault</a> 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.</p> -<h4><a class="anchor" href="#menubuttoncommands" id="menubuttoncommands" name="menubuttoncommands"><i class="anchor-icon"></i></a>MenuButtonCommands</h4> -<p>Represents a menu button, which opens the bot's list of commands.</p> +<h4><a class="anchor" name="menubuttoncommands" href="#menubuttoncommands"><i class="anchor-icon"></i></a>MenuButtonCommands</h4> +<p>Represents a menu button, which opens the bot's list of commands.</p> <table class="table"> <thead> <tr> @@ -3484,7 +3473,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#menubuttonwebapp" id="menubuttonwebapp" name="menubuttonwebapp"><i class="anchor-icon"></i></a>MenuButtonWebApp</h4> +<h4><a class="anchor" name="menubuttonwebapp" href="#menubuttonwebapp"><i class="anchor-icon"></i></a>MenuButtonWebApp</h4> <p>Represents a menu button, which launches a <a href="/bots/webapps">Web App</a>.</p> <table class="table"> <thead> @@ -3512,7 +3501,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#menubuttondefault" id="menubuttondefault" name="menubuttondefault"><i class="anchor-icon"></i></a>MenuButtonDefault</h4> +<h4><a class="anchor" name="menubuttondefault" href="#menubuttondefault"><i class="anchor-icon"></i></a>MenuButtonDefault</h4> <p>Describes that no specific value for the menu button was set.</p> <table class="table"> <thead> @@ -3530,7 +3519,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#responseparameters" id="responseparameters" name="responseparameters"><i class="anchor-icon"></i></a>ResponseParameters</h4> +<h4><a class="anchor" name="responseparameters" href="#responseparameters"><i class="anchor-icon"></i></a>ResponseParameters</h4> <p>Describes why a request was unsuccessful.</p> <table class="table"> <thead> @@ -3553,7 +3542,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#inputmedia" id="inputmedia" name="inputmedia"><i class="anchor-icon"></i></a>InputMedia</h4> +<h4><a class="anchor" name="inputmedia" href="#inputmedia"><i class="anchor-icon"></i></a>InputMedia</h4> <p>This object represents the content of a media message to be sent. It should be one of</p> <ul> <li><a href="#inputmediaanimation">InputMediaAnimation</a></li> @@ -3562,7 +3551,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <li><a href="#inputmediaphoto">InputMediaPhoto</a></li> <li><a href="#inputmediavideo">InputMediaVideo</a></li> </ul> -<h4><a class="anchor" href="#inputmediaphoto" id="inputmediaphoto" name="inputmediaphoto"><i class="anchor-icon"></i></a>InputMediaPhoto</h4> +<h4><a class="anchor" name="inputmediaphoto" href="#inputmediaphoto"><i class="anchor-icon"></i></a>InputMediaPhoto</h4> <p>Represents a photo to be sent.</p> <table class="table"> <thead> @@ -3581,7 +3570,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>media</td> <td>String</td> -<td>File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. <a href="#sending-files">More information on Sending Files »</a></td> +<td>File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>caption</td> @@ -3605,7 +3594,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#inputmediavideo" id="inputmediavideo" name="inputmediavideo"><i class="anchor-icon"></i></a>InputMediaVideo</h4> +<h4><a class="anchor" name="inputmediavideo" href="#inputmediavideo"><i class="anchor-icon"></i></a>InputMediaVideo</h4> <p>Represents a video to be sent.</p> <table class="table"> <thead> @@ -3624,12 +3613,12 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>media</td> <td>String</td> -<td>File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. <a href="#sending-files">More information on Sending Files »</a></td> +<td>File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>thumbnail</td> <td><a href="#inputfile">InputFile</a> or String</td> -<td><em>Optional</em>. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> +<td><em>Optional</em>. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>caption</td> @@ -3673,7 +3662,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#inputmediaanimation" id="inputmediaanimation" name="inputmediaanimation"><i class="anchor-icon"></i></a>InputMediaAnimation</h4> +<h4><a class="anchor" name="inputmediaanimation" href="#inputmediaanimation"><i class="anchor-icon"></i></a>InputMediaAnimation</h4> <p>Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.</p> <table class="table"> <thead> @@ -3692,12 +3681,12 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>media</td> <td>String</td> -<td>File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. <a href="#sending-files">More information on Sending Files »</a></td> +<td>File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>thumbnail</td> <td><a href="#inputfile">InputFile</a> or String</td> -<td><em>Optional</em>. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> +<td><em>Optional</em>. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>caption</td> @@ -3736,7 +3725,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#inputmediaaudio" id="inputmediaaudio" name="inputmediaaudio"><i class="anchor-icon"></i></a>InputMediaAudio</h4> +<h4><a class="anchor" name="inputmediaaudio" href="#inputmediaaudio"><i class="anchor-icon"></i></a>InputMediaAudio</h4> <p>Represents an audio file to be treated as music to be sent.</p> <table class="table"> <thead> @@ -3755,12 +3744,12 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>media</td> <td>String</td> -<td>File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. <a href="#sending-files">More information on Sending Files »</a></td> +<td>File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>thumbnail</td> <td><a href="#inputfile">InputFile</a> or String</td> -<td><em>Optional</em>. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> +<td><em>Optional</em>. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>caption</td> @@ -3794,7 +3783,7 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#inputmediadocument" id="inputmediadocument" name="inputmediadocument"><i class="anchor-icon"></i></a>InputMediaDocument</h4> +<h4><a class="anchor" name="inputmediadocument" href="#inputmediadocument"><i class="anchor-icon"></i></a>InputMediaDocument</h4> <p>Represents a general file to be sent.</p> <table class="table"> <thead> @@ -3813,12 +3802,12 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <tr> <td>media</td> <td>String</td> -<td>File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. <a href="#sending-files">More information on Sending Files »</a></td> +<td>File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>thumbnail</td> <td><a href="#inputfile">InputFile</a> or String</td> -<td><em>Optional</em>. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> +<td><em>Optional</em>. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>caption</td> @@ -3842,21 +3831,21 @@ At most <strong>one</strong> of the optional parameters can be present in any gi </tr> </tbody> </table> -<h4><a class="anchor" href="#inputfile" id="inputfile" name="inputfile"><i class="anchor-icon"></i></a>InputFile</h4> +<h4><a class="anchor" name="inputfile" href="#inputfile"><i class="anchor-icon"></i></a>InputFile</h4> <p>This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.</p> -<h4><a class="anchor" href="#sending-files" id="sending-files" name="sending-files"><i class="anchor-icon"></i></a>Sending files</h4> +<h4><a class="anchor" name="sending-files" href="#sending-files"><i class="anchor-icon"></i></a>Sending files</h4> <p>There are three ways to send files (photos, stickers, audio, media, etc.):</p> <ol> -<li>If the file is already stored somewhere on the Telegram servers, you don't need to reupload it: each file object has a <strong>file_id</strong> field, simply pass this <strong>file_id</strong> as a parameter instead of uploading. There are <strong>no limits</strong> for files sent this way.</li> +<li>If the file is already stored somewhere on the Telegram servers, you don't need to reupload it: each file object has a <strong>file_id</strong> field, simply pass this <strong>file_id</strong> as a parameter instead of uploading. There are <strong>no limits</strong> for files sent this way.</li> <li>Provide Telegram with an HTTP URL for the file to be sent. Telegram will download and send the file. 5 MB max size for photos and 20 MB max for other types of content.</li> <li>Post the file using multipart/form-data in the usual way that files are uploaded via the browser. 10 MB max size for photos, 50 MB for other files.</li> </ol> <p><strong>Sending by file_id</strong></p> <ul> -<li>It is not possible to change the file type when resending by <strong>file_id</strong>. I.e. a <a href="#video">video</a> can't be <a href="#sendphoto">sent as a photo</a>, a <a href="#photosize">photo</a> can't be <a href="#senddocument">sent as a document</a>, etc.</li> +<li>It is not possible to change the file type when resending by <strong>file_id</strong>. I.e. a <a href="#video">video</a> can't be <a href="#sendphoto">sent as a photo</a>, a <a href="#photosize">photo</a> can't be <a href="#senddocument">sent as a document</a>, etc.</li> <li>It is not possible to resend thumbnails.</li> <li>Resending a photo by <strong>file_id</strong> will send all of its <a href="#photosize">sizes</a>.</li> -<li><strong>file_id</strong> is unique for each individual bot and <strong>can't</strong> be transferred from one bot to another.</li> +<li><strong>file_id</strong> is unique for each individual bot and <strong>can't</strong> be transferred from one bot to another.</li> <li><strong>file_id</strong> uniquely identifies a file, but a file can have different valid <strong>file_id</strong>s even for the same bot.</li> </ul> <p><strong>Sending by URL</strong></p> @@ -3864,22 +3853,21 @@ At most <strong>one</strong> of the optional parameters can be present in any gi <li>When sending by URL the target file must have the correct MIME type (e.g., audio/mpeg for <a href="#sendaudio">sendAudio</a>, etc.).</li> <li>In <a href="#senddocument">sendDocument</a>, sending by URL will currently only work for <strong>GIF</strong>, <strong>PDF</strong> and <strong>ZIP</strong> files.</li> <li>To use <a href="#sendvoice">sendVoice</a>, 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.</li> -<li>Other configurations may work but we can't guarantee that they will.</li> +<li>Other configurations may work but we can't guarantee that they will.</li> </ul> -<h4><a class="anchor" href="#inline-mode-objects" id="inline-mode-objects" name="inline-mode-objects"><i class="anchor-icon"></i></a>Inline mode objects</h4> +<h4><a class="anchor" name="inline-mode-objects" href="#inline-mode-objects"><i class="anchor-icon"></i></a>Inline mode objects</h4> <p>Objects and methods used in the inline mode are described in the <a href="#inline-mode">Inline mode section</a>.</p> -<h3><a class="anchor" href="#available-methods" id="available-methods" name="available-methods"><i class="anchor-icon"></i></a>Available methods</h3> +<h3><a class="anchor" name="available-methods" href="#available-methods"><i class="anchor-icon"></i></a>Available methods</h3> <blockquote> -<p>All methods in the Bot API are case-insensitive. We support <strong>GET</strong> and <strong>POST</strong> HTTP methods. Use either <a href="https://en.wikipedia.org/wiki/Query_string">URL query string</a> or <em>application/json</em> or <em>application/x-www-form-urlencoded</em> or <em>multipart/form-data</em> for passing parameters in Bot API requests. -On successful call, a JSON-object containing the result will be returned.</p> +<p>All methods in the Bot API are case-insensitive. We support <strong>GET</strong> and <strong>POST</strong> HTTP methods. Use either <a href="https://en.wikipedia.org/wiki/Query_string">URL query string</a> or <em>application/json</em> or <em>application/x-www-form-urlencoded</em> or <em>multipart/form-data</em> for passing parameters in Bot API requests.<br>On successful call, a JSON-object containing the result will be returned.</p> </blockquote> -<h4><a class="anchor" href="#getme" id="getme" name="getme"><i class="anchor-icon"></i></a>getMe</h4> -<p>A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a <a href="#user">User</a> object.</p> -<h4><a class="anchor" href="#logout" id="logout" name="logout"><i class="anchor-icon"></i></a>logOut</h4> +<h4><a class="anchor" name="getme" href="#getme"><i class="anchor-icon"></i></a>getMe</h4> +<p>A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a <a href="#user">User</a> object.</p> +<h4><a class="anchor" name="logout" href="#logout"><i class="anchor-icon"></i></a>logOut</h4> <p>Use this method to log out from the cloud Bot API server before launching the bot locally. You <strong>must</strong> log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns <em>True</em> on success. Requires no parameters.</p> -<h4><a class="anchor" href="#close" id="close" name="close"><i class="anchor-icon"></i></a>close</h4> -<p>Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns <em>True</em> on success. Requires no parameters.</p> -<h4><a class="anchor" href="#sendmessage" id="sendmessage" name="sendmessage"><i class="anchor-icon"></i></a>sendMessage</h4> +<h4><a class="anchor" name="close" href="#close"><i class="anchor-icon"></i></a>close</h4> +<p>Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns <em>True</em> on success. Requires no parameters.</p> +<h4><a class="anchor" name="sendmessage" href="#sendmessage"><i class="anchor-icon"></i></a>sendMessage</h4> <p>Use this method to send text messages. On success, the sent <a href="#message">Message</a> is returned.</p> <table class="table"> <thead> @@ -3959,21 +3947,16 @@ On successful call, a JSON-object containing the result will be returned.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#formatting-options" id="formatting-options" name="formatting-options"><i class="anchor-icon"></i></a>Formatting options</h4> -<p>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.</p> -<p>Note that Telegram clients will display an <strong>alert</strong> to the user before opening an inline link ('Open this link?' together with the full URL).</p> -<p>Message entities can be nested, providing following restrictions are met:</p> -<ul> -<li>If two entities have common characters, then one of them is fully contained inside another.</li> -<li><em>bold</em>, <em>italic</em>, <em>underline</em>, <em>strikethrough</em>, and <em>spoiler</em> entities can contain and can be part of any other entities, except <em>pre</em> and <em>code</em>.</li> -<li>All other entities can't contain each other.</li> -</ul> +<h4><a class="anchor" name="formatting-options" href="#formatting-options"><i class="anchor-icon"></i></a>Formatting options</h4> +<p>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.</p> +<p>Note that Telegram clients will display an <strong>alert</strong> to the user before opening an inline link ('Open this link?' together with the full URL).</p> +<p>Message entities can be nested, providing following restrictions are met:<br>- If two entities have common characters, then one of them is fully contained inside another.<br>- <em>bold</em>, <em>italic</em>, <em>underline</em>, <em>strikethrough</em>, and <em>spoiler</em> entities can contain and can be part of any other entities, except <em>pre</em> and <em>code</em>.<br>- All other entities can't contain each other.</p> <p>Links <code>tg://user?id=<user_id></code> can be used to mention a user by their ID without using a username. Please note:</p> <ul> <li>These links will work <strong>only</strong> 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.</li> -<li>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.</li> +<li>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.</li> </ul> -<h6>MarkdownV2 style</h6> +<h6><a class="anchor" name="markdownv2-style" href="#markdownv2-style"><i class="anchor-icon"></i></a>MarkdownV2 style</h6> <p>To use this mode, pass <em>MarkdownV2</em> in the <em>parse_mode</em> field. Use the following syntax in your message:</p> <pre><code>*bold \*text* _italic \*text_ @@ -3993,28 +3976,28 @@ pre-formatted fixed-width code block written in the Python programming language ```</code></pre> <p>Please note:</p> <ul> -<li>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.</li> -<li>Inside <code>pre</code> and <code>code</code> entities, all '`' and '\' characters must be escaped with a preceding '\' character.</li> -<li>Inside the <code>(...)</code> part of the inline link and custom emoji definition, all ')' and '\' must be escaped with a preceding '\' character.</li> -<li>In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.</li> +<li>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.</li> +<li>Inside <code>pre</code> and <code>code</code> entities, all '`' and '\' characters must be escaped with a preceding '\' character.</li> +<li>Inside the <code>(...)</code> part of the inline link and custom emoji definition, all ')' and '\' must be escaped with a preceding '\' character.</li> +<li>In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.</li> <li>In case of ambiguity between <code>italic</code> and <code>underline</code> entities <code>__</code> is always greadily treated from left to right as beginning or end of <code>underline</code> entity, so instead of <code>___italic underline___</code> use <code>___italic underline_\r__</code>, where <code>\r</code> is a character with code 13, which will be ignored.</li> <li>A valid emoji must be provided as an alternative value for the custom emoji. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the <strong>emoji</strong> field of the custom emoji <a href="#sticker">sticker</a>.</li> <li>Custom emoji entities can only be used by bots that purchased additional usernames on <a href="https://fragment.com">Fragment</a>.</li> </ul> -<h6>HTML style</h6> +<h6><a class="anchor" name="html-style" href="#html-style"><i class="anchor-icon"></i></a>HTML style</h6> <p>To use this mode, pass <em>HTML</em> in the <em>parse_mode</em> field. The following tags are currently supported:</p> <pre><code><b>bold</b>, <strong>bold</strong> <i>italic</i>, <em>italic</em> <u>underline</u>, <ins>underline</ins> <s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del> -<span class="tg-spoiler">spoiler</span>, <tg-spoiler>spoiler</tg-spoiler> -<b>bold <i>italic bold <s>italic bold strikethrough <span class="tg-spoiler">italic bold strikethrough spoiler</span></s> <u>underline italic bold</u></i> bold</b> -<a href="http://www.example.com/">inline URL</a> -<a href="tg://user?id=123456789">inline mention of a user</a> -<tg-emoji emoji-id="5368324170671202286"><img class="emoji" src="//telegram.org/img/emoji/40/F09F918D.png" width="20" height="20" alt="👍" /></tg-emoji> +<span class="tg-spoiler">spoiler</span>, <tg-spoiler>spoiler</tg-spoiler> +<b>bold <i>italic bold <s>italic bold strikethrough <span class="tg-spoiler">italic bold strikethrough spoiler</span></s> <u>underline italic bold</u></i> bold</b> +<a href="http://www.example.com/">inline URL</a> +<a href="tg://user?id=123456789">inline mention of a user</a> +<tg-emoji emoji-id="5368324170671202286"><img class="emoji" src="//telegram.org/img/emoji/40/F09F918D.png" width="20" height="20" alt="👍" /></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></code></pre> +<pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre></code></pre> <p>Please note:</p> <ul> <li>Only the tags mentioned above are currently supported.</li> @@ -4022,11 +4005,11 @@ pre-formatted fixed-width code block written in the Python programming language <li>All numerical HTML entities are supported.</li> <li>The API currently supports only the following named HTML entities: <code>&lt;</code>, <code>&gt;</code>, <code>&amp;</code> and <code>&quot;</code>.</li> <li>Use nested <code>pre</code> and <code>code</code> tags, to define programming language for <code>pre</code> entity.</li> -<li>Programming language can't be specified for standalone <code>code</code> tags.</li> +<li>Programming language can't be specified for standalone <code>code</code> tags.</li> <li>A valid emoji must be used as the content of the <code>tg-emoji</code> tag. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the <strong>emoji</strong> field of the custom emoji <a href="#sticker">sticker</a>.</li> <li>Custom emoji entities can only be used by bots that purchased additional usernames on <a href="https://fragment.com">Fragment</a>.</li> </ul> -<h6>Markdown style</h6> +<h6><a class="anchor" name="markdown-style" href="#markdown-style"><i class="anchor-icon"></i></a>Markdown style</h6> <p>This is a legacy mode, retained for backward compatibility. To use this mode, pass <em>Markdown</em> in the <em>parse_mode</em> field. Use the following syntax in your message:</p> <pre><code>*bold text* _italic text_ @@ -4043,11 +4026,11 @@ pre-formatted fixed-width code block written in the Python programming language <ul> <li>Entities must not be nested, use parse mode <a href="#markdownv2-style">MarkdownV2</a> instead.</li> <li>There is no way to specify underline and strikethrough entities, use parse mode <a href="#markdownv2-style">MarkdownV2</a> instead.</li> -<li>To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.</li> +<li>To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.</li> <li>Escaping inside entities is not allowed, so entity must be closed first and reopened again: use <code>_snake_\__case_</code> for italic <code>snake_case</code> and <code>*2*\**2=4*</code> for bold <code>2*2=4</code>.</li> </ul> -<h4><a class="anchor" href="#forwardmessage" id="forwardmessage" name="forwardmessage"><i class="anchor-icon"></i></a>forwardMessage</h4> -<p>Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent <a href="#message">Message</a> is returned.</p> +<h4><a class="anchor" name="forwardmessage" href="#forwardmessage"><i class="anchor-icon"></i></a>forwardMessage</h4> +<p>Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent <a href="#message">Message</a> is returned.</p> <table class="table"> <thead> <tr> @@ -4096,8 +4079,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#copymessage" id="copymessage" name="copymessage"><i class="anchor-icon"></i></a>copyMessage</h4> -<p>Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz <a href="#poll">poll</a> can be copied only if the value of the field <em>correct_option_id</em> is known to the bot. The method is analogous to the method <a href="#forwardmessage">forwardMessage</a>, but the copied message doesn't have a link to the original message. Returns the <a href="#messageid">MessageId</a> of the sent message on success.</p> +<h4><a class="anchor" name="copymessage" href="#copymessage"><i class="anchor-icon"></i></a>copyMessage</h4> +<p>Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz <a href="#poll">poll</a> can be copied only if the value of the field <em>correct_option_id</em> is known to the bot. The method is analogous to the method <a href="#forwardmessage">forwardMessage</a>, but the copied message doesn't have a link to the original message. Returns the <a href="#messageid">MessageId</a> of the sent message on success.</p> <table class="table"> <thead> <tr> @@ -4182,7 +4165,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#sendphoto" id="sendphoto" name="sendphoto"><i class="anchor-icon"></i></a>sendPhoto</h4> +<h4><a class="anchor" name="sendphoto" href="#sendphoto"><i class="anchor-icon"></i></a>sendPhoto</h4> <p>Use this method to send photos. On success, the sent <a href="#message">Message</a> is returned.</p> <table class="table"> <thead> @@ -4210,7 +4193,7 @@ pre-formatted fixed-width code block written in the Python programming language <td>photo</td> <td><a href="#inputfile">InputFile</a> or String</td> <td>Yes</td> -<td>Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. <a href="#sending-files">More information on Sending Files »</a></td> +<td>Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>caption</td> @@ -4268,7 +4251,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#sendaudio" id="sendaudio" name="sendaudio"><i class="anchor-icon"></i></a>sendAudio</h4> +<h4><a class="anchor" name="sendaudio" href="#sendaudio"><i class="anchor-icon"></i></a>sendAudio</h4> <p>Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent <a href="#message">Message</a> is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.</p> <p>For sending voice messages, use the <a href="#sendvoice">sendVoice</a> method instead.</p> <table class="table"> @@ -4339,7 +4322,7 @@ pre-formatted fixed-width code block written in the Python programming language <td>thumbnail</td> <td><a href="#inputfile">InputFile</a> or String</td> <td>Optional</td> -<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> +<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>disable_notification</td> @@ -4373,7 +4356,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#senddocument" id="senddocument" name="senddocument"><i class="anchor-icon"></i></a>sendDocument</h4> +<h4><a class="anchor" name="senddocument" href="#senddocument"><i class="anchor-icon"></i></a>sendDocument</h4> <p>Use this method to send general files. On success, the sent <a href="#message">Message</a> is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.</p> <table class="table"> <thead> @@ -4407,7 +4390,7 @@ pre-formatted fixed-width code block written in the Python programming language <td>thumbnail</td> <td><a href="#inputfile">InputFile</a> or String</td> <td>Optional</td> -<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> +<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>caption</td> @@ -4465,7 +4448,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#sendvideo" id="sendvideo" name="sendvideo"><i class="anchor-icon"></i></a>sendVideo</h4> +<h4><a class="anchor" name="sendvideo" href="#sendvideo"><i class="anchor-icon"></i></a>sendVideo</h4> <p>Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as <a href="#document">Document</a>). On success, the sent <a href="#message">Message</a> is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.</p> <table class="table"> <thead> @@ -4517,7 +4500,7 @@ pre-formatted fixed-width code block written in the Python programming language <td>thumbnail</td> <td><a href="#inputfile">InputFile</a> or String</td> <td>Optional</td> -<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> +<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>caption</td> @@ -4581,7 +4564,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#sendanimation" id="sendanimation" name="sendanimation"><i class="anchor-icon"></i></a>sendAnimation</h4> +<h4><a class="anchor" name="sendanimation" href="#sendanimation"><i class="anchor-icon"></i></a>sendAnimation</h4> <p>Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent <a href="#message">Message</a> is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.</p> <table class="table"> <thead> @@ -4633,7 +4616,7 @@ pre-formatted fixed-width code block written in the Python programming language <td>thumbnail</td> <td><a href="#inputfile">InputFile</a> or String</td> <td>Optional</td> -<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> +<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>caption</td> @@ -4691,7 +4674,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#sendvoice" id="sendvoice" name="sendvoice"><i class="anchor-icon"></i></a>sendVoice</h4> +<h4><a class="anchor" name="sendvoice" href="#sendvoice"><i class="anchor-icon"></i></a>sendVoice</h4> <p>Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as <a href="#audio">Audio</a> or <a href="#document">Document</a>). On success, the sent <a href="#message">Message</a> is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.</p> <table class="table"> <thead> @@ -4777,7 +4760,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#sendvideonote" id="sendvideonote" name="sendvideonote"><i class="anchor-icon"></i></a>sendVideoNote</h4> +<h4><a class="anchor" name="sendvideonote" href="#sendvideonote"><i class="anchor-icon"></i></a>sendVideoNote</h4> <p>As of <a href="https://telegram.org/blog/video-messages-and-telescope">v.4.0</a>, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent <a href="#message">Message</a> is returned.</p> <table class="table"> <thead> @@ -4823,7 +4806,7 @@ pre-formatted fixed-width code block written in the Python programming language <td>thumbnail</td> <td><a href="#inputfile">InputFile</a> or String</td> <td>Optional</td> -<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> +<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>disable_notification</td> @@ -4857,7 +4840,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#sendmediagroup" id="sendmediagroup" name="sendmediagroup"><i class="anchor-icon"></i></a>sendMediaGroup</h4> +<h4><a class="anchor" name="sendmediagroup" href="#sendmediagroup"><i class="anchor-icon"></i></a>sendMediaGroup</h4> <p>Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of <a href="#message">Messages</a> that were sent is returned.</p> <table class="table"> <thead> @@ -4913,7 +4896,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#sendlocation" id="sendlocation" name="sendlocation"><i class="anchor-icon"></i></a>sendLocation</h4> +<h4><a class="anchor" name="sendlocation" href="#sendlocation"><i class="anchor-icon"></i></a>sendLocation</h4> <p>Use this method to send point on the map. On success, the sent <a href="#message">Message</a> is returned.</p> <table class="table"> <thead> @@ -5005,7 +4988,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#sendvenue" id="sendvenue" name="sendvenue"><i class="anchor-icon"></i></a>sendVenue</h4> +<h4><a class="anchor" name="sendvenue" href="#sendvenue"><i class="anchor-icon"></i></a>sendVenue</h4> <p>Use this method to send information about a venue. On success, the sent <a href="#message">Message</a> is returned.</p> <table class="table"> <thead> @@ -5063,7 +5046,7 @@ pre-formatted fixed-width code block written in the Python programming language <td>foursquare_type</td> <td>String</td> <td>Optional</td> -<td>Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".)</td> +<td>Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)</td> </tr> <tr> <td>google_place_id</td> @@ -5109,7 +5092,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#sendcontact" id="sendcontact" name="sendcontact"><i class="anchor-icon"></i></a>sendContact</h4> +<h4><a class="anchor" name="sendcontact" href="#sendcontact"><i class="anchor-icon"></i></a>sendContact</h4> <p>Use this method to send phone contacts. On success, the sent <a href="#message">Message</a> is returned.</p> <table class="table"> <thead> @@ -5137,19 +5120,19 @@ pre-formatted fixed-width code block written in the Python programming language <td>phone_number</td> <td>String</td> <td>Yes</td> -<td>Contact's phone number</td> +<td>Contact's phone number</td> </tr> <tr> <td>first_name</td> <td>String</td> <td>Yes</td> -<td>Contact's first name</td> +<td>Contact's first name</td> </tr> <tr> <td>last_name</td> <td>String</td> <td>Optional</td> -<td>Contact's last name</td> +<td>Contact's last name</td> </tr> <tr> <td>vcard</td> @@ -5189,7 +5172,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#sendpoll" id="sendpoll" name="sendpoll"><i class="anchor-icon"></i></a>sendPoll</h4> +<h4><a class="anchor" name="sendpoll" href="#sendpoll"><i class="anchor-icon"></i></a>sendPoll</h4> <p>Use this method to send a native poll. On success, the sent <a href="#message">Message</a> is returned.</p> <table class="table"> <thead> @@ -5235,7 +5218,7 @@ pre-formatted fixed-width code block written in the Python programming language <td>type</td> <td>String</td> <td>Optional</td> -<td>Poll type, "quiz" or "regular", defaults to "regular"</td> +<td>Poll type, “quiz” or “regular”, defaults to “regular”</td> </tr> <tr> <td>allows_multiple_answers</td> @@ -5271,13 +5254,13 @@ pre-formatted fixed-width code block written in the Python programming language <td>open_period</td> <td>Integer</td> <td>Optional</td> -<td>Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with <em>close_date</em>.</td> +<td>Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with <em>close_date</em>.</td> </tr> <tr> <td>close_date</td> <td>Integer</td> <td>Optional</td> -<td>Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with <em>open_period</em>.</td> +<td>Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with <em>open_period</em>.</td> </tr> <tr> <td>is_closed</td> @@ -5317,7 +5300,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#senddice" id="senddice" name="senddice"><i class="anchor-icon"></i></a>sendDice</h4> +<h4><a class="anchor" name="senddice" href="#senddice"><i class="anchor-icon"></i></a>sendDice</h4> <p>Use this method to send an animated emoji that will display a random value. On success, the sent <a href="#message">Message</a> is returned.</p> <table class="table"> <thead> @@ -5345,7 +5328,7 @@ pre-formatted fixed-width code block written in the Python programming language <td>emoji</td> <td>String</td> <td>Optional</td> -<td>Emoji on which the dice throw animation is based. Currently, must be one of "<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />", "<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EAF.png" width="20" height="20" alt="🎯" />", "<img class="emoji" src="//telegram.org/img/emoji/40/F09F8F80.png" width="20" height="20" alt="🏀" />", "<img class="emoji" src="//telegram.org/img/emoji/40/E29ABD.png" width="20" height="20" alt="⚽" />", "<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB3.png" width="20" height="20" alt="🎳" />", or "<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB0.png" width="20" height="20" alt="🎰" />". Dice can have values 1-6 for "<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />", "<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EAF.png" width="20" height="20" alt="🎯" />" and "<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB3.png" width="20" height="20" alt="🎳" />", values 1-5 for "<img class="emoji" src="//telegram.org/img/emoji/40/F09F8F80.png" width="20" height="20" alt="🏀" />" and "<img class="emoji" src="//telegram.org/img/emoji/40/E29ABD.png" width="20" height="20" alt="⚽" />", and values 1-64 for "<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB0.png" width="20" height="20" alt="🎰" />". Defaults to "<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />"</td> +<td>Emoji on which the dice throw animation is based. Currently, must be one of “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EAF.png" width="20" height="20" alt="🎯" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8F80.png" width="20" height="20" alt="🏀" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/E29ABD.png" width="20" height="20" alt="⚽" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB3.png" width="20" height="20" alt="🎳" />”, or “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB0.png" width="20" height="20" alt="🎰" />”. Dice can have values 1-6 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EAF.png" width="20" height="20" alt="🎯" />” and “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB3.png" width="20" height="20" alt="🎳" />”, values 1-5 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8F80.png" width="20" height="20" alt="🏀" />” and “<img class="emoji" src="//telegram.org/img/emoji/40/E29ABD.png" width="20" height="20" alt="⚽" />”, and values 1-64 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB0.png" width="20" height="20" alt="🎰" />”. Defaults to “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />”</td> </tr> <tr> <td>disable_notification</td> @@ -5379,10 +5362,10 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#sendchataction" id="sendchataction" name="sendchataction"><i class="anchor-icon"></i></a>sendChatAction</h4> -<p>Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="sendchataction" href="#sendchataction"><i class="anchor-icon"></i></a>sendChatAction</h4> +<p>Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns <em>True</em> on success.</p> <blockquote> -<p>Example: The <a href="https://t.me/imagebot">ImageBot</a> needs some time to process a request and upload the image. Instead of sending a text message along the lines of "Retrieving image, please wait...", the bot may use <a href="#sendchataction">sendChatAction</a> with <em>action</em> = <em>upload_photo</em>. The user will see a "sending photo" status for the bot.</p> +<p>Example: The <a href="https://t.me/imagebot">ImageBot</a> needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use <a href="#sendchataction">sendChatAction</a> with <em>action</em> = <em>upload_photo</em>. The user will see a “sending photo” status for the bot.</p> </blockquote> <p>We only recommend using this method when a response from the bot will take a <strong>noticeable</strong> amount of time to arrive.</p> <table class="table"> @@ -5415,7 +5398,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#getuserprofilephotos" id="getuserprofilephotos" name="getuserprofilephotos"><i class="anchor-icon"></i></a>getUserProfilePhotos</h4> +<h4><a class="anchor" name="getuserprofilephotos" href="#getuserprofilephotos"><i class="anchor-icon"></i></a>getUserProfilePhotos</h4> <p>Use this method to get a list of profile pictures for a user. Returns a <a href="#userprofilephotos">UserProfilePhotos</a> object.</p> <table class="table"> <thead> @@ -5447,7 +5430,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#getfile" id="getfile" name="getfile"><i class="anchor-icon"></i></a>getFile</h4> +<h4><a class="anchor" name="getfile" href="#getfile"><i class="anchor-icon"></i></a>getFile</h4> <p>Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a <a href="#file">File</a> object is returned. The file can then be downloaded via the link <code>https://api.telegram.org/file/bot<token>/<file_path></code>, where <code><file_path></code> is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling <a href="#getfile">getFile</a> again.</p> <table class="table"> <thead> @@ -5467,8 +5450,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<p><strong>Note:</strong> This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received.</p> -<h4><a class="anchor" href="#banchatmember" id="banchatmember" name="banchatmember"><i class="anchor-icon"></i></a>banChatMember</h4> +<p><strong>Note:</strong> This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received.</p> +<h4><a class="anchor" name="banchatmember" href="#banchatmember"><i class="anchor-icon"></i></a>banChatMember</h4> <p>Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless <a href="#unbanchatmember">unbanned</a> first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -5506,8 +5489,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#unbanchatmember" id="unbanchatmember" name="unbanchatmember"><i class="anchor-icon"></i></a>unbanChatMember</h4> -<p>Use this method to unban a previously banned user in a supergroup or channel. The user will <strong>not</strong> return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be <strong>removed</strong> from the chat. If you don't want this, use the parameter <em>only_if_banned</em>. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="unbanchatmember" href="#unbanchatmember"><i class="anchor-icon"></i></a>unbanChatMember</h4> +<p>Use this method to unban a previously banned user in a supergroup or channel. The user will <strong>not</strong> return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be <strong>removed</strong> from the chat. If you don't want this, use the parameter <em>only_if_banned</em>. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -5538,7 +5521,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#restrictchatmember" id="restrictchatmember" name="restrictchatmember"><i class="anchor-icon"></i></a>restrictChatMember</h4> +<h4><a class="anchor" name="restrictchatmember" href="#restrictchatmember"><i class="anchor-icon"></i></a>restrictChatMember</h4> <p>Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass <em>True</em> for all permissions to lift restrictions from a user. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -5582,7 +5565,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#promotechatmember" id="promotechatmember" name="promotechatmember"><i class="anchor-icon"></i></a>promoteChatMember</h4> +<h4><a class="anchor" name="promotechatmember" href="#promotechatmember"><i class="anchor-icon"></i></a>promoteChatMember</h4> <p>Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass <em>False</em> for all boolean parameters to demote a user. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -5610,7 +5593,7 @@ pre-formatted fixed-width code block written in the Python programming language <td>is_anonymous</td> <td>Boolean</td> <td>Optional</td> -<td>Pass <em>True</em> if the administrator's presence in the chat is hidden</td> +<td>Pass <em>True</em> if the administrator's presence in the chat is hidden</td> </tr> <tr> <td>can_manage_chat</td> @@ -5680,7 +5663,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#setchatadministratorcustomtitle" id="setchatadministratorcustomtitle" name="setchatadministratorcustomtitle"><i class="anchor-icon"></i></a>setChatAdministratorCustomTitle</h4> +<h4><a class="anchor" name="setchatadministratorcustomtitle" href="#setchatadministratorcustomtitle"><i class="anchor-icon"></i></a>setChatAdministratorCustomTitle</h4> <p>Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -5712,8 +5695,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#banchatsenderchat" id="banchatsenderchat" name="banchatsenderchat"><i class="anchor-icon"></i></a>banChatSenderChat</h4> -<p>Use this method to ban a channel chat in a supergroup or a channel. Until the chat is <a href="#unbanchatsenderchat">unbanned</a>, the owner of the banned chat won't be able to send messages on behalf of <strong>any of their channels</strong>. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="banchatsenderchat" href="#banchatsenderchat"><i class="anchor-icon"></i></a>banChatSenderChat</h4> +<p>Use this method to ban a channel chat in a supergroup or a channel. Until the chat is <a href="#unbanchatsenderchat">unbanned</a>, the owner of the banned chat won't be able to send messages on behalf of <strong>any of their channels</strong>. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -5738,7 +5721,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#unbanchatsenderchat" id="unbanchatsenderchat" name="unbanchatsenderchat"><i class="anchor-icon"></i></a>unbanChatSenderChat</h4> +<h4><a class="anchor" name="unbanchatsenderchat" href="#unbanchatsenderchat"><i class="anchor-icon"></i></a>unbanChatSenderChat</h4> <p>Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -5764,7 +5747,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#setchatpermissions" id="setchatpermissions" name="setchatpermissions"><i class="anchor-icon"></i></a>setChatPermissions</h4> +<h4><a class="anchor" name="setchatpermissions" href="#setchatpermissions"><i class="anchor-icon"></i></a>setChatPermissions</h4> <p>Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the <em>can_restrict_members</em> administrator rights. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -5796,7 +5779,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#exportchatinvitelink" id="exportchatinvitelink" name="exportchatinvitelink"><i class="anchor-icon"></i></a>exportChatInviteLink</h4> +<h4><a class="anchor" name="exportchatinvitelink" href="#exportchatinvitelink"><i class="anchor-icon"></i></a>exportChatInviteLink</h4> <p>Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as <em>String</em> on success.</p> <table class="table"> <thead> @@ -5817,9 +5800,9 @@ pre-formatted fixed-width code block written in the Python programming language </tbody> </table> <blockquote> -<p>Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using <a href="#exportchatinvitelink">exportChatInviteLink</a> or by calling the <a href="#getchat">getChat</a> method. If your bot needs to generate a new primary invite link replacing its previous one, use <a href="#exportchatinvitelink">exportChatInviteLink</a> again.</p> +<p>Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using <a href="#exportchatinvitelink">exportChatInviteLink</a> or by calling the <a href="#getchat">getChat</a> method. If your bot needs to generate a new primary invite link replacing its previous one, use <a href="#exportchatinvitelink">exportChatInviteLink</a> again.</p> </blockquote> -<h4><a class="anchor" href="#createchatinvitelink" id="createchatinvitelink" name="createchatinvitelink"><i class="anchor-icon"></i></a>createChatInviteLink</h4> +<h4><a class="anchor" name="createchatinvitelink" href="#createchatinvitelink"><i class="anchor-icon"></i></a>createChatInviteLink</h4> <p>Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method <a href="#revokechatinvitelink">revokeChatInviteLink</a>. Returns the new invite link as <a href="#chatinvitelink">ChatInviteLink</a> object.</p> <table class="table"> <thead> @@ -5859,11 +5842,11 @@ pre-formatted fixed-width code block written in the Python programming language <td>creates_join_request</td> <td>Boolean</td> <td>Optional</td> -<td><em>True</em>, if users joining the chat via the link need to be approved by chat administrators. If <em>True</em>, <em>member_limit</em> can't be specified</td> +<td><em>True</em>, if users joining the chat via the link need to be approved by chat administrators. If <em>True</em>, <em>member_limit</em> can't be specified</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#editchatinvitelink" id="editchatinvitelink" name="editchatinvitelink"><i class="anchor-icon"></i></a>editChatInviteLink</h4> +<h4><a class="anchor" name="editchatinvitelink" href="#editchatinvitelink"><i class="anchor-icon"></i></a>editChatInviteLink</h4> <p>Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a <a href="#chatinvitelink">ChatInviteLink</a> object.</p> <table class="table"> <thead> @@ -5909,11 +5892,11 @@ pre-formatted fixed-width code block written in the Python programming language <td>creates_join_request</td> <td>Boolean</td> <td>Optional</td> -<td><em>True</em>, if users joining the chat via the link need to be approved by chat administrators. If <em>True</em>, <em>member_limit</em> can't be specified</td> +<td><em>True</em>, if users joining the chat via the link need to be approved by chat administrators. If <em>True</em>, <em>member_limit</em> can't be specified</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#revokechatinvitelink" id="revokechatinvitelink" name="revokechatinvitelink"><i class="anchor-icon"></i></a>revokeChatInviteLink</h4> +<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"> <thead> @@ -5939,7 +5922,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#approvechatjoinrequest" id="approvechatjoinrequest" name="approvechatjoinrequest"><i class="anchor-icon"></i></a>approveChatJoinRequest</h4> +<h4><a class="anchor" name="approvechatjoinrequest" href="#approvechatjoinrequest"><i class="anchor-icon"></i></a>approveChatJoinRequest</h4> <p>Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the <em>can_invite_users</em> administrator right. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -5965,7 +5948,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#declinechatjoinrequest" id="declinechatjoinrequest" name="declinechatjoinrequest"><i class="anchor-icon"></i></a>declineChatJoinRequest</h4> +<h4><a class="anchor" name="declinechatjoinrequest" href="#declinechatjoinrequest"><i class="anchor-icon"></i></a>declineChatJoinRequest</h4> <p>Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the <em>can_invite_users</em> administrator right. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -5991,8 +5974,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#setchatphoto" id="setchatphoto" name="setchatphoto"><i class="anchor-icon"></i></a>setChatPhoto</h4> -<p>Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="setchatphoto" href="#setchatphoto"><i class="anchor-icon"></i></a>setChatPhoto</h4> +<p>Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6017,8 +6000,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#deletechatphoto" id="deletechatphoto" name="deletechatphoto"><i class="anchor-icon"></i></a>deleteChatPhoto</h4> -<p>Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="deletechatphoto" href="#deletechatphoto"><i class="anchor-icon"></i></a>deleteChatPhoto</h4> +<p>Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6037,8 +6020,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#setchattitle" id="setchattitle" name="setchattitle"><i class="anchor-icon"></i></a>setChatTitle</h4> -<p>Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="setchattitle" href="#setchattitle"><i class="anchor-icon"></i></a>setChatTitle</h4> +<p>Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6063,7 +6046,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#setchatdescription" id="setchatdescription" name="setchatdescription"><i class="anchor-icon"></i></a>setChatDescription</h4> +<h4><a class="anchor" name="setchatdescription" href="#setchatdescription"><i class="anchor-icon"></i></a>setChatDescription</h4> <p>Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -6089,8 +6072,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#pinchatmessage" id="pinchatmessage" name="pinchatmessage"><i class="anchor-icon"></i></a>pinChatMessage</h4> -<p>Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="pinchatmessage" href="#pinchatmessage"><i class="anchor-icon"></i></a>pinChatMessage</h4> +<p>Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6121,8 +6104,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#unpinchatmessage" id="unpinchatmessage" name="unpinchatmessage"><i class="anchor-icon"></i></a>unpinChatMessage</h4> -<p>Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="unpinchatmessage" href="#unpinchatmessage"><i class="anchor-icon"></i></a>unpinChatMessage</h4> +<p>Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6147,8 +6130,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#unpinallchatmessages" id="unpinallchatmessages" name="unpinallchatmessages"><i class="anchor-icon"></i></a>unpinAllChatMessages</h4> -<p>Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="unpinallchatmessages" href="#unpinallchatmessages"><i class="anchor-icon"></i></a>unpinAllChatMessages</h4> +<p>Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6167,7 +6150,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#leavechat" id="leavechat" name="leavechat"><i class="anchor-icon"></i></a>leaveChat</h4> +<h4><a class="anchor" name="leavechat" href="#leavechat"><i class="anchor-icon"></i></a>leaveChat</h4> <p>Use this method for your bot to leave a group, supergroup or channel. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -6187,7 +6170,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#getchat" id="getchat" name="getchat"><i class="anchor-icon"></i></a>getChat</h4> +<h4><a class="anchor" name="getchat" href="#getchat"><i class="anchor-icon"></i></a>getChat</h4> <p>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 <a href="#chat">Chat</a> object on success.</p> <table class="table"> <thead> @@ -6207,8 +6190,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#getchatadministrators" id="getchatadministrators" name="getchatadministrators"><i class="anchor-icon"></i></a>getChatAdministrators</h4> -<p>Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of <a href="#chatmember">ChatMember</a> objects.</p> +<h4><a class="anchor" name="getchatadministrators" href="#getchatadministrators"><i class="anchor-icon"></i></a>getChatAdministrators</h4> +<p>Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of <a href="#chatmember">ChatMember</a> objects.</p> <table class="table"> <thead> <tr> @@ -6227,7 +6210,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#getchatmembercount" id="getchatmembercount" name="getchatmembercount"><i class="anchor-icon"></i></a>getChatMemberCount</h4> +<h4><a class="anchor" name="getchatmembercount" href="#getchatmembercount"><i class="anchor-icon"></i></a>getChatMemberCount</h4> <p>Use this method to get the number of members in a chat. Returns <em>Int</em> on success.</p> <table class="table"> <thead> @@ -6247,7 +6230,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#getchatmember" id="getchatmember" name="getchatmember"><i class="anchor-icon"></i></a>getChatMember</h4> +<h4><a class="anchor" name="getchatmember" href="#getchatmember"><i class="anchor-icon"></i></a>getChatMember</h4> <p>Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a <a href="#chatmember">ChatMember</a> object on success.</p> <table class="table"> <thead> @@ -6273,7 +6256,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#setchatstickerset" id="setchatstickerset" name="setchatstickerset"><i class="anchor-icon"></i></a>setChatStickerSet</h4> +<h4><a class="anchor" name="setchatstickerset" href="#setchatstickerset"><i class="anchor-icon"></i></a>setChatStickerSet</h4> <p>Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field <em>can_set_sticker_set</em> optionally returned in <a href="#getchat">getChat</a> requests to check if the bot can use this method. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -6299,7 +6282,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#deletechatstickerset" id="deletechatstickerset" name="deletechatstickerset"><i class="anchor-icon"></i></a>deleteChatStickerSet</h4> +<h4><a class="anchor" name="deletechatstickerset" href="#deletechatstickerset"><i class="anchor-icon"></i></a>deleteChatStickerSet</h4> <p>Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field <em>can_set_sticker_set</em> optionally returned in <a href="#getchat">getChat</a> requests to check if the bot can use this method. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -6319,9 +6302,9 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#getforumtopiciconstickers" id="getforumtopiciconstickers" name="getforumtopiciconstickers"><i class="anchor-icon"></i></a>getForumTopicIconStickers</h4> +<h4><a class="anchor" name="getforumtopiciconstickers" href="#getforumtopiciconstickers"><i class="anchor-icon"></i></a>getForumTopicIconStickers</h4> <p>Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of <a href="#sticker">Sticker</a> objects.</p> -<h4><a class="anchor" href="#createforumtopic" id="createforumtopic" name="createforumtopic"><i class="anchor-icon"></i></a>createForumTopic</h4> +<h4><a class="anchor" name="createforumtopic" href="#createforumtopic"><i class="anchor-icon"></i></a>createForumTopic</h4> <p>Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. Returns information about the created topic as a <a href="#forumtopic">ForumTopic</a> object.</p> <table class="table"> <thead> @@ -6359,7 +6342,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#editforumtopic" id="editforumtopic" name="editforumtopic"><i class="anchor-icon"></i></a>editForumTopic</h4> +<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> <table class="table"> <thead> @@ -6397,7 +6380,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#closeforumtopic" id="closeforumtopic" name="closeforumtopic"><i class="anchor-icon"></i></a>closeForumTopic</h4> +<h4><a class="anchor" name="closeforumtopic" href="#closeforumtopic"><i class="anchor-icon"></i></a>closeForumTopic</h4> <p>Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <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> @@ -6423,7 +6406,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#reopenforumtopic" id="reopenforumtopic" name="reopenforumtopic"><i class="anchor-icon"></i></a>reopenForumTopic</h4> +<h4><a class="anchor" name="reopenforumtopic" href="#reopenforumtopic"><i class="anchor-icon"></i></a>reopenForumTopic</h4> <p>Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <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> @@ -6449,7 +6432,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#deleteforumtopic" id="deleteforumtopic" name="deleteforumtopic"><i class="anchor-icon"></i></a>deleteForumTopic</h4> +<h4><a class="anchor" name="deleteforumtopic" href="#deleteforumtopic"><i class="anchor-icon"></i></a>deleteForumTopic</h4> <p>Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_delete_messages</em> administrator rights. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -6475,7 +6458,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#unpinallforumtopicmessages" id="unpinallforumtopicmessages" name="unpinallforumtopicmessages"><i class="anchor-icon"></i></a>unpinAllForumTopicMessages</h4> +<h4><a class="anchor" name="unpinallforumtopicmessages" href="#unpinallforumtopicmessages"><i class="anchor-icon"></i></a>unpinAllForumTopicMessages</h4> <p>Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the <em>can_pin_messages</em> administrator right in the supergroup. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -6501,8 +6484,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#editgeneralforumtopic" id="editgeneralforumtopic" name="editgeneralforumtopic"><i class="anchor-icon"></i></a>editGeneralForumTopic</h4> -<p>Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have <em>can_manage_topics</em> administrator rights. Returns <em>True</em> on success.</p> +<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 'General' 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> <table class="table"> <thead> <tr> @@ -6527,8 +6510,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#closegeneralforumtopic" id="closegeneralforumtopic" name="closegeneralforumtopic"><i class="anchor-icon"></i></a>closeGeneralForumTopic</h4> -<p>Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="closegeneralforumtopic" href="#closegeneralforumtopic"><i class="anchor-icon"></i></a>closeGeneralForumTopic</h4> +<p>Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6547,8 +6530,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#reopengeneralforumtopic" id="reopengeneralforumtopic" name="reopengeneralforumtopic"><i class="anchor-icon"></i></a>reopenGeneralForumTopic</h4> -<p>Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. The topic will be automatically unhidden if it was hidden. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="reopengeneralforumtopic" href="#reopengeneralforumtopic"><i class="anchor-icon"></i></a>reopenGeneralForumTopic</h4> +<p>Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. The topic will be automatically unhidden if it was hidden. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6567,8 +6550,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#hidegeneralforumtopic" id="hidegeneralforumtopic" name="hidegeneralforumtopic"><i class="anchor-icon"></i></a>hideGeneralForumTopic</h4> -<p>Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. The topic will be automatically closed if it was open. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="hidegeneralforumtopic" href="#hidegeneralforumtopic"><i class="anchor-icon"></i></a>hideGeneralForumTopic</h4> +<p>Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. The topic will be automatically closed if it was open. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6587,8 +6570,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#unhidegeneralforumtopic" id="unhidegeneralforumtopic" name="unhidegeneralforumtopic"><i class="anchor-icon"></i></a>unhideGeneralForumTopic</h4> -<p>Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="unhidegeneralforumtopic" href="#unhidegeneralforumtopic"><i class="anchor-icon"></i></a>unhideGeneralForumTopic</h4> +<p>Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6607,7 +6590,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#answercallbackquery" id="answercallbackquery" name="answercallbackquery"><i class="anchor-icon"></i></a>answerCallbackQuery</h4> +<h4><a class="anchor" name="answercallbackquery" href="#answercallbackquery"><i class="anchor-icon"></i></a>answerCallbackQuery</h4> <p>Use this method to send answers to callback queries sent from <a href="/bots/features#inline-keyboards">inline keyboards</a>. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, <em>True</em> is returned.</p> <blockquote> <p>Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via <a href="https://t.me/botfather">@BotFather</a> and accept the terms. Otherwise, you may use links like <code>t.me/your_bot?start=XXXX</code> that open your bot with a parameter.</p> @@ -6644,7 +6627,7 @@ pre-formatted fixed-width code block written in the Python programming language <td>url</td> <td>String</td> <td>Optional</td> -<td>URL that will be opened by the user's client. If you have created a <a href="#game">Game</a> and accepted the conditions via <a href="https://t.me/botfather">@BotFather</a>, specify the URL that opens your game - note that this will only work if the query comes from a <a href="#inlinekeyboardbutton"><em>callback_game</em></a> button.<br><br>Otherwise, you may use links like <code>t.me/your_bot?start=XXXX</code> that open your bot with a parameter.</td> +<td>URL that will be opened by the user's client. If you have created a <a href="#game">Game</a> and accepted the conditions via <a href="https://t.me/botfather">@BotFather</a>, specify the URL that opens your game - note that this will only work if the query comes from a <a href="#inlinekeyboardbutton"><em>callback_game</em></a> button.<br><br>Otherwise, you may use links like <code>t.me/your_bot?start=XXXX</code> that open your bot with a parameter.</td> </tr> <tr> <td>cache_time</td> @@ -6654,8 +6637,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#setmycommands" id="setmycommands" name="setmycommands"><i class="anchor-icon"></i></a>setMyCommands</h4> -<p>Use this method to change the list of the bot's commands. See <a href="/bots/features#commands">this manual</a> for more details about bot commands. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="setmycommands" href="#setmycommands"><i class="anchor-icon"></i></a>setMyCommands</h4> +<p>Use this method to change the list of the bot's commands. See <a href="/bots/features#commands">this manual</a> for more details about bot commands. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6670,7 +6653,7 @@ pre-formatted fixed-width code block written in the Python programming language <td>commands</td> <td>Array of <a href="#botcommand">BotCommand</a></td> <td>Yes</td> -<td>A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.</td> +<td>A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.</td> </tr> <tr> <td>scope</td> @@ -6686,8 +6669,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#deletemycommands" id="deletemycommands" name="deletemycommands"><i class="anchor-icon"></i></a>deleteMyCommands</h4> -<p>Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, <a href="#determining-list-of-commands">higher level commands</a> will be shown to affected users. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="deletemycommands" href="#deletemycommands"><i class="anchor-icon"></i></a>deleteMyCommands</h4> +<p>Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, <a href="#determining-list-of-commands">higher level commands</a> will be shown to affected users. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6712,8 +6695,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#getmycommands" id="getmycommands" name="getmycommands"><i class="anchor-icon"></i></a>getMyCommands</h4> -<p>Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of <a href="#botcommand">BotCommand</a> objects. If commands aren't set, an empty list is returned.</p> +<h4><a class="anchor" name="getmycommands" href="#getmycommands"><i class="anchor-icon"></i></a>getMyCommands</h4> +<p>Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of <a href="#botcommand">BotCommand</a> objects. If commands aren't set, an empty list is returned.</p> <table class="table"> <thead> <tr> @@ -6738,8 +6721,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#setmyname" id="setmyname" name="setmyname"><i class="anchor-icon"></i></a>setMyName</h4> -<p>Use this method to change the bot's name. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="setmyname" href="#setmyname"><i class="anchor-icon"></i></a>setMyName</h4> +<p>Use this method to change the bot's name. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6764,7 +6747,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#getmyname" id="getmyname" name="getmyname"><i class="anchor-icon"></i></a>getMyName</h4> +<h4><a class="anchor" name="getmyname" href="#getmyname"><i class="anchor-icon"></i></a>getMyName</h4> <p>Use this method to get the current bot name for the given user language. Returns <a href="#botname">BotName</a> on success.</p> <table class="table"> <thead> @@ -6784,8 +6767,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#setmydescription" id="setmydescription" name="setmydescription"><i class="anchor-icon"></i></a>setMyDescription</h4> -<p>Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="setmydescription" href="#setmydescription"><i class="anchor-icon"></i></a>setMyDescription</h4> +<p>Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6810,7 +6793,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#getmydescription" id="getmydescription" name="getmydescription"><i class="anchor-icon"></i></a>getMyDescription</h4> +<h4><a class="anchor" name="getmydescription" href="#getmydescription"><i class="anchor-icon"></i></a>getMyDescription</h4> <p>Use this method to get the current bot description for the given user language. Returns <a href="#botdescription">BotDescription</a> on success.</p> <table class="table"> <thead> @@ -6830,8 +6813,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#setmyshortdescription" id="setmyshortdescription" name="setmyshortdescription"><i class="anchor-icon"></i></a>setMyShortDescription</h4> -<p>Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="setmyshortdescription" href="#setmyshortdescription"><i class="anchor-icon"></i></a>setMyShortDescription</h4> +<p>Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6856,7 +6839,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#getmyshortdescription" id="getmyshortdescription" name="getmyshortdescription"><i class="anchor-icon"></i></a>getMyShortDescription</h4> +<h4><a class="anchor" name="getmyshortdescription" href="#getmyshortdescription"><i class="anchor-icon"></i></a>getMyShortDescription</h4> <p>Use this method to get the current bot short description for the given user language. Returns <a href="#botshortdescription">BotShortDescription</a> on success.</p> <table class="table"> <thead> @@ -6876,8 +6859,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#setchatmenubutton" id="setchatmenubutton" name="setchatmenubutton"><i class="anchor-icon"></i></a>setChatMenuButton</h4> -<p>Use this method to change the bot's menu button in a private chat, or the default menu button. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="setchatmenubutton" href="#setchatmenubutton"><i class="anchor-icon"></i></a>setChatMenuButton</h4> +<p>Use this method to change the bot's menu button in a private chat, or the default menu button. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6892,18 +6875,18 @@ pre-formatted fixed-width code block written in the Python programming language <td>chat_id</td> <td>Integer</td> <td>Optional</td> -<td>Unique identifier for the target private chat. If not specified, default bot's menu button will be changed</td> +<td>Unique identifier for the target private chat. If not specified, default bot's menu button will be changed</td> </tr> <tr> <td>menu_button</td> <td><a href="#menubutton">MenuButton</a></td> <td>Optional</td> -<td>A JSON-serialized object for the bot's new menu button. Defaults to <a href="#menubuttondefault">MenuButtonDefault</a></td> +<td>A JSON-serialized object for the bot's new menu button. Defaults to <a href="#menubuttondefault">MenuButtonDefault</a></td> </tr> </tbody> </table> -<h4><a class="anchor" href="#getchatmenubutton" id="getchatmenubutton" name="getchatmenubutton"><i class="anchor-icon"></i></a>getChatMenuButton</h4> -<p>Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns <a href="#menubutton">MenuButton</a> on success.</p> +<h4><a class="anchor" name="getchatmenubutton" href="#getchatmenubutton"><i class="anchor-icon"></i></a>getChatMenuButton</h4> +<p>Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns <a href="#menubutton">MenuButton</a> on success.</p> <table class="table"> <thead> <tr> @@ -6918,12 +6901,12 @@ pre-formatted fixed-width code block written in the Python programming language <td>chat_id</td> <td>Integer</td> <td>Optional</td> -<td>Unique identifier for the target private chat. If not specified, default bot's menu button will be returned</td> +<td>Unique identifier for the target private chat. If not specified, default bot's menu button will be returned</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#setmydefaultadministratorrights" id="setmydefaultadministratorrights" name="setmydefaultadministratorrights"><i class="anchor-icon"></i></a>setMyDefaultAdministratorRights</h4> -<p>Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns <em>True</em> on success.</p> +<h4><a class="anchor" name="setmydefaultadministratorrights" href="#setmydefaultadministratorrights"><i class="anchor-icon"></i></a>setMyDefaultAdministratorRights</h4> +<p>Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -6948,7 +6931,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#getmydefaultadministratorrights" id="getmydefaultadministratorrights" name="getmydefaultadministratorrights"><i class="anchor-icon"></i></a>getMyDefaultAdministratorRights</h4> +<h4><a class="anchor" name="getmydefaultadministratorrights" href="#getmydefaultadministratorrights"><i class="anchor-icon"></i></a>getMyDefaultAdministratorRights</h4> <p>Use this method to get the current default administrator rights of the bot. Returns <a href="#chatadministratorrights">ChatAdministratorRights</a> on success.</p> <table class="table"> <thead> @@ -6968,12 +6951,12 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#inline-mode-methods" id="inline-mode-methods" name="inline-mode-methods"><i class="anchor-icon"></i></a>Inline mode methods</h4> +<h4><a class="anchor" name="inline-mode-methods" href="#inline-mode-methods"><i class="anchor-icon"></i></a>Inline mode methods</h4> <p>Methods and objects used in the inline mode are described in the <a href="#inline-mode">Inline mode section</a>.</p> -<h3><a class="anchor" href="#updating-messages" id="updating-messages" name="updating-messages"><i class="anchor-icon"></i></a>Updating messages</h3> +<h3><a class="anchor" name="updating-messages" href="#updating-messages"><i class="anchor-icon"></i></a>Updating messages</h3> <p>The following methods allow you to change an existing message in the message history instead of sending a new one with a result of an action. This is most useful for messages with <a href="/bots/features#inline-keyboards">inline keyboards</a> using callback queries, but can also help reduce clutter in conversations with regular chat bots.</p> <p>Please note, that it is currently only possible to edit messages without <em>reply_markup</em> or with <a href="/bots/features#inline-keyboards">inline keyboards</a>.</p> -<h4><a class="anchor" href="#editmessagetext" id="editmessagetext" name="editmessagetext"><i class="anchor-icon"></i></a>editMessageText</h4> +<h4><a class="anchor" name="editmessagetext" href="#editmessagetext"><i class="anchor-icon"></i></a>editMessageText</h4> <p>Use this method to edit text and <a href="#games">game</a> messages. On success, if the edited message is not an inline message, the edited <a href="#message">Message</a> is returned, otherwise <em>True</em> is returned.</p> <table class="table"> <thead> @@ -7035,7 +7018,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#editmessagecaption" id="editmessagecaption" name="editmessagecaption"><i class="anchor-icon"></i></a>editMessageCaption</h4> +<h4><a class="anchor" name="editmessagecaption" href="#editmessagecaption"><i class="anchor-icon"></i></a>editMessageCaption</h4> <p>Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited <a href="#message">Message</a> is returned, otherwise <em>True</em> is returned.</p> <table class="table"> <thead> @@ -7091,8 +7074,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#editmessagemedia" id="editmessagemedia" name="editmessagemedia"><i class="anchor-icon"></i></a>editMessageMedia</h4> -<p>Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited <a href="#message">Message</a> is returned, otherwise <em>True</em> is returned.</p> +<h4><a class="anchor" name="editmessagemedia" href="#editmessagemedia"><i class="anchor-icon"></i></a>editMessageMedia</h4> +<p>Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited <a href="#message">Message</a> is returned, otherwise <em>True</em> is returned.</p> <table class="table"> <thead> <tr> @@ -7135,7 +7118,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#editmessagelivelocation" id="editmessagelivelocation" name="editmessagelivelocation"><i class="anchor-icon"></i></a>editMessageLiveLocation</h4> +<h4><a class="anchor" name="editmessagelivelocation" href="#editmessagelivelocation"><i class="anchor-icon"></i></a>editMessageLiveLocation</h4> <p>Use this method to edit live location messages. A location can be edited until its <em>live_period</em> expires or editing is explicitly disabled by a call to <a href="#stopmessagelivelocation">stopMessageLiveLocation</a>. On success, if the edited message is not an inline message, the edited <a href="#message">Message</a> is returned, otherwise <em>True</em> is returned.</p> <table class="table"> <thead> @@ -7203,7 +7186,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#stopmessagelivelocation" id="stopmessagelivelocation" name="stopmessagelivelocation"><i class="anchor-icon"></i></a>stopMessageLiveLocation</h4> +<h4><a class="anchor" name="stopmessagelivelocation" href="#stopmessagelivelocation"><i class="anchor-icon"></i></a>stopMessageLiveLocation</h4> <p>Use this method to stop updating a live location message before <em>live_period</em> expires. On success, if the message is not an inline message, the edited <a href="#message">Message</a> is returned, otherwise <em>True</em> is returned.</p> <table class="table"> <thead> @@ -7241,7 +7224,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#editmessagereplymarkup" id="editmessagereplymarkup" name="editmessagereplymarkup"><i class="anchor-icon"></i></a>editMessageReplyMarkup</h4> +<h4><a class="anchor" name="editmessagereplymarkup" href="#editmessagereplymarkup"><i class="anchor-icon"></i></a>editMessageReplyMarkup</h4> <p>Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited <a href="#message">Message</a> is returned, otherwise <em>True</em> is returned.</p> <table class="table"> <thead> @@ -7279,7 +7262,7 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#stoppoll" id="stoppoll" name="stoppoll"><i class="anchor-icon"></i></a>stopPoll</h4> +<h4><a class="anchor" name="stoppoll" href="#stoppoll"><i class="anchor-icon"></i></a>stopPoll</h4> <p>Use this method to stop a poll which was sent by the bot. On success, the stopped <a href="#poll">Poll</a> is returned.</p> <table class="table"> <thead> @@ -7311,19 +7294,8 @@ pre-formatted fixed-width code block written in the Python programming language </tr> </tbody> </table> -<h4><a class="anchor" href="#deletemessage" id="deletemessage" name="deletemessage"><i class="anchor-icon"></i></a>deleteMessage</h4> -<p>Use this method to delete a message, including service messages, with the following limitations:</p> -<ul> -<li>A message can only be deleted if it was sent less than 48 hours ago.</li> -<li>Service messages about a supergroup, channel, or forum topic creation can't be deleted.</li> -<li>A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.</li> -<li>Bots can delete outgoing messages in private chats, groups, and supergroups.</li> -<li>Bots can delete incoming messages in private chats.</li> -<li>Bots granted <em>can_post_messages</em> permissions can delete outgoing messages in channels.</li> -<li>If the bot is an administrator of a group, it can delete any message there.</li> -<li>If the bot has <em>can_delete_messages</em> permission in a supergroup or a channel, it can delete any message there. -Returns <em>True</em> on success.</li> -</ul> +<h4><a class="anchor" name="deletemessage" href="#deletemessage"><i class="anchor-icon"></i></a>deleteMessage</h4> +<p>Use this method to delete a message, including service messages, with the following limitations:<br>- A message can only be deleted if it was sent less than 48 hours ago.<br>- Service messages about a supergroup, channel, or forum topic creation can't be deleted.<br>- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.<br>- Bots can delete outgoing messages in private chats, groups, and supergroups.<br>- Bots can delete incoming messages in private chats.<br>- Bots granted <em>can_post_messages</em> permissions can delete outgoing messages in channels.<br>- If the bot is an administrator of a group, it can delete any message there.<br>- If the bot has <em>can_delete_messages</em> permission in a supergroup or a channel, it can delete any message there.<br>Returns <em>True</em> on success.</p> <table class="table"> <thead> <tr> @@ -7348,9 +7320,9 @@ Returns <em>True</em> on success.</li> </tr> </tbody> </table> -<h3><a class="anchor" href="#stickers" id="stickers" name="stickers"><i class="anchor-icon"></i></a>Stickers</h3> +<h3><a class="anchor" name="stickers" href="#stickers"><i class="anchor-icon"></i></a>Stickers</h3> <p>The following methods and objects allow your bot to handle stickers and sticker sets.</p> -<h4><a class="anchor" href="#sticker" id="sticker" name="sticker"><i class="anchor-icon"></i></a>Sticker</h4> +<h4><a class="anchor" name="sticker" href="#sticker"><i class="anchor-icon"></i></a>Sticker</h4> <p>This object represents a sticker.</p> <table class="table"> <thead> @@ -7369,12 +7341,12 @@ Returns <em>True</em> on success.</li> <tr> <td>file_unique_id</td> <td>String</td> -<td>Unique 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.</td> +<td>Unique 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.</td> </tr> <tr> <td>type</td> <td>String</td> -<td>Type of the sticker, currently one of "regular", "mask", "custom_emoji". The type of the sticker is independent from its format, which is determined by the fields <em>is_animated</em> and <em>is_video</em>.</td> +<td>Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields <em>is_animated</em> and <em>is_video</em>.</td> </tr> <tr> <td>width</td> @@ -7438,7 +7410,7 @@ Returns <em>True</em> on success.</li> </tr> </tbody> </table> -<h4><a class="anchor" href="#stickerset" id="stickerset" name="stickerset"><i class="anchor-icon"></i></a>StickerSet</h4> +<h4><a class="anchor" name="stickerset" href="#stickerset"><i class="anchor-icon"></i></a>StickerSet</h4> <p>This object represents a sticker set.</p> <table class="table"> <thead> @@ -7462,7 +7434,7 @@ Returns <em>True</em> on success.</li> <tr> <td>sticker_type</td> <td>String</td> -<td>Type of stickers in the set, currently one of "regular", "mask", "custom_emoji"</td> +<td>Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”</td> </tr> <tr> <td>is_animated</td> @@ -7486,7 +7458,7 @@ Returns <em>True</em> on success.</li> </tr> </tbody> </table> -<h4><a class="anchor" href="#maskposition" id="maskposition" name="maskposition"><i class="anchor-icon"></i></a>MaskPosition</h4> +<h4><a class="anchor" name="maskposition" href="#maskposition"><i class="anchor-icon"></i></a>MaskPosition</h4> <p>This object describes the position on faces where a mask should be placed by default.</p> <table class="table"> <thead> @@ -7500,7 +7472,7 @@ Returns <em>True</em> on success.</li> <tr> <td>point</td> <td>String</td> -<td>The part of the face relative to which the mask should be placed. One of "forehead", "eyes", "mouth", or "chin".</td> +<td>The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.</td> </tr> <tr> <td>x_shift</td> @@ -7519,7 +7491,7 @@ Returns <em>True</em> on success.</li> </tr> </tbody> </table> -<h4><a class="anchor" href="#inputsticker" id="inputsticker" name="inputsticker"><i class="anchor-icon"></i></a>InputSticker</h4> +<h4><a class="anchor" name="inputsticker" href="#inputsticker"><i class="anchor-icon"></i></a>InputSticker</h4> <p>This object describes a sticker to be added to a sticker set.</p> <table class="table"> <thead> @@ -7533,7 +7505,7 @@ Returns <em>True</em> on success.</li> <tr> <td>sticker</td> <td><a href="#inputfile">InputFile</a> or String</td> -<td>The added sticker. Pass a <em>file_id</em> as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. <a href="#sending-files">More information on Sending Files »</a></td> +<td>The added sticker. Pass a <em>file_id</em> as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>emoji_list</td> @@ -7543,16 +7515,16 @@ Returns <em>True</em> on success.</li> <tr> <td>mask_position</td> <td><a href="#maskposition">MaskPosition</a></td> -<td><em>Optional</em>. Position where the mask should be placed on faces. For "mask" stickers only.</td> +<td><em>Optional</em>. Position where the mask should be placed on faces. For “mask” stickers only.</td> </tr> <tr> <td>keywords</td> <td>Array of String</td> -<td><em>Optional</em>. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For "regular" and "custom_emoji" stickers only.</td> +<td><em>Optional</em>. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular” and “custom_emoji” stickers only.</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#sendsticker" id="sendsticker" name="sendsticker"><i class="anchor-icon"></i></a>sendSticker</h4> +<h4><a class="anchor" name="sendsticker" href="#sendsticker"><i class="anchor-icon"></i></a>sendSticker</h4> <p>Use this method to send static .WEBP, <a href="https://telegram.org/blog/animated-stickers">animated</a> .TGS, or <a href="https://telegram.org/blog/video-stickers-better-reactions">video</a> .WEBM stickers. On success, the sent <a href="#message">Message</a> is returned.</p> <table class="table"> <thead> @@ -7580,7 +7552,7 @@ Returns <em>True</em> on success.</li> <td>sticker</td> <td><a href="#inputfile">InputFile</a> or String</td> <td>Yes</td> -<td>Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a>. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.</td> +<td>Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a>. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.</td> </tr> <tr> <td>emoji</td> @@ -7620,7 +7592,7 @@ Returns <em>True</em> on success.</li> </tr> </tbody> </table> -<h4><a class="anchor" href="#getstickerset" id="getstickerset" name="getstickerset"><i class="anchor-icon"></i></a>getStickerSet</h4> +<h4><a class="anchor" name="getstickerset" href="#getstickerset"><i class="anchor-icon"></i></a>getStickerSet</h4> <p>Use this method to get a sticker set. On success, a <a href="#stickerset">StickerSet</a> object is returned.</p> <table class="table"> <thead> @@ -7640,7 +7612,7 @@ Returns <em>True</em> on success.</li> </tr> </tbody> </table> -<h4><a class="anchor" href="#getcustomemojistickers" id="getcustomemojistickers" name="getcustomemojistickers"><i class="anchor-icon"></i></a>getCustomEmojiStickers</h4> +<h4><a class="anchor" name="getcustomemojistickers" href="#getcustomemojistickers"><i class="anchor-icon"></i></a>getCustomEmojiStickers</h4> <p>Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of <a href="#sticker">Sticker</a> objects.</p> <table class="table"> <thead> @@ -7660,7 +7632,7 @@ Returns <em>True</em> on success.</li> </tr> </tbody> </table> -<h4><a class="anchor" href="#uploadstickerfile" id="uploadstickerfile" name="uploadstickerfile"><i class="anchor-icon"></i></a>uploadStickerFile</h4> +<h4><a class="anchor" name="uploadstickerfile" href="#uploadstickerfile"><i class="anchor-icon"></i></a>uploadStickerFile</h4> <p>Use this method to upload a file with a sticker for later use in the <a href="#createnewstickerset">createNewStickerSet</a> and <a href="#addstickertoset">addStickerToSet</a> methods (the file can be used multiple times). Returns the uploaded <a href="#file">File</a> on success.</p> <table class="table"> <thead> @@ -7682,17 +7654,17 @@ Returns <em>True</em> on success.</li> <td>sticker</td> <td><a href="#inputfile">InputFile</a></td> <td>Yes</td> -<td>A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See <a href="/stickers">https://core.telegram.org/stickers</a> for technical requirements. <a href="#sending-files">More information on Sending Files »</a></td> +<td>A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See <a href="/stickers"><a href="https://core.telegram.org/stickers">https://core.telegram.org/stickers</a></a> for technical requirements. <a href="#sending-files">More information on Sending Files »</a></td> </tr> <tr> <td>sticker_format</td> <td>String</td> <td>Yes</td> -<td>Format of the sticker, must be one of "static", "animated", "video"</td> +<td>Format of the sticker, must be one of “static”, “animated”, “video”</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#createnewstickerset" id="createnewstickerset" name="createnewstickerset"><i class="anchor-icon"></i></a>createNewStickerSet</h4> +<h4><a class="anchor" name="createnewstickerset" href="#createnewstickerset"><i class="anchor-icon"></i></a>createNewStickerSet</h4> <p>Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -7714,7 +7686,7 @@ Returns <em>True</em> on success.</li> <td>name</td> <td>String</td> <td>Yes</td> -<td>Short name of sticker set, to be used in <code>t.me/addstickers/</code> URLs (e.g., <em>animals</em>). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in <code>"_by_<bot_username>"</code>. <code><bot_username></code> is case insensitive. 1-64 characters.</td> +<td>Short name of sticker set, to be used in <code>t.me/addstickers/</code> URLs (e.g., <em>animals</em>). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in <code>"_by_<bot_username>"</code>. <code><bot_username></code> is case insensitive. 1-64 characters.</td> </tr> <tr> <td>title</td> @@ -7732,13 +7704,13 @@ Returns <em>True</em> on success.</li> <td>sticker_format</td> <td>String</td> <td>Yes</td> -<td>Format of stickers in the set, must be one of "static", "animated", "video"</td> +<td>Format of stickers in the set, must be one of “static”, “animated”, “video”</td> </tr> <tr> <td>sticker_type</td> <td>String</td> <td>Optional</td> -<td>Type of stickers in the set, pass "regular", "mask", or "custom_emoji". By default, a regular sticker set is created.</td> +<td>Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji”. By default, a regular sticker set is created.</td> </tr> <tr> <td>needs_repainting</td> @@ -7748,7 +7720,7 @@ Returns <em>True</em> on success.</li> </tr> </tbody> </table> -<h4><a class="anchor" href="#addstickertoset" id="addstickertoset" name="addstickertoset"><i class="anchor-icon"></i></a>addStickerToSet</h4> +<h4><a class="anchor" name="addstickertoset" href="#addstickertoset"><i class="anchor-icon"></i></a>addStickerToSet</h4> <p>Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -7776,11 +7748,11 @@ Returns <em>True</em> on success.</li> <td>sticker</td> <td><a href="#inputsticker">InputSticker</a></td> <td>Yes</td> -<td>A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set isn't changed.</td> +<td>A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set isn't changed.</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#setstickerpositioninset" id="setstickerpositioninset" name="setstickerpositioninset"><i class="anchor-icon"></i></a>setStickerPositionInSet</h4> +<h4><a class="anchor" name="setstickerpositioninset" href="#setstickerpositioninset"><i class="anchor-icon"></i></a>setStickerPositionInSet</h4> <p>Use this method to move a sticker in a set created by the bot to a specific position. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -7806,7 +7778,7 @@ Returns <em>True</em> on success.</li> </tr> </tbody> </table> -<h4><a class="anchor" href="#deletestickerfromset" id="deletestickerfromset" name="deletestickerfromset"><i class="anchor-icon"></i></a>deleteStickerFromSet</h4> +<h4><a class="anchor" name="deletestickerfromset" href="#deletestickerfromset"><i class="anchor-icon"></i></a>deleteStickerFromSet</h4> <p>Use this method to delete a sticker from a set created by the bot. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -7826,7 +7798,7 @@ Returns <em>True</em> on success.</li> </tr> </tbody> </table> -<h4><a class="anchor" href="#setstickeremojilist" id="setstickeremojilist" name="setstickeremojilist"><i class="anchor-icon"></i></a>setStickerEmojiList</h4> +<h4><a class="anchor" name="setstickeremojilist" href="#setstickeremojilist"><i class="anchor-icon"></i></a>setStickerEmojiList</h4> <p>Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -7852,7 +7824,7 @@ Returns <em>True</em> on success.</li> </tr> </tbody> </table> -<h4><a class="anchor" href="#setstickerkeywords" id="setstickerkeywords" name="setstickerkeywords"><i class="anchor-icon"></i></a>setStickerKeywords</h4> +<h4><a class="anchor" name="setstickerkeywords" href="#setstickerkeywords"><i class="anchor-icon"></i></a>setStickerKeywords</h4> <p>Use this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -7878,7 +7850,7 @@ Returns <em>True</em> on success.</li> </tr> </tbody> </table> -<h4><a class="anchor" href="#setstickermaskposition" id="setstickermaskposition" name="setstickermaskposition"><i class="anchor-icon"></i></a>setStickerMaskPosition</h4> +<h4><a class="anchor" name="setstickermaskposition" href="#setstickermaskposition"><i class="anchor-icon"></i></a>setStickerMaskPosition</h4> <p>Use this method to change the <a href="#maskposition">mask position</a> of a mask sticker. The sticker must belong to a sticker set that was created by the bot. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -7904,7 +7876,7 @@ Returns <em>True</em> on success.</li> </tr> </tbody> </table> -<h4><a class="anchor" href="#setstickersettitle" id="setstickersettitle" name="setstickersettitle"><i class="anchor-icon"></i></a>setStickerSetTitle</h4> +<h4><a class="anchor" name="setstickersettitle" href="#setstickersettitle"><i class="anchor-icon"></i></a>setStickerSetTitle</h4> <p>Use this method to set the title of a created sticker set. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -7930,7 +7902,7 @@ Returns <em>True</em> on success.</li> </tr> </tbody> </table> -<h4><a class="anchor" href="#setstickersetthumbnail" id="setstickersetthumbnail" name="setstickersetthumbnail"><i class="anchor-icon"></i></a>setStickerSetThumbnail</h4> +<h4><a class="anchor" name="setstickersetthumbnail" href="#setstickersetthumbnail"><i class="anchor-icon"></i></a>setStickerSetThumbnail</h4> <p>Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -7958,11 +7930,11 @@ Returns <em>True</em> on success.</li> <td>thumbnail</td> <td><a href="#inputfile">InputFile</a> or String</td> <td>Optional</td> -<td>A <strong>.WEBP</strong> or <strong>.PNG</strong> image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a <strong>.TGS</strong> animation with a thumbnail up to 32 kilobytes in size (see <a href="/stickers#animated-sticker-requirements">https://core.telegram.org/stickers#animated-sticker-requirements</a> for animated sticker technical requirements), or a <strong>WEBM</strong> video with the thumbnail up to 32 kilobytes in size; see <a href="/stickers#video-sticker-requirements">https://core.telegram.org/stickers#video-sticker-requirements</a> for video sticker technical requirements. Pass a <em>file_id</em> as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a>. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.</td> +<td>A <strong>.WEBP</strong> or <strong>.PNG</strong> image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a <strong>.TGS</strong> animation with a thumbnail up to 32 kilobytes in size (see <a href="/stickers#animated-sticker-requirements"><a href="https://core.telegram.org/stickers#animated-sticker-requirements">https://core.telegram.org/stickers#animated-sticker-requirements</a></a> for animated sticker technical requirements), or a <strong>WEBM</strong> video with the thumbnail up to 32 kilobytes in size; see <a href="/stickers#video-sticker-requirements"><a href="https://core.telegram.org/stickers#video-sticker-requirements">https://core.telegram.org/stickers#video-sticker-requirements</a></a> for video sticker technical requirements. Pass a <em>file_id</em> as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a>. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#setcustomemojistickersetthumbnail" id="setcustomemojistickersetthumbnail" name="setcustomemojistickersetthumbnail"><i class="anchor-icon"></i></a>setCustomEmojiStickerSetThumbnail</h4> +<h4><a class="anchor" name="setcustomemojistickersetthumbnail" href="#setcustomemojistickersetthumbnail"><i class="anchor-icon"></i></a>setCustomEmojiStickerSetThumbnail</h4> <p>Use this method to set the thumbnail of a custom emoji sticker set. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -7988,7 +7960,7 @@ Returns <em>True</em> on success.</li> </tr> </tbody> </table> -<h4><a class="anchor" href="#deletestickerset" id="deletestickerset" name="deletestickerset"><i class="anchor-icon"></i></a>deleteStickerSet</h4> +<h4><a class="anchor" name="deletestickerset" href="#deletestickerset"><i class="anchor-icon"></i></a>deleteStickerSet</h4> <p>Use this method to delete a sticker set that was created by the bot. Returns <em>True</em> on success.</p> <table class="table"> <thead> @@ -8008,11 +7980,10 @@ Returns <em>True</em> on success.</li> </tr> </tbody> </table> -<h3><a class="anchor" href="#inline-mode" id="inline-mode" name="inline-mode"><i class="anchor-icon"></i></a>Inline mode</h3> -<p>The following methods and objects allow your bot to work in <a href="/bots/inline">inline mode</a>. -Please see our <a href="/bots/inline">Introduction to Inline bots</a> for more details.</p> -<p>To enable this option, send the <code>/setinline</code> command to <a href="https://t.me/botfather">@BotFather</a> and provide the placeholder text that the user will see in the input field after typing your bot's name.</p> -<h4><a class="anchor" href="#inlinequery" id="inlinequery" name="inlinequery"><i class="anchor-icon"></i></a>InlineQuery</h4> +<h3><a class="anchor" name="inline-mode" href="#inline-mode"><i class="anchor-icon"></i></a>Inline mode</h3> +<p>The following methods and objects allow your bot to work in <a href="/bots/inline">inline mode</a>.<br>Please see our <a href="/bots/inline">Introduction to Inline bots</a> for more details.</p> +<p>To enable this option, send the <code>/setinline</code> command to <a href="https://t.me/botfather">@BotFather</a> and provide the placeholder text that the user will see in the input field after typing your bot's name.</p> +<h4><a class="anchor" name="inlinequery" href="#inlinequery"><i class="anchor-icon"></i></a>InlineQuery</h4> <p>This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.</p> <table class="table"> <thead> @@ -8046,7 +8017,7 @@ Please see our <a href="/bots/inline">Introduction to Inline bots</a> for more d <tr> <td>chat_type</td> <td>String</td> -<td><em>Optional</em>. Type of the chat from which the inline query was sent. Can be either "sender" for a private chat with the inline query sender, "private", "group", "supergroup", or "channel". The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat</td> +<td><em>Optional</em>. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat</td> </tr> <tr> <td>location</td> @@ -8055,9 +8026,8 @@ Please see our <a href="/bots/inline">Introduction to Inline bots</a> for more d </tr> </tbody> </table> -<h4><a class="anchor" href="#answerinlinequery" id="answerinlinequery" name="answerinlinequery"><i class="anchor-icon"></i></a>answerInlineQuery</h4> -<p>Use this method to send answers to an inline query. On success, <em>True</em> is returned. -No more than <strong>50</strong> results per query are allowed.</p> +<h4><a class="anchor" name="answerinlinequery" href="#answerinlinequery"><i class="anchor-icon"></i></a>answerInlineQuery</h4> +<p>Use this method to send answers to an inline query. On success, <em>True</em> is returned.<br>No more than <strong>50</strong> results per query are allowed.</p> <table class="table"> <thead> <tr> @@ -8096,7 +8066,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <td>next_offset</td> <td>String</td> <td>Optional</td> -<td>Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.</td> +<td>Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.</td> </tr> <tr> <td>button</td> @@ -8106,7 +8076,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#inlinequeryresultsbutton" id="inlinequeryresultsbutton" name="inlinequeryresultsbutton"><i class="anchor-icon"></i></a>InlineQueryResultsButton</h4> +<h4><a class="anchor" name="inlinequeryresultsbutton" href="#inlinequeryresultsbutton"><i class="anchor-icon"></i></a>InlineQueryResultsButton</h4> <p>This object represents a button to be shown above inline query results. You <strong>must</strong> use exactly one of the optional fields.</p> <table class="table"> <thead> @@ -8130,11 +8100,11 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>start_parameter</td> <td>String</td> -<td><em>Optional</em>. <a href="/bots/features#deep-linking">Deep-linking</a> parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only <code>A-Z</code>, <code>a-z</code>, <code>0-9</code>, <code>_</code> and <code>-</code> are allowed.<br><br><em>Example:</em> An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a <a href="#inlinekeyboardmarkup"><em>switch_inline</em></a> button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.</td> +<td><em>Optional</em>. <a href="/bots/features#deep-linking">Deep-linking</a> parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only <code>A-Z</code>, <code>a-z</code>, <code>0-9</code>, <code>_</code> and <code>-</code> are allowed.<br><br><em>Example:</em> An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a <a href="#inlinekeyboardmarkup"><em>switch_inline</em></a> button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#inlinequeryresult" id="inlinequeryresult" name="inlinequeryresult"><i class="anchor-icon"></i></a>InlineQueryResult</h4> +<h4><a class="anchor" name="inlinequeryresult" href="#inlinequeryresult"><i class="anchor-icon"></i></a>InlineQueryResult</h4> <p>This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:</p> <ul> <li><a href="#inlinequeryresultcachedaudio">InlineQueryResultCachedAudio</a></li> @@ -8159,7 +8129,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <li><a href="#inlinequeryresultvoice">InlineQueryResultVoice</a></li> </ul> <p><strong>Note:</strong> All URLs passed in inline query results will be available to end users and therefore must be assumed to be <strong>public</strong>.</p> -<h4><a class="anchor" href="#inlinequeryresultarticle" id="inlinequeryresultarticle" name="inlinequeryresultarticle"><i class="anchor-icon"></i></a>InlineQueryResultArticle</h4> +<h4><a class="anchor" name="inlinequeryresultarticle" href="#inlinequeryresultarticle"><i class="anchor-icon"></i></a>InlineQueryResultArticle</h4> <p>Represents a link to an article or web page.</p> <table class="table"> <thead> @@ -8203,7 +8173,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>hide_url</td> <td>Boolean</td> -<td><em>Optional</em>. Pass <em>True</em> if you don't want the URL to be shown in the message</td> +<td><em>Optional</em>. Pass <em>True</em> if you don't want the URL to be shown in the message</td> </tr> <tr> <td>description</td> @@ -8227,7 +8197,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#inlinequeryresultphoto" id="inlinequeryresultphoto" name="inlinequeryresultphoto"><i class="anchor-icon"></i></a>InlineQueryResultPhoto</h4> +<h4><a class="anchor" name="inlinequeryresultphoto" href="#inlinequeryresultphoto"><i class="anchor-icon"></i></a>InlineQueryResultPhoto</h4> <p>Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the photo.</p> <table class="table"> <thead> @@ -8305,7 +8275,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#inlinequeryresultgif" id="inlinequeryresultgif" name="inlinequeryresultgif"><i class="anchor-icon"></i></a>InlineQueryResultGif</h4> +<h4><a class="anchor" name="inlinequeryresultgif" href="#inlinequeryresultgif"><i class="anchor-icon"></i></a>InlineQueryResultGif</h4> <p>Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the animation.</p> <table class="table"> <thead> @@ -8354,7 +8324,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>thumbnail_mime_type</td> <td>String</td> -<td><em>Optional</em>. MIME type of the thumbnail, must be one of "image/jpeg", "image/gif", or "video/mp4". Defaults to "image/jpeg"</td> +<td><em>Optional</em>. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”</td> </tr> <tr> <td>title</td> @@ -8388,7 +8358,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#inlinequeryresultmpeg4gif" id="inlinequeryresultmpeg4gif" name="inlinequeryresultmpeg4gif"><i class="anchor-icon"></i></a>InlineQueryResultMpeg4Gif</h4> +<h4><a class="anchor" name="inlinequeryresultmpeg4gif" href="#inlinequeryresultmpeg4gif"><i class="anchor-icon"></i></a>InlineQueryResultMpeg4Gif</h4> <p>Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the animation.</p> <table class="table"> <thead> @@ -8437,7 +8407,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>thumbnail_mime_type</td> <td>String</td> -<td><em>Optional</em>. MIME type of the thumbnail, must be one of "image/jpeg", "image/gif", or "video/mp4". Defaults to "image/jpeg"</td> +<td><em>Optional</em>. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”</td> </tr> <tr> <td>title</td> @@ -8471,7 +8441,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#inlinequeryresultvideo" id="inlinequeryresultvideo" name="inlinequeryresultvideo"><i class="anchor-icon"></i></a>InlineQueryResultVideo</h4> +<h4><a class="anchor" name="inlinequeryresultvideo" href="#inlinequeryresultvideo"><i class="anchor-icon"></i></a>InlineQueryResultVideo</h4> <p>Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the video.</p> <blockquote> <p>If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you <strong>must</strong> replace its content using <em>input_message_content</em>.</p> @@ -8503,7 +8473,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>mime_type</td> <td>String</td> -<td>MIME type of the content of the video URL, "text/html" or "video/mp4"</td> +<td>MIME type of the content of the video URL, “text/html” or “video/mp4”</td> </tr> <tr> <td>thumbnail_url</td> @@ -8562,7 +8532,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#inlinequeryresultaudio" id="inlinequeryresultaudio" name="inlinequeryresultaudio"><i class="anchor-icon"></i></a>InlineQueryResultAudio</h4> +<h4><a class="anchor" name="inlinequeryresultaudio" href="#inlinequeryresultaudio"><i class="anchor-icon"></i></a>InlineQueryResultAudio</h4> <p>Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the audio.</p> <table class="table"> <thead> @@ -8631,7 +8601,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tbody> </table> <p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p> -<h4><a class="anchor" href="#inlinequeryresultvoice" id="inlinequeryresultvoice" name="inlinequeryresultvoice"><i class="anchor-icon"></i></a>InlineQueryResultVoice</h4> +<h4><a class="anchor" name="inlinequeryresultvoice" href="#inlinequeryresultvoice"><i class="anchor-icon"></i></a>InlineQueryResultVoice</h4> <p>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 <em>input_message_content</em> to send a message with the specified content instead of the the voice message.</p> <table class="table"> <thead> @@ -8695,7 +8665,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tbody> </table> <p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p> -<h4><a class="anchor" href="#inlinequeryresultdocument" id="inlinequeryresultdocument" name="inlinequeryresultdocument"><i class="anchor-icon"></i></a>InlineQueryResultDocument</h4> +<h4><a class="anchor" name="inlinequeryresultdocument" href="#inlinequeryresultdocument"><i class="anchor-icon"></i></a>InlineQueryResultDocument</h4> <p>Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the file. Currently, only <strong>.PDF</strong> and <strong>.ZIP</strong> files can be sent using this method.</p> <table class="table"> <thead> @@ -8744,7 +8714,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>mime_type</td> <td>String</td> -<td>MIME type of the content of the file, either "application/pdf" or "application/zip"</td> +<td>MIME type of the content of the file, either “application/pdf” or “application/zip”</td> </tr> <tr> <td>description</td> @@ -8779,7 +8749,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tbody> </table> <p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p> -<h4><a class="anchor" href="#inlinequeryresultlocation" id="inlinequeryresultlocation" name="inlinequeryresultlocation"><i class="anchor-icon"></i></a>InlineQueryResultLocation</h4> +<h4><a class="anchor" name="inlinequeryresultlocation" href="#inlinequeryresultlocation"><i class="anchor-icon"></i></a>InlineQueryResultLocation</h4> <p>Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the location.</p> <table class="table"> <thead> @@ -8863,7 +8833,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tbody> </table> <p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p> -<h4><a class="anchor" href="#inlinequeryresultvenue" id="inlinequeryresultvenue" name="inlinequeryresultvenue"><i class="anchor-icon"></i></a>InlineQueryResultVenue</h4> +<h4><a class="anchor" name="inlinequeryresultvenue" href="#inlinequeryresultvenue"><i class="anchor-icon"></i></a>InlineQueryResultVenue</h4> <p>Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the venue.</p> <table class="table"> <thead> @@ -8912,7 +8882,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>foursquare_type</td> <td>String</td> -<td><em>Optional</em>. Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".)</td> +<td><em>Optional</em>. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)</td> </tr> <tr> <td>google_place_id</td> @@ -8952,7 +8922,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tbody> </table> <p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p> -<h4><a class="anchor" href="#inlinequeryresultcontact" id="inlinequeryresultcontact" name="inlinequeryresultcontact"><i class="anchor-icon"></i></a>InlineQueryResultContact</h4> +<h4><a class="anchor" name="inlinequeryresultcontact" href="#inlinequeryresultcontact"><i class="anchor-icon"></i></a>InlineQueryResultContact</h4> <p>Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the contact.</p> <table class="table"> <thead> @@ -8976,17 +8946,17 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>phone_number</td> <td>String</td> -<td>Contact's phone number</td> +<td>Contact's phone number</td> </tr> <tr> <td>first_name</td> <td>String</td> -<td>Contact's first name</td> +<td>Contact's first name</td> </tr> <tr> <td>last_name</td> <td>String</td> -<td><em>Optional</em>. Contact's last name</td> +<td><em>Optional</em>. Contact's last name</td> </tr> <tr> <td>vcard</td> @@ -9021,7 +8991,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tbody> </table> <p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p> -<h4><a class="anchor" href="#inlinequeryresultgame" id="inlinequeryresultgame" name="inlinequeryresultgame"><i class="anchor-icon"></i></a>InlineQueryResultGame</h4> +<h4><a class="anchor" name="inlinequeryresultgame" href="#inlinequeryresultgame"><i class="anchor-icon"></i></a>InlineQueryResultGame</h4> <p>Represents a <a href="#games">Game</a>.</p> <table class="table"> <thead> @@ -9055,7 +9025,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tbody> </table> <p><strong>Note:</strong> 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.</p> -<h4><a class="anchor" href="#inlinequeryresultcachedphoto" id="inlinequeryresultcachedphoto" name="inlinequeryresultcachedphoto"><i class="anchor-icon"></i></a>InlineQueryResultCachedPhoto</h4> +<h4><a class="anchor" name="inlinequeryresultcachedphoto" href="#inlinequeryresultcachedphoto"><i class="anchor-icon"></i></a>InlineQueryResultCachedPhoto</h4> <p>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 <em>input_message_content</em> to send a message with the specified content instead of the photo.</p> <table class="table"> <thead> @@ -9118,7 +9088,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#inlinequeryresultcachedgif" id="inlinequeryresultcachedgif" name="inlinequeryresultcachedgif"><i class="anchor-icon"></i></a>InlineQueryResultCachedGif</h4> +<h4><a class="anchor" name="inlinequeryresultcachedgif" href="#inlinequeryresultcachedgif"><i class="anchor-icon"></i></a>InlineQueryResultCachedGif</h4> <p>Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with specified content instead of the animation.</p> <table class="table"> <thead> @@ -9176,7 +9146,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#inlinequeryresultcachedmpeg4gif" id="inlinequeryresultcachedmpeg4gif" name="inlinequeryresultcachedmpeg4gif"><i class="anchor-icon"></i></a>InlineQueryResultCachedMpeg4Gif</h4> +<h4><a class="anchor" name="inlinequeryresultcachedmpeg4gif" href="#inlinequeryresultcachedmpeg4gif"><i class="anchor-icon"></i></a>InlineQueryResultCachedMpeg4Gif</h4> <p>Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the animation.</p> <table class="table"> <thead> @@ -9234,7 +9204,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#inlinequeryresultcachedsticker" id="inlinequeryresultcachedsticker" name="inlinequeryresultcachedsticker"><i class="anchor-icon"></i></a>InlineQueryResultCachedSticker</h4> +<h4><a class="anchor" name="inlinequeryresultcachedsticker" href="#inlinequeryresultcachedsticker"><i class="anchor-icon"></i></a>InlineQueryResultCachedSticker</h4> <p>Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the sticker.</p> <table class="table"> <thead> @@ -9273,7 +9243,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tbody> </table> <p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016 for static stickers and after 06 July, 2019 for <a href="https://telegram.org/blog/animated-stickers">animated stickers</a>. Older clients will ignore them.</p> -<h4><a class="anchor" href="#inlinequeryresultcacheddocument" id="inlinequeryresultcacheddocument" name="inlinequeryresultcacheddocument"><i class="anchor-icon"></i></a>InlineQueryResultCachedDocument</h4> +<h4><a class="anchor" name="inlinequeryresultcacheddocument" href="#inlinequeryresultcacheddocument"><i class="anchor-icon"></i></a>InlineQueryResultCachedDocument</h4> <p>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 <em>input_message_content</em> to send a message with the specified content instead of the file.</p> <table class="table"> <thead> @@ -9337,7 +9307,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tbody> </table> <p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p> -<h4><a class="anchor" href="#inlinequeryresultcachedvideo" id="inlinequeryresultcachedvideo" name="inlinequeryresultcachedvideo"><i class="anchor-icon"></i></a>InlineQueryResultCachedVideo</h4> +<h4><a class="anchor" name="inlinequeryresultcachedvideo" href="#inlinequeryresultcachedvideo"><i class="anchor-icon"></i></a>InlineQueryResultCachedVideo</h4> <p>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 <em>input_message_content</em> to send a message with the specified content instead of the video.</p> <table class="table"> <thead> @@ -9400,7 +9370,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#inlinequeryresultcachedvoice" id="inlinequeryresultcachedvoice" name="inlinequeryresultcachedvoice"><i class="anchor-icon"></i></a>InlineQueryResultCachedVoice</h4> +<h4><a class="anchor" name="inlinequeryresultcachedvoice" href="#inlinequeryresultcachedvoice"><i class="anchor-icon"></i></a>InlineQueryResultCachedVoice</h4> <p>Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the voice message.</p> <table class="table"> <thead> @@ -9459,7 +9429,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tbody> </table> <p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p> -<h4><a class="anchor" href="#inlinequeryresultcachedaudio" id="inlinequeryresultcachedaudio" name="inlinequeryresultcachedaudio"><i class="anchor-icon"></i></a>InlineQueryResultCachedAudio</h4> +<h4><a class="anchor" name="inlinequeryresultcachedaudio" href="#inlinequeryresultcachedaudio"><i class="anchor-icon"></i></a>InlineQueryResultCachedAudio</h4> <p>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 <em>input_message_content</em> to send a message with the specified content instead of the audio.</p> <table class="table"> <thead> @@ -9513,7 +9483,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tbody> </table> <p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p> -<h4><a class="anchor" href="#inputmessagecontent" id="inputmessagecontent" name="inputmessagecontent"><i class="anchor-icon"></i></a>InputMessageContent</h4> +<h4><a class="anchor" name="inputmessagecontent" href="#inputmessagecontent"><i class="anchor-icon"></i></a>InputMessageContent</h4> <p>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:</p> <ul> <li><a href="#inputtextmessagecontent">InputTextMessageContent</a></li> @@ -9522,7 +9492,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <li><a href="#inputcontactmessagecontent">InputContactMessageContent</a></li> <li><a href="#inputinvoicemessagecontent">InputInvoiceMessageContent</a></li> </ul> -<h4><a class="anchor" href="#inputtextmessagecontent" id="inputtextmessagecontent" name="inputtextmessagecontent"><i class="anchor-icon"></i></a>InputTextMessageContent</h4> +<h4><a class="anchor" name="inputtextmessagecontent" href="#inputtextmessagecontent"><i class="anchor-icon"></i></a>InputTextMessageContent</h4> <p>Represents the <a href="#inputmessagecontent">content</a> of a text message to be sent as the result of an inline query.</p> <table class="table"> <thead> @@ -9555,7 +9525,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#inputlocationmessagecontent" id="inputlocationmessagecontent" name="inputlocationmessagecontent"><i class="anchor-icon"></i></a>InputLocationMessageContent</h4> +<h4><a class="anchor" name="inputlocationmessagecontent" href="#inputlocationmessagecontent"><i class="anchor-icon"></i></a>InputLocationMessageContent</h4> <p>Represents the <a href="#inputmessagecontent">content</a> of a location message to be sent as the result of an inline query.</p> <table class="table"> <thead> @@ -9598,7 +9568,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#inputvenuemessagecontent" id="inputvenuemessagecontent" name="inputvenuemessagecontent"><i class="anchor-icon"></i></a>InputVenueMessageContent</h4> +<h4><a class="anchor" name="inputvenuemessagecontent" href="#inputvenuemessagecontent"><i class="anchor-icon"></i></a>InputVenueMessageContent</h4> <p>Represents the <a href="#inputmessagecontent">content</a> of a venue message to be sent as the result of an inline query.</p> <table class="table"> <thead> @@ -9637,7 +9607,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>foursquare_type</td> <td>String</td> -<td><em>Optional</em>. Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".)</td> +<td><em>Optional</em>. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)</td> </tr> <tr> <td>google_place_id</td> @@ -9651,7 +9621,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#inputcontactmessagecontent" id="inputcontactmessagecontent" name="inputcontactmessagecontent"><i class="anchor-icon"></i></a>InputContactMessageContent</h4> +<h4><a class="anchor" name="inputcontactmessagecontent" href="#inputcontactmessagecontent"><i class="anchor-icon"></i></a>InputContactMessageContent</h4> <p>Represents the <a href="#inputmessagecontent">content</a> of a contact message to be sent as the result of an inline query.</p> <table class="table"> <thead> @@ -9665,17 +9635,17 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>phone_number</td> <td>String</td> -<td>Contact's phone number</td> +<td>Contact's phone number</td> </tr> <tr> <td>first_name</td> <td>String</td> -<td>Contact's first name</td> +<td>Contact's first name</td> </tr> <tr> <td>last_name</td> <td>String</td> -<td><em>Optional</em>. Contact's last name</td> +<td><em>Optional</em>. Contact's last name</td> </tr> <tr> <td>vcard</td> @@ -9684,7 +9654,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#inputinvoicemessagecontent" id="inputinvoicemessagecontent" name="inputinvoicemessagecontent"><i class="anchor-icon"></i></a>InputInvoiceMessageContent</h4> +<h4><a class="anchor" name="inputinvoicemessagecontent" href="#inputinvoicemessagecontent"><i class="anchor-icon"></i></a>InputInvoiceMessageContent</h4> <p>Represents the <a href="#inputmessagecontent">content</a> of an invoice message to be sent as the result of an inline query.</p> <table class="table"> <thead> @@ -9763,32 +9733,32 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>need_name</td> <td>Boolean</td> -<td><em>Optional</em>. Pass <em>True</em> if you require the user's full name to complete the order</td> +<td><em>Optional</em>. Pass <em>True</em> if you require the user's full name to complete the order</td> </tr> <tr> <td>need_phone_number</td> <td>Boolean</td> -<td><em>Optional</em>. Pass <em>True</em> if you require the user's phone number to complete the order</td> +<td><em>Optional</em>. Pass <em>True</em> if you require the user's phone number to complete the order</td> </tr> <tr> <td>need_email</td> <td>Boolean</td> -<td><em>Optional</em>. Pass <em>True</em> if you require the user's email address to complete the order</td> +<td><em>Optional</em>. Pass <em>True</em> if you require the user's email address to complete the order</td> </tr> <tr> <td>need_shipping_address</td> <td>Boolean</td> -<td><em>Optional</em>. Pass <em>True</em> if you require the user's shipping address to complete the order</td> +<td><em>Optional</em>. Pass <em>True</em> if you require the user's shipping address to complete the order</td> </tr> <tr> <td>send_phone_number_to_provider</td> <td>Boolean</td> -<td><em>Optional</em>. Pass <em>True</em> if the user's phone number should be sent to provider</td> +<td><em>Optional</em>. Pass <em>True</em> if the user's phone number should be sent to provider</td> </tr> <tr> <td>send_email_to_provider</td> <td>Boolean</td> -<td><em>Optional</em>. Pass <em>True</em> if the user's email address should be sent to provider</td> +<td><em>Optional</em>. Pass <em>True</em> if the user's email address should be sent to provider</td> </tr> <tr> <td>is_flexible</td> @@ -9797,7 +9767,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#choseninlineresult" id="choseninlineresult" name="choseninlineresult"><i class="anchor-icon"></i></a>ChosenInlineResult</h4> +<h4><a class="anchor" name="choseninlineresult" href="#choseninlineresult"><i class="anchor-icon"></i></a>ChosenInlineResult</h4> <p>Represents a <a href="#inlinequeryresult">result</a> of an inline query that was chosen by the user and sent to their chat partner.</p> <table class="table"> <thead> @@ -9836,7 +9806,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tbody> </table> <p><strong>Note:</strong> It is necessary to enable <a href="/bots/inline#collecting-feedback">inline feedback</a> via <a href="https://t.me/botfather">@BotFather</a> in order to receive these objects in updates.</p> -<h4><a class="anchor" href="#answerwebappquery" id="answerwebappquery" name="answerwebappquery"><i class="anchor-icon"></i></a>answerWebAppQuery</h4> +<h4><a class="anchor" name="answerwebappquery" href="#answerwebappquery"><i class="anchor-icon"></i></a>answerWebAppQuery</h4> <p>Use this method to set the result of an interaction with a <a href="/bots/webapps">Web App</a> and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a <a href="#sentwebappmessage">SentWebAppMessage</a> object is returned.</p> <table class="table"> <thead> @@ -9862,7 +9832,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#sentwebappmessage" id="sentwebappmessage" name="sentwebappmessage"><i class="anchor-icon"></i></a>SentWebAppMessage</h4> +<h4><a class="anchor" name="sentwebappmessage" href="#sentwebappmessage"><i class="anchor-icon"></i></a>SentWebAppMessage</h4> <p>Describes an inline message sent by a <a href="/bots/webapps">Web App</a> on behalf of a user.</p> <table class="table"> <thead> @@ -9880,9 +9850,9 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h3><a class="anchor" href="#payments" id="payments" name="payments"><i class="anchor-icon"></i></a>Payments</h3> +<h3><a class="anchor" name="payments" href="#payments"><i class="anchor-icon"></i></a>Payments</h3> <p>Your bot can accept payments from Telegram users. Please see the <a href="/bots/payments">introduction to payments</a> 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).</p> -<h4><a class="anchor" href="#sendinvoice" id="sendinvoice" name="sendinvoice"><i class="anchor-icon"></i></a>sendInvoice</h4> +<h4><a class="anchor" name="sendinvoice" href="#sendinvoice"><i class="anchor-icon"></i></a>sendInvoice</h4> <p>Use this method to send invoices. On success, the sent <a href="#message">Message</a> is returned.</p> <table class="table"> <thead> @@ -9994,37 +9964,37 @@ No more than <strong>50</strong> results per query are allowed.</p> <td>need_name</td> <td>Boolean</td> <td>Optional</td> -<td>Pass <em>True</em> if you require the user's full name to complete the order</td> +<td>Pass <em>True</em> if you require the user's full name to complete the order</td> </tr> <tr> <td>need_phone_number</td> <td>Boolean</td> <td>Optional</td> -<td>Pass <em>True</em> if you require the user's phone number to complete the order</td> +<td>Pass <em>True</em> if you require the user's phone number to complete the order</td> </tr> <tr> <td>need_email</td> <td>Boolean</td> <td>Optional</td> -<td>Pass <em>True</em> if you require the user's email address to complete the order</td> +<td>Pass <em>True</em> if you require the user's email address to complete the order</td> </tr> <tr> <td>need_shipping_address</td> <td>Boolean</td> <td>Optional</td> -<td>Pass <em>True</em> if you require the user's shipping address to complete the order</td> +<td>Pass <em>True</em> if you require the user's shipping address to complete the order</td> </tr> <tr> <td>send_phone_number_to_provider</td> <td>Boolean</td> <td>Optional</td> -<td>Pass <em>True</em> if the user's phone number should be sent to provider</td> +<td>Pass <em>True</em> if the user's phone number should be sent to provider</td> </tr> <tr> <td>send_email_to_provider</td> <td>Boolean</td> <td>Optional</td> -<td>Pass <em>True</em> if the user's email address should be sent to provider</td> +<td>Pass <em>True</em> if the user's email address should be sent to provider</td> </tr> <tr> <td>is_flexible</td> @@ -10060,11 +10030,11 @@ No more than <strong>50</strong> results per query are allowed.</p> <td>reply_markup</td> <td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td> <td>Optional</td> -<td>A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>. If empty, one 'Pay <code>total price</code>' button will be shown. If not empty, the first button must be a Pay button.</td> +<td>A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>. If empty, one 'Pay <code>total price</code>' button will be shown. If not empty, the first button must be a Pay button.</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#createinvoicelink" id="createinvoicelink" name="createinvoicelink"><i class="anchor-icon"></i></a>createInvoiceLink</h4> +<h4><a class="anchor" name="createinvoicelink" href="#createinvoicelink"><i class="anchor-icon"></i></a>createInvoiceLink</h4> <p>Use this method to create a link for an invoice. Returns the created invoice link as <em>String</em> on success.</p> <table class="table"> <thead> @@ -10158,37 +10128,37 @@ No more than <strong>50</strong> results per query are allowed.</p> <td>need_name</td> <td>Boolean</td> <td>Optional</td> -<td>Pass <em>True</em> if you require the user's full name to complete the order</td> +<td>Pass <em>True</em> if you require the user's full name to complete the order</td> </tr> <tr> <td>need_phone_number</td> <td>Boolean</td> <td>Optional</td> -<td>Pass <em>True</em> if you require the user's phone number to complete the order</td> +<td>Pass <em>True</em> if you require the user's phone number to complete the order</td> </tr> <tr> <td>need_email</td> <td>Boolean</td> <td>Optional</td> -<td>Pass <em>True</em> if you require the user's email address to complete the order</td> +<td>Pass <em>True</em> if you require the user's email address to complete the order</td> </tr> <tr> <td>need_shipping_address</td> <td>Boolean</td> <td>Optional</td> -<td>Pass <em>True</em> if you require the user's shipping address to complete the order</td> +<td>Pass <em>True</em> if you require the user's shipping address to complete the order</td> </tr> <tr> <td>send_phone_number_to_provider</td> <td>Boolean</td> <td>Optional</td> -<td>Pass <em>True</em> if the user's phone number should be sent to the provider</td> +<td>Pass <em>True</em> if the user's phone number should be sent to the provider</td> </tr> <tr> <td>send_email_to_provider</td> <td>Boolean</td> <td>Optional</td> -<td>Pass <em>True</em> if the user's email address should be sent to the provider</td> +<td>Pass <em>True</em> if the user's email address should be sent to the provider</td> </tr> <tr> <td>is_flexible</td> @@ -10198,7 +10168,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#answershippingquery" id="answershippingquery" name="answershippingquery"><i class="anchor-icon"></i></a>answerShippingQuery</h4> +<h4><a class="anchor" name="answershippingquery" href="#answershippingquery"><i class="anchor-icon"></i></a>answerShippingQuery</h4> <p>If you sent an invoice requesting a shipping address and the parameter <em>is_flexible</em> was specified, the Bot API will send an <a href="#update">Update</a> with a <em>shipping_query</em> field to the bot. Use this method to reply to shipping queries. On success, <em>True</em> is returned.</p> <table class="table"> <thead> @@ -10232,11 +10202,11 @@ No more than <strong>50</strong> results per query are allowed.</p> <td>error_message</td> <td>String</td> <td>Optional</td> -<td>Required if <em>ok</em> is <em>False</em>. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.</td> +<td>Required if <em>ok</em> is <em>False</em>. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#answerprecheckoutquery" id="answerprecheckoutquery" name="answerprecheckoutquery"><i class="anchor-icon"></i></a>answerPreCheckoutQuery</h4> +<h4><a class="anchor" name="answerprecheckoutquery" href="#answerprecheckoutquery"><i class="anchor-icon"></i></a>answerPreCheckoutQuery</h4> <p>Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an <a href="#update">Update</a> with the field <em>pre_checkout_query</em>. Use this method to respond to such pre-checkout queries. On success, <em>True</em> is returned. <strong>Note:</strong> The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.</p> <table class="table"> <thead> @@ -10264,11 +10234,11 @@ No more than <strong>50</strong> results per query are allowed.</p> <td>error_message</td> <td>String</td> <td>Optional</td> -<td>Required if <em>ok</em> is <em>False</em>. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.</td> +<td>Required if <em>ok</em> is <em>False</em>. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#labeledprice" id="labeledprice" name="labeledprice"><i class="anchor-icon"></i></a>LabeledPrice</h4> +<h4><a class="anchor" name="labeledprice" href="#labeledprice"><i class="anchor-icon"></i></a>LabeledPrice</h4> <p>This object represents a portion of the price for goods or services.</p> <table class="table"> <thead> @@ -10291,7 +10261,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#invoice" id="invoice" name="invoice"><i class="anchor-icon"></i></a>Invoice</h4> +<h4><a class="anchor" name="invoice" href="#invoice"><i class="anchor-icon"></i></a>Invoice</h4> <p>This object contains basic information about an invoice.</p> <table class="table"> <thead> @@ -10329,7 +10299,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#shippingaddress" id="shippingaddress" name="shippingaddress"><i class="anchor-icon"></i></a>ShippingAddress</h4> +<h4><a class="anchor" name="shippingaddress" href="#shippingaddress"><i class="anchor-icon"></i></a>ShippingAddress</h4> <p>This object represents a shipping address.</p> <table class="table"> <thead> @@ -10372,7 +10342,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#orderinfo" id="orderinfo" name="orderinfo"><i class="anchor-icon"></i></a>OrderInfo</h4> +<h4><a class="anchor" name="orderinfo" href="#orderinfo"><i class="anchor-icon"></i></a>OrderInfo</h4> <p>This object represents information about an order.</p> <table class="table"> <thead> @@ -10391,7 +10361,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>phone_number</td> <td>String</td> -<td><em>Optional</em>. User's phone number</td> +<td><em>Optional</em>. User's phone number</td> </tr> <tr> <td>email</td> @@ -10405,7 +10375,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#shippingoption" id="shippingoption" name="shippingoption"><i class="anchor-icon"></i></a>ShippingOption</h4> +<h4><a class="anchor" name="shippingoption" href="#shippingoption"><i class="anchor-icon"></i></a>ShippingOption</h4> <p>This object represents one shipping option.</p> <table class="table"> <thead> @@ -10433,7 +10403,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#successfulpayment" id="successfulpayment" name="successfulpayment"><i class="anchor-icon"></i></a>SuccessfulPayment</h4> +<h4><a class="anchor" name="successfulpayment" href="#successfulpayment"><i class="anchor-icon"></i></a>SuccessfulPayment</h4> <p>This object contains basic information about a successful payment.</p> <table class="table"> <thead> @@ -10481,7 +10451,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#shippingquery" id="shippingquery" name="shippingquery"><i class="anchor-icon"></i></a>ShippingQuery</h4> +<h4><a class="anchor" name="shippingquery" href="#shippingquery"><i class="anchor-icon"></i></a>ShippingQuery</h4> <p>This object contains information about an incoming shipping query.</p> <table class="table"> <thead> @@ -10514,7 +10484,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#precheckoutquery" id="precheckoutquery" name="precheckoutquery"><i class="anchor-icon"></i></a>PreCheckoutQuery</h4> +<h4><a class="anchor" name="precheckoutquery" href="#precheckoutquery"><i class="anchor-icon"></i></a>PreCheckoutQuery</h4> <p>This object contains information about an incoming pre-checkout query.</p> <table class="table"> <thead> @@ -10562,9 +10532,9 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h3><a class="anchor" href="#telegram-passport" id="telegram-passport" name="telegram-passport"><i class="anchor-icon"></i></a>Telegram Passport</h3> +<h3><a class="anchor" name="telegram-passport" href="#telegram-passport"><i class="anchor-icon"></i></a>Telegram Passport</h3> <p><strong>Telegram Passport</strong> is a unified authorization method for services that require personal identification. Users can upload their documents once, then instantly share their data with services that require real-world ID (finance, ICOs, etc.). Please see the <a href="/passport">manual</a> for details.</p> -<h4><a class="anchor" href="#passportdata" id="passportdata" name="passportdata"><i class="anchor-icon"></i></a>PassportData</h4> +<h4><a class="anchor" name="passportdata" href="#passportdata"><i class="anchor-icon"></i></a>PassportData</h4> <p>Describes Telegram Passport data shared with the bot by the user.</p> <table class="table"> <thead> @@ -10587,8 +10557,8 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#passportfile" id="passportfile" name="passportfile"><i class="anchor-icon"></i></a>PassportFile</h4> -<p>This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.</p> +<h4><a class="anchor" name="passportfile" href="#passportfile"><i class="anchor-icon"></i></a>PassportFile</h4> +<p>This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.</p> <table class="table"> <thead> <tr> @@ -10606,7 +10576,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>file_unique_id</td> <td>String</td> -<td>Unique 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.</td> +<td>Unique 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.</td> </tr> <tr> <td>file_size</td> @@ -10620,7 +10590,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#encryptedpassportelement" id="encryptedpassportelement" name="encryptedpassportelement"><i class="anchor-icon"></i></a>EncryptedPassportElement</h4> +<h4><a class="anchor" name="encryptedpassportelement" href="#encryptedpassportelement"><i class="anchor-icon"></i></a>EncryptedPassportElement</h4> <p>Describes documents or other Telegram Passport elements shared with the bot by the user.</p> <table class="table"> <thead> @@ -10634,47 +10604,47 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>type</td> <td>String</td> -<td>Element type. One of "personal_details", "passport", "driver_license", "identity_card", "internal_passport", "address", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration", "phone_number", "email".</td> +<td>Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.</td> </tr> <tr> <td>data</td> <td>String</td> -<td><em>Optional</em>. Base64-encoded encrypted Telegram Passport element data provided by the user, available for "personal_details", "passport", "driver_license", "identity_card", "internal_passport" and "address" types. Can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td> +<td><em>Optional</em>. Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td> </tr> <tr> <td>phone_number</td> <td>String</td> -<td><em>Optional</em>. User's verified phone number, available only for "phone_number" type</td> +<td><em>Optional</em>. User's verified phone number, available only for “phone_number” type</td> </tr> <tr> <td>email</td> <td>String</td> -<td><em>Optional</em>. User's verified email address, available only for "email" type</td> +<td><em>Optional</em>. User's verified email address, available only for “email” type</td> </tr> <tr> <td>files</td> <td>Array of <a href="#passportfile">PassportFile</a></td> -<td><em>Optional</em>. Array of encrypted files with documents provided by the user, available for "utility_bill", "bank_statement", "rental_agreement", "passport_registration" and "temporary_registration" types. Files can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td> +<td><em>Optional</em>. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td> </tr> <tr> <td>front_side</td> <td><a href="#passportfile">PassportFile</a></td> -<td><em>Optional</em>. Encrypted file with the front side of the document, provided by the user. Available for "passport", "driver_license", "identity_card" and "internal_passport". The file can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td> +<td><em>Optional</em>. Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td> </tr> <tr> <td>reverse_side</td> <td><a href="#passportfile">PassportFile</a></td> -<td><em>Optional</em>. Encrypted file with the reverse side of the document, provided by the user. Available for "driver_license" and "identity_card". The file can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td> +<td><em>Optional</em>. Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td> </tr> <tr> <td>selfie</td> <td><a href="#passportfile">PassportFile</a></td> -<td><em>Optional</em>. Encrypted file with the selfie of the user holding a document, provided by the user; available for "passport", "driver_license", "identity_card" and "internal_passport". The file can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td> +<td><em>Optional</em>. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td> </tr> <tr> <td>translation</td> <td>Array of <a href="#passportfile">PassportFile</a></td> -<td><em>Optional</em>. Array of encrypted files with translated versions of documents provided by the user. Available if requested for "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration" and "temporary_registration" types. Files can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td> +<td><em>Optional</em>. Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td> </tr> <tr> <td>hash</td> @@ -10683,7 +10653,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#encryptedcredentials" id="encryptedcredentials" name="encryptedcredentials"><i class="anchor-icon"></i></a>EncryptedCredentials</h4> +<h4><a class="anchor" name="encryptedcredentials" href="#encryptedcredentials"><i class="anchor-icon"></i></a>EncryptedCredentials</h4> <p>Describes data required for decrypting and authenticating <a href="#encryptedpassportelement">EncryptedPassportElement</a>. See the <a href="/passport#receiving-information">Telegram Passport Documentation</a> for a complete description of the data decryption and authentication processes.</p> <table class="table"> <thead> @@ -10697,7 +10667,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>data</td> <td>String</td> -<td>Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for <a href="#encryptedpassportelement">EncryptedPassportElement</a> decryption and authentication</td> +<td>Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for <a href="#encryptedpassportelement">EncryptedPassportElement</a> decryption and authentication</td> </tr> <tr> <td>hash</td> @@ -10707,13 +10677,13 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>secret</td> <td>String</td> -<td>Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption</td> +<td>Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#setpassportdataerrors" id="setpassportdataerrors" name="setpassportdataerrors"><i class="anchor-icon"></i></a>setPassportDataErrors</h4> +<h4><a class="anchor" name="setpassportdataerrors" href="#setpassportdataerrors"><i class="anchor-icon"></i></a>setPassportDataErrors</h4> <p>Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns <em>True</em> on success.</p> -<p>Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.</p> +<p>Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.</p> <table class="table"> <thead> <tr> @@ -10738,7 +10708,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#passportelementerror" id="passportelementerror" name="passportelementerror"><i class="anchor-icon"></i></a>PassportElementError</h4> +<h4><a class="anchor" name="passportelementerror" href="#passportelementerror"><i class="anchor-icon"></i></a>PassportElementError</h4> <p>This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of:</p> <ul> <li><a href="#passportelementerrordatafield">PassportElementErrorDataField</a></li> @@ -10751,8 +10721,8 @@ No more than <strong>50</strong> results per query are allowed.</p> <li><a href="#passportelementerrortranslationfiles">PassportElementErrorTranslationFiles</a></li> <li><a href="#passportelementerrorunspecified">PassportElementErrorUnspecified</a></li> </ul> -<h4><a class="anchor" href="#passportelementerrordatafield" id="passportelementerrordatafield" name="passportelementerrordatafield"><i class="anchor-icon"></i></a>PassportElementErrorDataField</h4> -<p>Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.</p> +<h4><a class="anchor" name="passportelementerrordatafield" href="#passportelementerrordatafield"><i class="anchor-icon"></i></a>PassportElementErrorDataField</h4> +<p>Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.</p> <table class="table"> <thead> <tr> @@ -10770,7 +10740,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>type</td> <td>String</td> -<td>The section of the user's Telegram Passport which has the error, one of "personal_details", "passport", "driver_license", "identity_card", "internal_passport", "address"</td> +<td>The section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”</td> </tr> <tr> <td>field_name</td> @@ -10789,7 +10759,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#passportelementerrorfrontside" id="passportelementerrorfrontside" name="passportelementerrorfrontside"><i class="anchor-icon"></i></a>PassportElementErrorFrontSide</h4> +<h4><a class="anchor" name="passportelementerrorfrontside" href="#passportelementerrorfrontside"><i class="anchor-icon"></i></a>PassportElementErrorFrontSide</h4> <p>Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes.</p> <table class="table"> <thead> @@ -10808,7 +10778,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>type</td> <td>String</td> -<td>The section of the user's Telegram Passport which has the issue, one of "passport", "driver_license", "identity_card", "internal_passport"</td> +<td>The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”</td> </tr> <tr> <td>file_hash</td> @@ -10822,7 +10792,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#passportelementerrorreverseside" id="passportelementerrorreverseside" name="passportelementerrorreverseside"><i class="anchor-icon"></i></a>PassportElementErrorReverseSide</h4> +<h4><a class="anchor" name="passportelementerrorreverseside" href="#passportelementerrorreverseside"><i class="anchor-icon"></i></a>PassportElementErrorReverseSide</h4> <p>Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.</p> <table class="table"> <thead> @@ -10841,7 +10811,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>type</td> <td>String</td> -<td>The section of the user's Telegram Passport which has the issue, one of "driver_license", "identity_card"</td> +<td>The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card”</td> </tr> <tr> <td>file_hash</td> @@ -10855,7 +10825,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#passportelementerrorselfie" id="passportelementerrorselfie" name="passportelementerrorselfie"><i class="anchor-icon"></i></a>PassportElementErrorSelfie</h4> +<h4><a class="anchor" name="passportelementerrorselfie" href="#passportelementerrorselfie"><i class="anchor-icon"></i></a>PassportElementErrorSelfie</h4> <p>Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.</p> <table class="table"> <thead> @@ -10874,7 +10844,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>type</td> <td>String</td> -<td>The section of the user's Telegram Passport which has the issue, one of "passport", "driver_license", "identity_card", "internal_passport"</td> +<td>The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”</td> </tr> <tr> <td>file_hash</td> @@ -10888,7 +10858,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#passportelementerrorfile" id="passportelementerrorfile" name="passportelementerrorfile"><i class="anchor-icon"></i></a>PassportElementErrorFile</h4> +<h4><a class="anchor" name="passportelementerrorfile" href="#passportelementerrorfile"><i class="anchor-icon"></i></a>PassportElementErrorFile</h4> <p>Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.</p> <table class="table"> <thead> @@ -10907,7 +10877,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>type</td> <td>String</td> -<td>The section of the user's Telegram Passport which has the issue, one of "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration"</td> +<td>The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”</td> </tr> <tr> <td>file_hash</td> @@ -10921,7 +10891,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#passportelementerrorfiles" id="passportelementerrorfiles" name="passportelementerrorfiles"><i class="anchor-icon"></i></a>PassportElementErrorFiles</h4> +<h4><a class="anchor" name="passportelementerrorfiles" href="#passportelementerrorfiles"><i class="anchor-icon"></i></a>PassportElementErrorFiles</h4> <p>Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.</p> <table class="table"> <thead> @@ -10940,7 +10910,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>type</td> <td>String</td> -<td>The section of the user's Telegram Passport which has the issue, one of "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration"</td> +<td>The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”</td> </tr> <tr> <td>file_hashes</td> @@ -10954,7 +10924,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#passportelementerrortranslationfile" id="passportelementerrortranslationfile" name="passportelementerrortranslationfile"><i class="anchor-icon"></i></a>PassportElementErrorTranslationFile</h4> +<h4><a class="anchor" name="passportelementerrortranslationfile" href="#passportelementerrortranslationfile"><i class="anchor-icon"></i></a>PassportElementErrorTranslationFile</h4> <p>Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.</p> <table class="table"> <thead> @@ -10973,7 +10943,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>type</td> <td>String</td> -<td>Type of element of the user's Telegram Passport which has the issue, one of "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration"</td> +<td>Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”</td> </tr> <tr> <td>file_hash</td> @@ -10987,7 +10957,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#passportelementerrortranslationfiles" id="passportelementerrortranslationfiles" name="passportelementerrortranslationfiles"><i class="anchor-icon"></i></a>PassportElementErrorTranslationFiles</h4> +<h4><a class="anchor" name="passportelementerrortranslationfiles" href="#passportelementerrortranslationfiles"><i class="anchor-icon"></i></a>PassportElementErrorTranslationFiles</h4> <p>Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.</p> <table class="table"> <thead> @@ -11006,7 +10976,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>type</td> <td>String</td> -<td>Type of element of the user's Telegram Passport which has the issue, one of "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration"</td> +<td>Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”</td> </tr> <tr> <td>file_hashes</td> @@ -11020,7 +10990,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#passportelementerrorunspecified" id="passportelementerrorunspecified" name="passportelementerrorunspecified"><i class="anchor-icon"></i></a>PassportElementErrorUnspecified</h4> +<h4><a class="anchor" name="passportelementerrorunspecified" href="#passportelementerrorunspecified"><i class="anchor-icon"></i></a>PassportElementErrorUnspecified</h4> <p>Represents an issue in an unspecified place. The error is considered resolved when new data is added.</p> <table class="table"> <thead> @@ -11039,7 +11009,7 @@ No more than <strong>50</strong> results per query are allowed.</p> <tr> <td>type</td> <td>String</td> -<td>Type of element of the user's Telegram Passport which has the issue</td> +<td>Type of element of the user's Telegram Passport which has the issue</td> </tr> <tr> <td>element_hash</td> @@ -11053,20 +11023,20 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h3><a class="anchor" href="#games" id="games" name="games"><i class="anchor-icon"></i></a>Games</h3> +<h3><a class="anchor" name="games" href="#games"><i class="anchor-icon"></i></a>Games</h3> <p>Your bot can offer users <strong>HTML5 games</strong> to play solo or to compete against each other in groups and one-on-one chats. Create games via <a href="https://t.me/botfather">@BotFather</a> using the <em>/newgame</em> command. Please note that this kind of power requires responsibility: you will need to accept the terms for each game that your bots will be offering.</p> <ul> <li>Games are a new type of content on Telegram, represented by the <a href="#game">Game</a> and <a href="#inlinequeryresultgame">InlineQueryResultGame</a> objects.</li> -<li>Once you've created a game via <a href="https://t.me/botfather">BotFather</a>, you can send games to chats as regular messages using the <a href="#sendgame">sendGame</a> method, or use <a href="#inline-mode">inline mode</a> with <a href="#inlinequeryresultgame">InlineQueryResultGame</a>.</li> -<li>If you send the game message without any buttons, it will automatically have a 'Play <em>GameName</em>' button. When this button is pressed, your bot gets a <a href="#callbackquery">CallbackQuery</a> with the <em>game_short_name</em> of the requested game. You provide the correct URL for this particular user and the app opens the game in the in-app browser.</li> -<li>You can manually add multiple buttons to your game message. Please note that the first button in the first row <strong>must always</strong> launch the game, using the field <em>callback_game</em> in <a href="#inlinekeyboardbutton">InlineKeyboardButton</a>. You can add extra buttons according to taste: e.g., for a description of the rules, or to open the game's official community.</li> +<li>Once you've created a game via <a href="https://t.me/botfather">BotFather</a>, you can send games to chats as regular messages using the <a href="#sendgame">sendGame</a> method, or use <a href="#inline-mode">inline mode</a> with <a href="#inlinequeryresultgame">InlineQueryResultGame</a>.</li> +<li>If you send the game message without any buttons, it will automatically have a 'Play <em>GameName</em>' button. When this button is pressed, your bot gets a <a href="#callbackquery">CallbackQuery</a> with the <em>game_short_name</em> of the requested game. You provide the correct URL for this particular user and the app opens the game in the in-app browser.</li> +<li>You can manually add multiple buttons to your game message. Please note that the first button in the first row <strong>must always</strong> launch the game, using the field <em>callback_game</em> in <a href="#inlinekeyboardbutton">InlineKeyboardButton</a>. You can add extra buttons according to taste: e.g., for a description of the rules, or to open the game's official community.</li> <li>To make your game more attractive, you can upload a GIF animation that demostrates the game to the users via <a href="https://t.me/botfather">BotFather</a> (see <a href="https://t.me/gamebot?game=lumberjack">Lumberjack</a> for example).</li> <li>A game message will also display high scores for the current chat. Use <a href="#setgamescore">setGameScore</a> to post high scores to the chat with the game, add the <em>edit_message</em> parameter to automatically update the message with the current scoreboard.</li> <li>Use <a href="#getgamehighscores">getGameHighScores</a> to get data for in-game high score tables.</li> <li>You can also add an extra <a href="/bots/games#sharing-your-game-to-telegram-chats">sharing button</a> for users to share their best score to different chats.</li> <li>For examples of what can be done using this new stuff, check the <a href="https://t.me/gamebot">@gamebot</a> and <a href="https://t.me/gamee">@gamee</a> bots.</li> </ul> -<h4><a class="anchor" href="#sendgame" id="sendgame" name="sendgame"><i class="anchor-icon"></i></a>sendGame</h4> +<h4><a class="anchor" name="sendgame" href="#sendgame"><i class="anchor-icon"></i></a>sendGame</h4> <p>Use this method to send a game. On success, the sent <a href="#message">Message</a> is returned.</p> <table class="table"> <thead> @@ -11124,11 +11094,11 @@ No more than <strong>50</strong> results per query are allowed.</p> <td>reply_markup</td> <td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td> <td>Optional</td> -<td>A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.</td> +<td>A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#game" id="game" name="game"><i class="anchor-icon"></i></a>Game</h4> +<h4><a class="anchor" name="game" href="#game"><i class="anchor-icon"></i></a>Game</h4> <p>This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.</p> <table class="table"> <thead> @@ -11171,10 +11141,10 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#callbackgame" id="callbackgame" name="callbackgame"><i class="anchor-icon"></i></a>CallbackGame</h4> +<h4><a class="anchor" name="callbackgame" href="#callbackgame"><i class="anchor-icon"></i></a>CallbackGame</h4> <p>A placeholder, currently holds no information. Use <a href="https://t.me/botfather">BotFather</a> to set up your game.</p> -<h4><a class="anchor" href="#setgamescore" id="setgamescore" name="setgamescore"><i class="anchor-icon"></i></a>setGameScore</h4> -<p>Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the <a href="#message">Message</a> is returned, otherwise <em>True</em> is returned. Returns an error, if the new score is not greater than the user's current score in the chat and <em>force</em> is <em>False</em>.</p> +<h4><a class="anchor" name="setgamescore" href="#setgamescore"><i class="anchor-icon"></i></a>setGameScore</h4> +<p>Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the <a href="#message">Message</a> is returned, otherwise <em>True</em> is returned. Returns an error, if the new score is not greater than the user's current score in the chat and <em>force</em> is <em>False</em>.</p> <table class="table"> <thead> <tr> @@ -11229,7 +11199,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#getgamehighscores" id="getgamehighscores" name="getgamehighscores"><i class="anchor-icon"></i></a>getGameHighScores</h4> +<h4><a class="anchor" name="getgamehighscores" href="#getgamehighscores"><i class="anchor-icon"></i></a>getGameHighScores</h4> <p>Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of <a href="#gamehighscore">GameHighScore</a> objects.</p> <blockquote> <p>This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and their neighbors are not among them. Please note that this behavior is subject to change.</p> @@ -11270,7 +11240,7 @@ No more than <strong>50</strong> results per query are allowed.</p> </tr> </tbody> </table> -<h4><a class="anchor" href="#gamehighscore" id="gamehighscore" name="gamehighscore"><i class="anchor-icon"></i></a>GameHighScore</h4> +<h4><a class="anchor" name="gamehighscore" href="#gamehighscore"><i class="anchor-icon"></i></a>GameHighScore</h4> <p>This object represents one row of the high scores table for a game.</p> <table class="table"> <thead> @@ -11299,8 +11269,8 @@ No more than <strong>50</strong> results per query are allowed.</p> </tbody> </table> <hr> -<p>And that's about all we've got for now. -If you've got any questions, please check out our <a href="/bots/faq"><strong>Bot FAQ »</strong></a></p></div> +<p>And that's about all we've got for now.<br>If you've got any questions, please check out our <a href="/bots/faq"><strong>Bot FAQ »</strong></a></p> +</div> </div> diff --git a/data/web/corefork.telegram.org/bots/features.html b/data/web/corefork.telegram.org/bots/features.html index ab39cc4672..c1ba4d69f3 100644 --- a/data/web/corefork.telegram.org/bots/features.html +++ b/data/web/corefork.telegram.org/bots/features.html @@ -49,7 +49,7 @@ <li><a href="/bots">A General Bot Platform Overview</a></li> <li><a href="/bots/api">Full API Reference for Developers</a></li> </ul> -<h3><a class="anchor" href="#what-features-do-bots-have" id="what-features-do-bots-have" name="what-features-do-bots-have"><i class="anchor-icon"></i></a>What features do bots have?</h3> +<h3><a class="anchor" name="what-features-do-bots-have" href="#what-features-do-bots-have"><i class="anchor-icon"></i></a>What features do bots have?</h3> <ul> <li><a href="#inputs"><strong>Inputs</strong></a><ul> <li><a href="#inputs">Text</a></li> @@ -69,7 +69,7 @@ <li><a href="#payments">Payments</a></li> <li><a href="#web-login">Web Login</a></li> <li><a href="#html5-games">HTML5 Games</a></li> -<li><a href="#stickers-and-custom-emoji">Stickers</a> </li> +<li><a href="#stickers">Stickers</a> </li> </ul> </li> <li><a href="#language-support"><strong>Language Support</strong></a></li> @@ -83,21 +83,22 @@ <li><a href="#botfather"><strong>BotFather, creating and managing bots</strong></a></li> </ul> <hr> -<h3><a class="anchor" href="#inputs" id="inputs" name="inputs"><i class="anchor-icon"></i></a>Inputs</h3> -<p>Users can send <strong>messages of all types</strong> to bots, including text, files, locations, stickers, voice messages and even <a href="/bots/api#dice">dice</a> if they're feeling lucky. However, Telegram bots offer many other tools for building flexible interfaces tailored to your specific needs:</p> +<h3><a class="anchor" name="inputs" href="#inputs"><i class="anchor-icon"></i></a>Inputs</h3> +<p>Users can send <strong>messages of all types</strong> to bots, including text, files, locations, stickers, voice messages and even <a href="/bots/api#dice">dice</a> if they're feeling lucky. However, Telegram bots offer many other tools for building flexible interfaces tailored to your specific needs:</p> <ul> <li><a href="#commands">Commands</a> that are highlighted in messages and can be selected from a list after typing <code>/</code>.</li> -<li><a href="#keyboards">Keyboards</a> that replace the user's keyboard with predefined answer options.</li> +<li><a href="#keyboards">Keyboards</a> that replace the user's keyboard with predefined answer options.</li> <li><a href="#inline-keyboards">Buttons</a> that are shown next to messages from the bot.</li> </ul> <p>For even more flexibility, <a href="#web-apps">Web Apps</a> support 100% custom interfaces with JavaScript. </p> <div> - <a href="/file/464001858/11318/ahAJjwERIX8.164875/ce1372cbf73e3ea94e" target="_blank"><img src="/file/464001858/11318/ahAJjwERIX8.164875/ce1372cbf73e3ea94e" title="Inputs" class="dev_page_image" width="70%"></a> + <a href="/file/464001858/11318/ahAJjwERIX8.164875/ce1372cbf73e3ea94e" target="_blank"><img src="/file/464001858/11318/ahAJjwERIX8.164875/ce1372cbf73e3ea94e" title="Inputs" class="dev_page_image" width=70% /></a> </div> + <blockquote> -<p><strong>Note:</strong> Telegram bots can support <a href="#language-support">multiple languages</a> that adapt to the users' language settings in the app.</p> +<p><strong>Note:</strong> Telegram bots can support <a href="#language-support">multiple languages</a> that adapt to the users' language settings in the app.</p> </blockquote> -<h4><a class="anchor" href="#commands" id="commands" name="commands"><i class="anchor-icon"></i></a>Commands</h4> +<h4><a class="anchor" name="commands" href="#commands"><i class="anchor-icon"></i></a>Commands</h4> <p>A command is a simple <code>/keyword</code> that tells the bot what to do. Telegram apps will:</p> <ul> <li><strong>Highlight</strong> commands in messages. When the user taps a highlighted command, that command is immediately sent again.</li> @@ -112,58 +113,61 @@ <li>/newlocation </li> <li>/newrule </li> </ul> -<p>Commands should be <strong>as specific as possible</strong> – for example <code>/newlocation</code> or <code>/newrule</code> <strong>is better</strong> than a <code>/new</code> command that then requires an additional parameter from the user like "<em>location</em>" or "<em>rule</em>".</p> +<p>Commands should be <strong>as specific as possible</strong> – for example <code>/newlocation</code> or <code>/newrule</code> <strong>is better</strong> than a <code>/new</code> command that then requires an additional parameter from the user like "<em>location</em>“ or ”<em>rule</em>".</p> <div> - <a href="/file/464001775/10227/HCr0XgSUHrg.119089/c17ff5d34fe528361e" target="_blank"><img src="/file/464001775/10227/HCr0XgSUHrg.119089/c17ff5d34fe528361e" title="Commands" class="dev_page_image" width="44%"></a> + <a href="/file/464001775/10227/HCr0XgSUHrg.119089/c17ff5d34fe528361e" target="_blank"><img src="/file/464001775/10227/HCr0XgSUHrg.119089/c17ff5d34fe528361e" title="Commands" class="dev_page_image" +width=44% /></a> </div> + <blockquote> <p>We require <strong>all developers</strong> to support several <a href="#global-commands">Global Commands</a> to make sure Telegram bots offer a consistent and user-friendly experience.</p> </blockquote> -<h5><a class="anchor" href="#command-scopes" id="command-scopes" name="command-scopes"><i class="anchor-icon"></i></a>Command Scopes</h5> -<p>Your bot is able to <strong>show different commands</strong> to different users and groups – you can control this using <a href="/bots/api#botcommandscope">scopes</a>. For example, your bot could show additional commands to group admins or translate the list based on the user’s <a href="/bots/api#user">language_code</a>.</p> +<h5><a class="anchor" name="command-scopes" href="#command-scopes"><i class="anchor-icon"></i></a>Command Scopes</h5> +<p>Your bot is able to <strong>show different commands</strong> to different users and groups – you can control this using <a href="/bots/api#botcommandscope">scopes</a>. For example, your bot could show additional commands to group admins or translate the list based on the user’s <a href="/bots/api#user">language_code</a>.</p> <blockquote> <p>Keep in mind that Bot API <a href="/bots/api#update">updates</a> <strong>will not contain any information</strong> about the scope of a command sent by the user – in fact, they may contain commands that don’t exist at all in your bot. Your backend should <strong>always</strong> verify that received commands are valid and that the user was authorized to use them regardless of scope.</p> -</blockquote> -<blockquote> <p>Bots with privacy mode enabled will only receive commands in groups under special conditions, <a href="#privacy-mode">see here</a>.</p> </blockquote> -<h4><a class="anchor" href="#keyboards" id="keyboards" name="keyboards"><i class="anchor-icon"></i></a>Keyboards</h4> +<h4><a class="anchor" name="keyboards" href="#keyboards"><i class="anchor-icon"></i></a>Keyboards</h4> <p>Bots are able to interpret free text input from users, but offering <strong>specific suggestions</strong> is often more intuitive – this is where <strong>custom keyboards</strong> can be extremely useful.</p> <p>Whenever your bot sends a message, it can <strong>display a special keyboard</strong> with predefined reply options (see <a href="/bots/api#replykeyboardmarkup">ReplyKeyboardMarkup</a>). Telegram apps that receive the message will display your keyboard to the user. Using any of the buttons will immediately send the respective text. This way you can drastically <strong>simplify</strong> and <strong>streamline</strong> user interaction with your bot.</p> <div> - <a href="/file/464001950/1191a/2RwpmgU-swU.123554/b50478c124d5914c23" target="_blank"><img src="/file/464001950/1191a/2RwpmgU-swU.123554/b50478c124d5914c23" title="Keyboards" class="dev_page_image" width="44%"></a> + <a href="/file/464001950/1191a/2RwpmgU-swU.123554/b50478c124d5914c23" target="_blank"><img src="/file/464001950/1191a/2RwpmgU-swU.123554/b50478c124d5914c23" title="Keyboards" class="dev_page_image" width=44% /></a> </div> + <blockquote> -<p>Check out the <a href="/bots/api#replykeyboardmarkup">one_time_keyboard</a> parameter to automatically hide your bot's keyboard as soon as it's been used.</p> +<p>Check out the <a href="/bots/api#replykeyboardmarkup">one_time_keyboard</a> parameter to automatically hide your bot's keyboard as soon as it's been used.</p> </blockquote> <p>You can also <strong>customize the text placeholder</strong> in the input field by setting the <code>input_field_placeholder</code> parameter.</p> -<h4><a class="anchor" href="#inline-keyboards" id="inline-keyboards" name="inline-keyboards"><i class="anchor-icon"></i></a>Inline Keyboards</h4> -<p>There are times when you'd prefer to do things <strong>without sending any messages</strong> to the chat – like when a user is changing settings, toggling options or navigating search results. In such cases, you can use <a href="/bots/api#inlinekeyboardmarkup">Inline Keyboards</a> that are shown directly below their relevant messages.</p> -<p>Unlike with custom reply keyboards, pressing buttons on inline keyboards <strong>doesn't send messages to the chat</strong>. Instead, inline keyboards support buttons that can work behind the scenes or open different interfaces: <a href="/bots/api#inlinekeyboardbutton">callback buttons</a>, <a href="/bots/api#inlinekeyboardbutton">URL buttons</a>, <a href="/bots/api#inlinekeyboardbutton">switch-to-inline buttons</a>, <a href="/bots/api#inlinekeyboardbutton">game buttons</a> and <a href="/bots/api#inlinekeyboardbutton">payment buttons</a>. </p> +<h4><a class="anchor" name="inline-keyboards" href="#inline-keyboards"><i class="anchor-icon"></i></a>Inline Keyboards</h4> +<p>There are times when you'd prefer to do things <strong>without sending any messages</strong> to the chat – like when a user is changing settings, toggling options or navigating search results. In such cases, you can use <a href="/bots/api#inlinekeyboardmarkup">Inline Keyboards</a> that are shown directly below their relevant messages.</p> +<p>Unlike with custom reply keyboards, pressing buttons on inline keyboards <strong>doesn't send messages to the chat</strong>. Instead, inline keyboards support buttons that can work behind the scenes or open different interfaces: <a href="/bots/api#inlinekeyboardbutton">callback buttons</a>, <a href="/bots/api#inlinekeyboardbutton">URL buttons</a>, <a href="/bots/api#inlinekeyboardbutton">switch-to-inline buttons</a>, <a href="/bots/api#inlinekeyboardbutton">game buttons</a> and <a href="/bots/api#inlinekeyboardbutton">payment buttons</a>. </p> <div> - <a href="/file/464001863/110f3/I47qTXAD9Z4.120010/e0ea04f66357b640ec" target="_blank"><img src="/file/464001863/110f3/I47qTXAD9Z4.120010/e0ea04f66357b640ec" title="Inline Keyboard" class="dev_page_image" width="44%"></a> + <a href="/file/464001863/110f3/I47qTXAD9Z4.120010/e0ea04f66357b640ec" target="_blank"><img src="/file/464001863/110f3/I47qTXAD9Z4.120010/e0ea04f66357b640ec" title="Inline Keyboard" class="dev_page_image" width=44% /></a> </div> + <blockquote> <p>To provide a <strong>better user experience</strong>, consider <a href="/bots/api#editmessagereplymarkup">editing your keyboard</a> when the user toggles a setting button or navigates to a new page – this is both <strong>faster</strong> and <strong>smoother</strong> than sending a whole new message and deleting the previous one.</p> </blockquote> -<h4><a class="anchor" href="#menu-button" id="menu-button" name="menu-button"><i class="anchor-icon"></i></a>Menu Button</h4> -<p>In all bot chats, a menu button appears near the message field. By default, tapping this button <strong>opens a menu</strong> that can hold some or all of a bot's commands, including a short description for each. Users can then <strong>select a command from the menu</strong> without needing to type it out.</p> +<h4><a class="anchor" name="menu-button" href="#menu-button"><i class="anchor-icon"></i></a>Menu Button</h4> +<p>In all bot chats, a menu button appears near the message field. By default, tapping this button <strong>opens a menu</strong> that can hold some or all of a bot's commands, including a short description for each. Users can then <strong>select a command from the menu</strong> without needing to type it out.</p> <p>You can set different texts of the menu button and its command descriptions for various <strong>individual users</strong> or <strong>groups of users</strong> – for example, showing translated text based on the user’s language, as explained <a href="#commands">here</a>.</p> <div class="blog_video_player_wrap" style="max-width: 400px; margin: 20px auto 20px;"> <video class="blog_video_player tl_blog_vid_autoplay" onclick="videoTogglePlay(this)" autoplay="" loop="" controls="" muted="" poster="/file/464001581/11d85/f42u9c5Wncg.133752/b5a95b7f1221032d7d" style="max-width: 400px;" title="Bot Menu Button" alt="Video: Bot Menu Button"> <source src="/file/464001555/10fbd/jvTuV2Ke7WQ.1916669.mp4/a056de323645db409d" type="video/mp4"> - </source></video> + </video> </div> + <p>The <strong>menu button</strong> can alternatively be used to launch a <a href="#web-apps">Web App</a>.</p> -<h4><a class="anchor" href="#global-commands" id="global-commands" name="global-commands"><i class="anchor-icon"></i></a>Global Commands</h4> +<h4><a class="anchor" name="global-commands" href="#global-commands"><i class="anchor-icon"></i></a>Global Commands</h4> <p>To make basic interactions more uniform, we ask all developers to support a few <strong>basic commands</strong>. Telegram apps will have interface shortcuts for these commands.</p> <ul> <li>/start - begins the interaction with the user, like sending an introductory message. This command can also be used to pass additional parameters to the bot (see <a href="#deep-linking">Deep Linking</a>).</li> <li>/help - returns a help message, like a short text about what your bot can do and a list of commands.</li> -<li>/settings - (if applicable) shows the bot's settings for this user and suggests commands to edit them.</li> +<li>/settings - (if applicable) shows the bot's settings for this user and suggests commands to edit them.</li> </ul> -<p>Users will see a <strong>Start</strong> button the first time they open a chat with your bot. <strong>Help</strong> and <strong>Settings</strong> links will be available in the menu on the bot's profile page if you add them in <a href="https://t.me/botfather">@BotFather</a>.</p> -<h3><a class="anchor" href="#chat-and-user-selection" id="chat-and-user-selection" name="chat-and-user-selection"><i class="anchor-icon"></i></a>Chat and User Selection</h3> +<p>Users will see a <strong>Start</strong> button the first time they open a chat with your bot. <strong>Help</strong> and <strong>Settings</strong> links will be available in the menu on the bot's profile page if you add them in <a href="https://t.me/botfather">@BotFather</a>.</p> +<h3><a class="anchor" name="chat-and-user-selection" href="#chat-and-user-selection"><i class="anchor-icon"></i></a>Chat and User Selection</h3> <p>Bots can present the user with a <strong>friendly</strong> and <strong>intuitive</strong> interface that lists any number of groups, channels or other users according to a custom set of <strong>criteria</strong>. Tapping on a chat will send its identifier to the bot in a service message and seamlessly close the interface.</p> <p>A group management bot is the <strong>perfect example</strong>: an admin could select a chat the bot should manage, and then select a user it should promote – this would happen without ever typing any text.</p> <p>Here is a <strong>quick start guide</strong> to use this feature:</p> @@ -171,74 +175,75 @@ <li>Pick a set of criteria and store them in a <a href="https://core.telegram.org/bots/api#keyboardbuttonrequestchat">KeyboardButtonRequestChat</a> object (or <a href="https://core.telegram.org/bots/api#keyboardbuttonrequestuser">KeyboardButtonRequestUser</a> for users).</li> <li>Create a <a href="https://core.telegram.org/bots/api#keyboardbutton">KeyboardButton</a> and store the criteria under <code>request_chat</code> or <code>request_user</code> respectively.</li> <li>Send a <a href="https://core.telegram.org/bots/api#replykeyboardmarkup">ReplyKeyboardMarkup</a> that contains the button you just created.</li> -<li>When the user selects a chat, you'll receive its identifier in a <code>chat_shared</code> or <code>user_shared</code> service message.</li> +<li>When the user selects a chat, you'll receive its identifier in a <code>chat_shared</code> or <code>user_shared</code> service message.</li> </ul> <div class="blog_video_player_wrap" style="max-width: 400px; margin: 20px auto 20px;"> <video class="blog_video_player tl_blog_vid_autoplay" onclick="videoTogglePlay(this)" loop="" muted="" poster="/file/464001277/1132d/dAINJNWL9jw.34909/08eaf646c24be49a87" style="max-width: 400px;" title="Select Chats For Bots" alt="Select Chats For Bots" vindex="1" preload="auto"> <source src="/file/464001095/11121/M6HpBwtivTE.1913043.mp4/0514a29affa78a6dca" type="video/mp4"> - </source></video> + </video> </div> + <blockquote> <p>Keep in mind that the bot may not be able to use the identifier it receives if the corresponding chat or user is not already known or accessible by some other means.</p> </blockquote> <hr> -<h3><a class="anchor" href="#interactions" id="interactions" name="interactions"><i class="anchor-icon"></i></a>Interactions</h3> +<h3><a class="anchor" name="interactions" href="#interactions"><i class="anchor-icon"></i></a>Interactions</h3> <p>In addition to sending commands and messages to the chat with the bot, there are several ways of interacting with them without opening any specific chat or group.</p> <ul> <li><a href="#inline-requests"><strong>Inline mode</strong></a> allows sending requests to bots right from the input field – from any chat on Telegram.</li> <li><a href="#deep-linking"><strong>Deep linking</strong></a> allows special links that send certain parameters to the bot when opened.</li> <li><a href="#attachment-menu"><strong>Attachment menu</strong></a> integration makes it possible to use bots from the attachment menu in chats.</li> </ul> -<h4><a class="anchor" href="#inline-requests" id="inline-requests" name="inline-requests"><i class="anchor-icon"></i></a>Inline Requests</h4> -<p>Users can interact with your bot via <strong>inline queries</strong> straight from the message field <strong>in any chat</strong>. All they need to do is start a message with your bot's <em>@username</em> and enter a keyword.</p> +<h4><a class="anchor" name="inline-requests" href="#inline-requests"><i class="anchor-icon"></i></a>Inline Requests</h4> +<p>Users can interact with your bot via <strong>inline queries</strong> straight from the message field <strong>in any chat</strong>. All they need to do is start a message with your bot's <em>@username</em> and enter a keyword.</p> <p>Having received the query, your bot can return some results. As soon as the user selects one, it is sent to the <strong>relevant chat</strong>. This way, people can request and send content from your bot in any of their chats, groups or channels.</p> <p>Remember that inline functionality has to be enabled via <a href="https://t.me/botfather">@BotFather</a>, or your bot will not receive inline <a href="/bots/api#update">Updates</a>.</p> <div> - <a href="/file/464001466/10e4a/r4FKyQ7gw5g.134366/f2606a53d683374703" target="_blank"><img src="/file/464001466/10e4a/r4FKyQ7gw5g.134366/f2606a53d683374703" title="Inline Mode" class="dev_page_image" width="51%/"></a> + <a href="/file/464001466/10e4a/r4FKyQ7gw5g.134366/f2606a53d683374703" target="_blank"><img src="/file/464001466/10e4a/r4FKyQ7gw5g.134366/f2606a53d683374703" title="Inline Mode" class="dev_page_image" width=51%/></a> </div> + <blockquote> <p>Examples of inline bots include <a href="https://gif.t.me">@gif</a>, <a href="https://bing.t.me">@bing</a> and <a href="https://wiki.t.me">@wiki</a>. <a href="#web-apps">Web App</a> bots can also be used inline – try typing <a href="https://durgerkingbot.t.me">@durgerkingbot</a> in any chat.</p> </blockquote> -<h4><a class="anchor" href="#deep-linking" id="deep-linking" name="deep-linking"><i class="anchor-icon"></i></a>Deep Linking</h4> -<p>Telegram bots have a deep linking mechanism that allows <strong>additional parameters</strong> to be passed to the bot on startup. It could be a command that launches the bot – or an authentication token to connect the user's Telegram account to their account on another platform.</p> +<h4><a class="anchor" name="deep-linking" href="#deep-linking"><i class="anchor-icon"></i></a>Deep Linking</h4> +<p>Telegram bots have a deep linking mechanism that allows <strong>additional parameters</strong> to be passed to the bot on startup. It could be a command that launches the bot – or an authentication token to connect the user's Telegram account to their account on another platform.</p> <p>Each bot has a link that <strong>opens a conversation</strong> with it in Telegram – <code>https://t.me/<bot_username></code>. Parameters can be added directly to this link to let your bot work with additional information on the fly, without any user input.</p> <blockquote> <p>A-Z, a-z, 0-9, _ and - are allowed. We recommend using base64url to encode parameters with binary and other types of content. The parameter can be up to 64 characters long.</p> </blockquote> -<p><strong>Private Chats</strong> -In private chats, you can use the <code>start</code> parameter to automatically pass any value to your bot whenever a user presses the link. For example, you could use:</p> +<p><strong>Private Chats</strong><br>In private chats, you can use the <code>start</code> parameter to automatically pass any value to your bot whenever a user presses the link. For example, you could use:</p> <pre><code>https://t.me/your_bot?start=airplane</code></pre> <p>When someone opens a chat with your bot via this link, you will receive:</p> <pre><code>/start airplane</code></pre> -<p><strong>Groups</strong> -In groups, you can add the parameter <code>startgroup</code> to this link. For example:</p> +<p><strong>Groups</strong><br>In groups, you can add the parameter <code>startgroup</code> to this link. For example:</p> <pre><code>https://t.me/your_bot?startgroup=spaceship</code></pre> <p>Following a link with this parameter prompts the user to select a group to add the bot to – the resulting update will contain text in the form:</p> <pre><code>/start@your_bot spaceship</code></pre> <blockquote> <p><a href="#web-apps">Web Apps</a> also support deep linking, for more information check out our <a href="/bots/webapps#adding-bots-to-the-attachment-menu">dedicated guide</a>.</p> </blockquote> -<h4><a class="anchor" href="#attachment-menu" id="attachment-menu" name="attachment-menu"><i class="anchor-icon"></i></a>Attachment Menu</h4> +<h4><a class="anchor" name="attachment-menu" href="#attachment-menu"><i class="anchor-icon"></i></a>Attachment Menu</h4> <p>Certain bots can be added directly to a user’s <strong>attachment menu</strong> – giving them easy access to the bot in any chat. Currently, this option is restricted to certain <a href="/bots/webapps#launching-web-apps-from-the-attachment-menu">approved bots</a>, but may be expanded later.</p> <div class="blog_video_player_wrap" style="max-width: 400px; margin: 20px auto 20px;"> <video class="blog_video_player tl_blog_vid_autoplay" onclick="videoTogglePlay(this)" autoplay="" loop="" controls="" muted="" poster="/file/464001491/11651/uwMWNdO29NE.215169/1b37285bbd8fc81244" style="max-width: 400px;" title="Attachment Menu" alt="Video: Bot Attachment Menu"> <source src="/file/464001177/11b03/ruSbBLQiLJ8.928268.mp4/d9ad95048d23f3cc3f" type="video/mp4"> - </source></video> + </video> </div> + <blockquote> <p>Try adding <a href="https://t.me/durgerkingbot?startattach">@DurgerKingBot</a> to your attachment menu.</p> </blockquote> <hr> -<h3><a class="anchor" href="#integration" id="integration" name="integration"><i class="anchor-icon"></i></a>Integration</h3> +<h3><a class="anchor" name="integration" href="#integration"><i class="anchor-icon"></i></a>Integration</h3> <p>There are various ways of futher integrating bots with Telegram and other services.</p> <ul> <li>Use <a href="#web-apps">Web Apps</a> to replace any website.</li> <li>Accept <a href="#payments">Payments</a> via dozens of integrated third-party payment providers.</li> <li>Connect to Telegram using the <a href="#web-login">Web Login</a> functionality.</li> <li>Create gaming bots by integrating <a href="#html5-games">HTML5 Games</a>.</li> -<li>Help users create and manage <a href="#stickers-and-custom-emoji">Telegram Stickers</a>.</li> +<li>Help users create and manage <a href="#stickers">Telegram Stickers</a>.</li> </ul> -<h3><a class="anchor" href="#web-apps" id="web-apps" name="web-apps"><i class="anchor-icon"></i></a>Web Apps</h3> +<h3><a class="anchor" name="web-apps" href="#web-apps"><i class="anchor-icon"></i></a>Web Apps</h3> <p>Bots can easily process <strong>complex inputs</strong> of any kind and <strong>dynamic interaction flows</strong> via <a href="webapps">Web Apps</a>. With this unique feature, you can develop any number of flexible, streamlined interfaces in <strong>JavaScript</strong>.</p> <blockquote> <p>Web Apps are covered in detail in our <a href="webapps">dedicated guide</a> – you should read it carefully to learn the wide variety of features they can offer.</p> @@ -246,14 +251,15 @@ In groups, you can add the parameter <code>startgroup</code> to this link. For e <div class="blog_video_player_wrap" style="max-width: 400px; margin: 20px auto 20px;"> <video class="blog_video_player tl_blog_vid_autoplay" onclick="videoTogglePlay(this)" autoplay="" loop="" controls="" muted="" poster="/file/464001434/100bf/eWprjdgzEbE.100386/644bbea83084f44c8f" style="max-width: 400px;" title="Attachment Menu" alt="Video: Bot Attachment Menu"> <source src="/file/464001679/11aa9/KQx_BlPVXRo.4922145.mp4/c65433c8ac11a347a8" type="video/mp4"> - </source></video> + </video> </div> -<p>If you develop a <strong>Web App</strong>, be sure to follow our <a href="webapps#design-guidelines">design guidelines</a> – you'll want your custom interface to <strong>seamlessly integrate</strong> into the app to provide users the best possible experience.</p> -<h3><a class="anchor" href="#payments" id="payments" name="payments"><i class="anchor-icon"></i></a>Payments</h3> -<p>Telegram bots can accept payments with a sleek, streamlined interface that collects all necessary data from the user. Telegram <strong>doesn't collect</strong> any payment data – like the user's credit card information – and sends it directly to one of the supported <a href="payments#supported-payment-providers">payment providers</a>.</p> + +<p>If you develop a <strong>Web App</strong>, be sure to follow our <a href="webapps#design-guidelines">design guidelines</a> – you'll want your custom interface to <strong>seamlessly integrate</strong> into the app to provide users the best possible experience.</p> +<h3><a class="anchor" name="payments" href="#payments"><i class="anchor-icon"></i></a>Payments</h3> +<p>Telegram bots can accept payments with a sleek, streamlined interface that collects all necessary data from the user. Telegram <strong>doesn't collect</strong> any payment data – like the user's credit card information – and sends it directly to one of the supported <a href="payments#supported-payment-providers">payment providers</a>.</p> <p>Here is a <strong>quick start guide</strong> to implement payments:</p> <ul> -<li>Pick a <a href="payments#supported-payment-providers">provider</a> and obtain the <a href="payments#getting-a-token">proper token</a> as well as a <strong>test token</strong> from the "<strong>Stripe TEST MODE</strong>" provider.</li> +<li>Pick a <a href="payments#supported-payment-providers">provider</a> and obtain the <a href="payments#getting-a-token">proper token</a> as well as a <strong>test token</strong> from the "<strong>Stripe TEST MODE</strong>" provider.</li> <li>Implement payments via the <a href="/bots/api#payments">appropriate API methods</a>.</li> <li>Test your implementation by using your <strong>test token</strong> along with a <a href="https://stripe.com/docs/testing#cards">test credit card</a>.</li> </ul> @@ -266,37 +272,38 @@ In groups, you can add the parameter <code>startgroup</code> to this link. For e </ul> <p>A full and exhaustive guide, including live checklist, parameters and in-depth method descriptions is available <a href="/bots/payments">here</a>. We <strong>strongly recommend</strong> that you read the full guide before going live.</p> <div> - <a href="/file/464001393/101fc/SB_bFCLR0tg.130549/7ecf91aaa44737e8cb" target="_blank"><img src="/file/464001393/101fc/SB_bFCLR0tg.130549/7ecf91aaa44737e8cb" title="Payments" class="dev_page_image" width="50%"></a> + <a href="/file/464001393/101fc/SB_bFCLR0tg.130549/7ecf91aaa44737e8cb" target="_blank"><img src="/file/464001393/101fc/SB_bFCLR0tg.130549/7ecf91aaa44737e8cb" title="Payments" class="dev_page_image" width=50% /></a> </div> + <blockquote> -<p>Telegram does not directly process the payments, does not store data about orders and does not collect any fees. Invoices are forwarded directly to the payment provider. -For this reason, disputes must be solved between the user, the bot developer and the payment provider. You can read more about this in the <a href="https://telegram.org/privacy#7-third-party-payment-services">Privacy Policy</a>.</p> +<p>Telegram does not directly process the payments, does not store data about orders and does not collect any fees. Invoices are forwarded directly to the payment provider.<br>For this reason, disputes must be solved between the user, the bot developer and the payment provider. You can read more about this in the <a href="https://telegram.org/privacy#7-third-party-payment-services">Privacy Policy</a>.</p> </blockquote> -<h3><a class="anchor" href="#web-login" id="web-login" name="web-login"><i class="anchor-icon"></i></a>Web Login</h3> +<h3><a class="anchor" name="web-login" href="#web-login"><i class="anchor-icon"></i></a>Web Login</h3> <p>Telegram offers a <strong>flexible</strong>, <strong>lightweight</strong> and <strong>free</strong> framework to authenticate users on any website and app. This can be used to bridge your platform with Telegram, providing a smooth experience to your users. You can also freely rely on this framework to implement a <strong>fast</strong> and <strong>signup-free</strong> login on your site, regardless of its connection to Telegram.</p> -<h4><a class="anchor" href="#widgets" id="widgets" name="widgets"><i class="anchor-icon"></i></a>Widgets</h4> +<h4><a class="anchor" name="widgets" href="#widgets"><i class="anchor-icon"></i></a>Widgets</h4> <p>The Telegram login widget is a <strong>simple and secure way to authorize users</strong> on your website.</p> <ol> <li>Choose a bot – ideally its name and profile pic <strong>should match</strong> the website title and logo.</li> <li>Use the <code>/setdomain</code> command in <a href="https://t.me/botfather">@BotFather</a> to pair the bot with your website domain. </li> <li>Configure your widget using <a href="/widgets/login#widget-configuration">our dedicated tool</a> and embed it on your website.</li> </ol> -<h4><a class="anchor" href="#inline-login" id="inline-login" name="inline-login"><i class="anchor-icon"></i></a>Inline Login</h4> -<p>When users open your website via an <strong>inline button</strong>, you can use the <a href="/bots/api#loginurl">login_url</a> parameter as an alternative to login widgets. This way, you'll be able to <a href="https://telegram.org/blog/privacy-discussions-web-bots#meet-seamless-web-bots">seamlessly authorize</a> them on your website or app before the page even loads.</p> +<h4><a class="anchor" name="inline-login" href="#inline-login"><i class="anchor-icon"></i></a>Inline Login</h4> +<p>When users open your website via an <strong>inline button</strong>, you can use the <a href="/bots/api#loginurl">login_url</a> parameter as an alternative to login widgets. This way, you'll be able to <a href="https://telegram.org/blog/privacy-discussions-web-bots#meet-seamless-web-bots">seamlessly authorize</a> them on your website or app before the page even loads.</p> <div> - <a href="/file/464001287/105ea/23bO4ntH4tc.43741/c9624e36c3462b6540" target="_blank"><img src="/file/464001287/105ea/23bO4ntH4tc.43741/c9624e36c3462b6540" width="50%" title="Login Widget" class="dev_page_image"></a> + <a href="/file/464001287/105ea/23bO4ntH4tc.43741/c9624e36c3462b6540" target="_blank"><img src="/file/464001287/105ea/23bO4ntH4tc.43741/c9624e36c3462b6540" width=50% title="Login Widget" class="dev_page_image" /></a> </div> + <blockquote> <p>Make sure to review our <a href="/widgets/login#checking-authorization">guide</a> on authenticating the received data as well as our <a href="https://gist.github.com/anonymous/6516521b1fb3b464534fbc30ea3573c2">sample code</a>.</p> </blockquote> -<h3><a class="anchor" href="#html5-games" id="html5-games" name="html5-games"><i class="anchor-icon"></i></a>HTML5 Games</h3> +<h3><a class="anchor" name="html5-games" href="#html5-games"><i class="anchor-icon"></i></a>HTML5 Games</h3> <p>Bots can serve as <strong>standalone gaming platforms</strong> – with our <a href="/bots/api#games">HTML5 Gaming API</a> you can develop multiplayer or single-player games and let your users have fun comparing <strong>ranks</strong>, <strong>scores</strong> and much more.</p> <p>To get started, follow these simple steps:</p> <ul> <li>Send the <code>/newgame</code> command to <a href="https://t.me/botfather">@BotFather</a></li> <li>Provide a <strong>description text</strong>, an <strong>image</strong> or an <strong>optional gif</strong> to showcase its gameplay</li> <li>Send the game to users via the <a href="/bots/api#sendgame">sendGame</a> method or via an <a href="/bots/api#inlinequeryresultgame">inline query</a></li> -<li>When someone wants to play, you'll receive the appropriate <code>game_short_name</code> in a <a href="/bots/api#callbackquery">CallbackQuery</a></li> +<li>When someone wants to play, you'll receive the appropriate <code>game_short_name</code> in a <a href="/bots/api#callbackquery">CallbackQuery</a></li> <li>To launch the game, provide the <strong>HTML5 Game URL</strong> as the <code>url</code> param of <a href="/bots/api#answercallbackquery">answerCallbackQuery</a></li> </ul> <p>Then, to handle <strong>highscores</strong>:</p> @@ -310,50 +317,49 @@ For this reason, disputes must be solved between the user, the bot developer and <li><a href="/bots/api#games">HTML5 Games Bot API Docs</a></li> </ul> <div> - <a href="/file/464001558/11b92/y_Fu9QQWtj0.141959/dc9db48f66800bf271" target="_blank"><img src="/file/464001558/11b92/y_Fu9QQWtj0.141959/dc9db48f66800bf271" title="Games" width="50%" class="dev_page_image"></a> + <a href="/file/464001558/11b92/y_Fu9QQWtj0.141959/dc9db48f66800bf271" target="_blank"><img src="/file/464001558/11b92/y_Fu9QQWtj0.141959/dc9db48f66800bf271" title="Games" width=50% class="dev_page_image" /></a> </div> + <blockquote> <p>Check out <a href="https://t.me/gamebot">@GameBot</a> and <a href="https://t.me/gamee">@gamee</a> for examples of what you can do using our Gaming Platform.</p> </blockquote> -<h3><a class="anchor" href="#stickers-and-custom-emoji" id="stickers-and-custom-emoji" name="stickers-and-custom-emoji"><i class="anchor-icon"></i></a>Stickers and Custom Emoji</h3> +<h3><a class="anchor" name="stickers-and-custom-emoji" href="#stickers-and-custom-emoji"><i class="anchor-icon"></i></a>Stickers and Custom Emoji</h3> <p><a href="https://core.telegram.org/stickers">Stickers</a> and <a href="https://telegram.org/blog/custom-emoji">Custom Emoji</a> are a distinctive Telegram feature used by millions of users to share artwork every day. Stickers and custom emoji take many forms – ranging from <strong>basic images</strong> to smooth <strong>vector animations</strong> and high-detail <strong>.WEBM videos</strong>.</p> -<p>All these formats are supported by our <a href="api#stickers">Bot API</a>, which allows bots to <strong>create</strong>, <strong>edit</strong>, <strong>delete</strong> and <strong>share</strong> new artwork packs on the fly. Telegram's <a href="https://core.telegram.org/import-stickers">Import API</a> lets users <strong>migrate packs</strong> from other platforms and sticker apps.</p> -<p><strong>Creating a new pack</strong> -To create a <strong>new pack</strong>, simply:</p> +<p>All these formats are supported by our <a href="api#stickers">Bot API</a>, which allows bots to <strong>create</strong>, <strong>edit</strong>, <strong>delete</strong> and <strong>share</strong> new artwork packs on the fly. Telegram's <a href="https://core.telegram.org/import-stickers">Import API</a> lets users <strong>migrate packs</strong> from other platforms and sticker apps.</p> +<p><strong>Creating a new pack</strong><br>To create a <strong>new pack</strong>, simply:</p> <ul> <li><strong>Prepare</strong> your artwork following our <a href="https://core.telegram.org/stickers">technical requirements</a>.</li> <li><strong>Create</strong> a new sticker pack via <a href="api#createnewstickerset">createStickerSet</a>. Set <code>sticker_type</code> to <em>regular</em> to create a sticker pack or to <em>custom emoji</em> to create a pack of custom emoji. Attach the <a href="api#file">files</a> you wish to include in the pack as an array of <a href="https://core.telegram.org/bots#inputsticker">InputSticker</a></li> <li>You can use <a href="api#addstickertoset">addStickerToSet</a> to add stickers or emoji later on.</li> </ul> -<p><strong>Additional features</strong> -Regular stickers and custom emoji support <strong>keywords</strong> that users can type to quickly find the respective artwork – this can be useful when a sticker doesn't have obvious ties to a specific emoji. You can use the <code>keywords</code> parameter in <a href="https://core.telegram.org/bots#inputsticker">InputSticker</a> to specify them.</p> +<p><strong>Additional features</strong><br>Regular stickers and custom emoji support <strong>keywords</strong> that users can type to quickly find the respective artwork – this can be useful when a sticker doesn't have obvious ties to a specific emoji. You can use the <code>keywords</code> parameter in <a href="https://core.telegram.org/bots#inputsticker">InputSticker</a> to specify them.</p> <p>Custom emoji additionally support <strong>adaptive colors</strong> – they will always match the current context (e.g., white on photos, accent color when used as status, etc.); to enable this feature, use the <code>needs_repainting</code> parameter in <a href="api#createnewstickerset">createStickerSet</a>.</p> -<p>Once you're done creating and sharing your artwork, don't forget to check out our <a href="api#stickers">remaining sticker methods</a> to find out how to <a href="api#setstickersetthumb">edit</a>, <a href="api#deletestickerfromset">delete</a> and even <a href="api#setstickerpositioninset">reorder</a> your pack. </p> +<p>Once you're done creating and sharing your artwork, don't forget to check out our <a href="api#stickers">remaining sticker methods</a> to find out how to <a href="api#setstickersetthumb">edit</a>, <a href="api#deletestickerfromset">delete</a> and even <a href="api#setstickerpositioninset">reorder</a> your pack. </p> <blockquote> <p>Note that these methods will only work on packs <strong>created by the bot that is calling them</strong>.</p> </blockquote> -<h3><a class="anchor" href="#language-support" id="language-support" name="language-support"><i class="anchor-icon"></i></a>Language Support</h3> +<h3><a class="anchor" name="language-support" href="#language-support"><i class="anchor-icon"></i></a>Language Support</h3> <p>Bots can tailor their interfaces to <strong>support multiple languages</strong> – updating inputs and information on the fly. A user’s <a href="/bots/api#user">language_code</a> is included in every relevant <a href="/bots/api#update">update</a> as an <a href="https://en.wikipedia.org/wiki/IETF_language_tag">IETF language tag</a>, allowing bots to adapt accordingly. </p> <p>We recommend that you follow our guidelines to provide <strong>the best user experience</strong>.</p> <ul> <li>Your interfaces, texts and <a href="/bots/api#answerinlinequery">inline results</a> should adapt seamlessly to the <em>language_code</em>, without user intervention.</li> -<li>Connected <a href="/bots/webapps">WebApps</a> will receive the user's <em>language_code</em> – your HTML page should account for it.</li> -<li><a href="/bots/games">HTML5 Games</a> can obtain language information if you specify it as a <a href="/bots/games#using-url-parameters">URL parameter</a>. You can generate this parameter from the <em>language_code</em> field in the <a href="/bots/api#user">User</a> object served with the initial game <a href="/bots/api#callbackquery">CallbackQuery</a>.</li> -<li>The bot's <strong>Name</strong>, <strong>Description</strong> and <strong>About text</strong> can be natively localized with the respective <a href="https://core.telegram.org/bots/api#setmydescription">methods</a>.</li> +<li>Connected <a href="/bots/webapps">WebApps</a> will receive the user's <em>language_code</em> – your HTML page should account for it.</li> +<li><a href="/bots/html5-games">HTML5 Games</a> can obtain language information if you specify it as a <a href="/bots/games#using-url-parameters">URL parameter</a>. You can generate this parameter from the <em>language_code</em> field in the <a href="/bots/api#user">User</a> object served with the initial game <a href="/bots/api#callbackquery">CallbackQuery</a>.</li> +<li>The bot's <strong>Name</strong>, <strong>Description</strong> and <strong>About text</strong> can be natively localized with the respective <a href="https://core.telegram.org/bots/api#setmydescription">methods</a>.</li> <li>Command lists can also be specified for individual languages – more on this <a href="#commands">here</a>.</li> </ul> <div class="blog_video_player_wrap" style="max-width: 400px; margin: 20px auto 20px;"> <video class="blog_video_player tl_blog_vid_autoplay" onclick="videoTogglePlay(this)" autoplay="" loop="" controls="" muted="" poster="/file/464001822/10cd0/EvtvjnhA-kA.132475/e285952b505535d85a" style="max-width: 400px;" title="Language Support" alt="Video: Language Support"> <source src="/file/464001083/105cd/NF4ViAHfTJc.3601652.mp4/0fd787953c11a6371d" type="video/mp4"> - </source></video> + </video> </div> + <blockquote> -<p>The <em>language_code</em> is an <strong>optional field</strong> – it could be empty. -If you target the general public, your code should always fall back to either the last recorded language tag or English (in this order) when the field is missing for a specific user. </p> +<p>The <em>language_code</em> is an <strong>optional field</strong> – it could be empty.<br>If you target the general public, your code should always fall back to either the last recorded language tag or English (in this order) when the field is missing for a specific user. </p> </blockquote> <hr> -<h3><a class="anchor" href="#bot-management" id="bot-management" name="bot-management"><i class="anchor-icon"></i></a>Bot Management</h3> -<h4><a class="anchor" href="#privacy-mode" id="privacy-mode" name="privacy-mode"><i class="anchor-icon"></i></a>Privacy Mode</h4> +<h3><a class="anchor" name="bot-management" href="#bot-management"><i class="anchor-icon"></i></a>Bot Management</h3> +<h4><a class="anchor" name="privacy-mode" href="#privacy-mode"><i class="anchor-icon"></i></a>Privacy Mode</h4> <p>Bots are frequently added to groups to perform basic tasks or assist moderators – like automatically posting company announcements or even celebrating birthdays. By default, <strong>all bots</strong> added to groups run in Privacy Mode and only see relevant messages and commands:</p> <ul> <li>Commands explicitly meant for them (e.g., <code>/command@this_bot</code>).</li> @@ -367,20 +373,21 @@ If you target the general public, your code should always fall back to either th <li>All messages from private chats.</li> <li>All messages from channels where they are a member.</li> </ul> -<p>Privacy mode is <strong>enabled by default</strong> for all bots, except bots that were added to a group as admins (bot admins always receive <strong>all messages</strong>). It can be disabled so that the bot receives all messages like an ordinary user (the bot will need to be re-added to the group for this change to take effect). We only recommend doing this in cases where it is <strong>absolutely necessary</strong> for your bot to work. In most cases, using the force reply option for the bot's messages should be more than enough.</p> +<p>Privacy mode is <strong>enabled by default</strong> for all bots, except bots that were added to a group as admins (bot admins always receive <strong>all messages</strong>). It can be disabled so that the bot receives all messages like an ordinary user (the bot will need to be re-added to the group for this change to take effect). We only recommend doing this in cases where it is <strong>absolutely necessary</strong> for your bot to work. In most cases, using the force reply option for the bot's messages should be more than enough.</p> <div> - <a href="/file/464001338/107af/JdbERa0BATg.62371/28977e9a96aed3860a" target="_blank"><img src="/file/464001338/107af/JdbERa0BATg.62371/28977e9a96aed3860a" title="Privacy Mode" class="dev_page_image" width="50%/"></a> + <a href="/file/464001338/107af/JdbERa0BATg.62371/28977e9a96aed3860a" target="_blank"><img src="/file/464001338/107af/JdbERa0BATg.62371/28977e9a96aed3860a" title="Privacy Mode" class="dev_page_image" width=50%/></a> </div> + <blockquote> <p>This mode not only increases user privacy, but also makes the bot more efficient by reducing the number of inputs it needs to process. Users can always see a bot’s current privacy setting in the list of group members.</p> </blockquote> -<h3><a class="anchor" href="#testing-your-bot" id="testing-your-bot" name="testing-your-bot"><i class="anchor-icon"></i></a>Testing your bot</h3> +<h3><a class="anchor" name="testing-your-bot" href="#testing-your-bot"><i class="anchor-icon"></i></a>Testing your bot</h3> <p>You can quickly test your bot <strong>without interfering</strong> with its users by simply running another instance of your code on a different bot account. To do so, create a <em>new bot</em> via <a href="https://t.me/botfather">@BotFather</a>, obtain its token and use it in the testing instance of your code.</p> <p>All further testing and debugging can happen privately on the new bot, without affecting the original instance.</p> <blockquote> <p>If you need to share file references across bots, note that the <code>file_id</code> field is tied to a single bot id, so your test instance cannot use a shared <code>file_id</code> database to quickly send media – files must be individually reuploaded.</p> </blockquote> -<h4><a class="anchor" href="#dedicated-test-environment" id="dedicated-test-environment" name="dedicated-test-environment"><i class="anchor-icon"></i></a>Dedicated test environment</h4> +<h4><a class="anchor" name="dedicated-test-environment" href="#dedicated-test-environment"><i class="anchor-icon"></i></a>Dedicated test environment</h4> <p>Telegram also offers a dedicated <strong>test environment</strong> suitable for more advanced testing. Bots and users in this environment generally have more flexible restrictions – for example:</p> <ul> <li>When working with the test environment, you may use HTTP links without TLS to test your <a href="https://core.telegram.org/bots/features#web-apps">Web Apps</a> or <a href="https://core.telegram.org/bots/features#web-login">Web Login</a>.</li> @@ -389,62 +396,55 @@ If you target the general public, your code should always fall back to either th <blockquote> <p><strong>Flood limits</strong> are not raised in the test environment, and may at times be stricter. To minimize how this impacts your bot, you should make sure that it handles errors with retry policies and does not depend on hardcoded limit values.</p> </blockquote> -<h4><a class="anchor" href="#creating-a-bot-in-the-test-environment" id="creating-a-bot-in-the-test-environment" name="creating-a-bot-in-the-test-environment"><i class="anchor-icon"></i></a>Creating a bot in the test environment</h4> +<h4><a class="anchor" name="creating-a-bot-in-the-test-environment" href="#creating-a-bot-in-the-test-environment"><i class="anchor-icon"></i></a>Creating a bot in the test environment</h4> <p>The test environment is <strong>completely separate</strong> from the main environment, so you will need to create a new user account and a new bot with <a href="https://t.me/botfather">@BotFather</a>.</p> <p>To create an account and log in, use either of the following:</p> <ul> <li><strong>iOS</strong>: tap 10 times on the Settings icon > Accounts > Login to another account > Test.</li> -<li><strong>Telegram Desktop</strong>: open ☰ Settings > Shift + Alt + Right click 'Add Account' and select 'Test Server'.</li> -<li><strong>macOS</strong>: click the Settings icon 10 times to open the Debug Menu, ⌘ + click 'Add Account' and log in via phone number.</li> +<li><strong>Telegram Desktop</strong>: open ☰ Settings > Shift + Alt + Right click 'Add Account' and select 'Test Server'.</li> +<li><strong>macOS</strong>: click the Settings icon 10 times to open the Debug Menu, ⌘ + click 'Add Account' and log in via phone number.</li> </ul> <p>After logging in, simply <a href="#creating-a-new-bot">create a new bot</a> following the standard procedure and send your requests to the Test Bot API in this format:</p> <pre><code>https://api.telegram.org/bot<token>/test/METHOD_NAME</code></pre> <blockquote> <p>When working with the test environment, you may use HTTP links without TLS in the <code>url</code> field of both <a href="/bots/api#loginurl">LoginUrl</a> and <a href="/bots/api#webappinfo">WebAppInfo</a>.</p> </blockquote> -<h4><a class="anchor" href="#status-alerts" id="status-alerts" name="status-alerts"><i class="anchor-icon"></i></a>Status alerts</h4> +<h4><a class="anchor" name="status-alerts" href="#status-alerts"><i class="anchor-icon"></i></a>Status alerts</h4> <p>Millions choose Telegram for its speed. To best benefit users, your bot also <strong>needs to be responsive</strong>. In order to help developers keep their bots in shape, <a href="https://t.me/botfather">@BotFather</a> will send <strong>status alerts</strong> if it sees something is wrong.</p> <p>We check the number of replies and the <em>request/response</em> conversion rate for popular bots (~300 requests per minute, this value may change in the future). If your bot returns an <strong>abnormally low number</strong>, you will receive a notification from <a href="https://t.me/botfather">@BotFather</a>.</p> -<h5><a class="anchor" href="#responding-to-alerts" id="responding-to-alerts" name="responding-to-alerts"><i class="anchor-icon"></i></a>Responding to alerts</h5> +<h5><a class="anchor" name="responding-to-alerts" href="#responding-to-alerts"><i class="anchor-icon"></i></a>Responding to alerts</h5> <p>By default, <strong>you will only get one alert per bot per hour</strong>. </p> <p>Each alert has the following buttons:</p> <ul> <li><strong>Fixed</strong> - Use this if you found an issue with your bot and fixed it. If you press the fix button, we will resume sending alerts in the regular way so that you can see if your fix worked within 5-10 minutes instead of having to wait for an hour.</li> -<li><strong>Support</strong> - Use this to open a chat with <a href="https://t.me/botsupport">@BotSupport</a> if you don't see any issues with your bot or if you think the problem is on our side.</li> -<li><strong>Mute for 8h/1w</strong> - Use this if you can't fix your bot at the moment. This will disable all alerts for the bot in question for the specified period of time. <strong>We do not recommend</strong> using this option since your users may migrate to a more stable bot. You can unmute alerts in your bot's settings via <a href="https://t.me/botfather">@BotFather</a>.</li> +<li><strong>Support</strong> - Use this to open a chat with <a href="https://t.me/botsupport">@BotSupport</a> if you don't see any issues with your bot or if you think the problem is on our side.</li> +<li><strong>Mute for 8h/1w</strong> - Use this if you can't fix your bot at the moment. This will disable all alerts for the bot in question for the specified period of time. <strong>We do not recommend</strong> using this option since your users may migrate to a more stable bot. You can unmute alerts in your bot's settings via <a href="https://t.me/botfather">@BotFather</a>.</li> </ul> -<h5><a class="anchor" href="#monitored-issues" id="monitored-issues" name="monitored-issues"><i class="anchor-icon"></i></a>Monitored issues</h5> +<h5><a class="anchor" name="monitored-issues" href="#monitored-issues"><i class="anchor-icon"></i></a>Monitored issues</h5> <p>We currently notify you about the following issues:</p> <ul> -<li> -<p><strong>Too few private messages are sent.</strong> Value: <strong>{value}</strong> - Your bot is sending far fewer messages than it did in previous weeks. This is useful for newsletter-style bots that send messages without prompts from users. The larger the value, the more significant the difference.</p> +<li><p><strong>Too few private messages are sent.</strong> Value: <strong>{value}</strong> - Your bot is sending far fewer messages than it did in previous weeks. This is useful for newsletter-style bots that send messages without prompts from users. The larger the value, the more significant the difference.</p> </li> -<li> -<p><strong>Too few replies to incoming private messages</strong>. Conversion rate: <strong>{value}</strong> - Your bot is not replying to all messages that are being sent to it (the request/response conversion rate for your bot was too low for at least two of the last three 5-minute periods). </p> +<li><p><strong>Too few replies to incoming private messages</strong>. Conversion rate: <strong>{value}</strong> - Your bot is not replying to all messages that are being sent to it (the request/response conversion rate for your bot was too low for at least two of the last three 5-minute periods). </p> </li> </ul> <blockquote> <p>To provide a good user experience, please respond to all messages that are sent to your bot. Respond to message updates by calling send… methods (e.g. <a href="/bots/api#sendmessage">sendMessage</a>).</p> </blockquote> <ul> -<li> -<p><strong>Too few answers to inline queries</strong>. Conversion rate: <strong>{value}</strong> - Your bot is not replying to all inline queries that are being sent to it, calculated in the same way as above. Respond to <code>inline_query</code> updates by calling <a href="/bots/api#answerinlinequery">answerInlineQuery</a>.</p> -</li> -<li> -<p><strong>Too few answers to callback queries</strong>. Conversion rate: <strong>{value}</strong></p> -</li> -<li> -<p><strong>Too few answers to callback game queries</strong>. Conversion rate: <strong>{value}</strong> - Your bot is not replying to all callback queries that are being sent to it (with or without games), calculated in the same way as above. Respond to <code>callback_query</code> updates by calling <a href="/bots/api#answercallbackquery">answerCallbackQuery</a>.</p> -</li> +<li><strong>Too few answers to inline queries</strong>. Conversion rate: <strong>{value}</strong> - Your bot is not replying to all inline queries that are being sent to it, calculated in the same way as above. Respond to <code>inline_query</code> updates by calling <a href="/bots/api#answerinlinequery">answerInlineQuery</a>.</li> </ul> -<h4><a class="anchor" href="#local-bot-api" id="local-bot-api" name="local-bot-api"><i class="anchor-icon"></i></a>Local Bot API</h4> -<p>You can host and work with <strong>your own instance</strong> of our open-source <a href="/bots/api">Bot API</a>. -The <strong>source code</strong> is available <a href="https://github.com/tdlib/telegram-bot-api">here</a>, along with a quick <a href="https://github.com/tdlib/telegram-bot-api#installation">installation guide</a>.</p> +<ul> +<li><strong>Too few answers to callback queries</strong>. Conversion rate: <strong>{value}</strong></li> +<li><strong>Too few answers to callback game queries</strong>. Conversion rate: <strong>{value}</strong> - Your bot is not replying to all callback queries that are being sent to it (with or without games), calculated in the same way as above. Respond to <code>callback_query</code> updates by calling <a href="/bots/api#answercallbackquery">answerCallbackQuery</a>.</li> +</ul> +<h4><a class="anchor" name="local-bot-api" href="#local-bot-api"><i class="anchor-icon"></i></a>Local Bot API</h4> +<p>You can host and work with <strong>your own instance</strong> of our open-source <a href="/bots/api">Bot API</a>.<br>The <strong>source code</strong> is available <a href="https://github.com/tdlib/telegram-bot-api">here</a>, along with a quick <a href="https://github.com/tdlib/telegram-bot-api#installation">installation guide</a>.</p> <p>After <strong>installing the server</strong>, remember to use the <a href="/bots/api#logout">logOut</a> method before <strong>redirecting requests</strong> to your new local API URL.</p> <blockquote> <p>Your local instance runs on port <code>8081</code> by default and will only accept HTTP requests, so a TLS termination proxy has to be used to handle remote HTTPS requests.</p> </blockquote> -<p>By hosting our API locally you'll gain access to <strong>some upgrades</strong>, including:</p> +<p>By hosting our API locally you'll gain access to <strong>some upgrades</strong>, including:</p> <table class="table"> <thead> <tr> @@ -476,36 +476,31 @@ The <strong>source code</strong> is available <a href="https://github.com/tdlib/ </tbody> </table> <blockquote> -<p>You can find an exhaustive list <a href="/bots/api#using-a-local-bot-api-server">here</a>. -All limits may be subject to change in the future, so make sure to follow <a href="https://t.me/botnews">@BotNews</a>.</p> +<p>You can find an exhaustive list <a href="/bots/api#using-a-local-bot-api-server">here</a>.<br>All limits may be subject to change in the future, so make sure to follow <a href="https://t.me/botnews">@BotNews</a>.</p> </blockquote> <hr> -<h3><a class="anchor" href="#botfather" id="botfather" name="botfather"><i class="anchor-icon"></i></a>BotFather</h3> +<h3><a class="anchor" name="botfather" href="#botfather"><i class="anchor-icon"></i></a>BotFather</h3> <p>Below is a detailed guide to using <a href="https://t.me/botfather">@BotFather</a>, Telegram’s tool for <strong>creating</strong> and <strong>managing</strong> bots.</p> -<h4><a class="anchor" href="#creating-a-new-bot" id="creating-a-new-bot" name="creating-a-new-bot"><i class="anchor-icon"></i></a>Creating a new bot</h4> +<h4><a class="anchor" name="creating-a-new-bot" href="#creating-a-new-bot"><i class="anchor-icon"></i></a>Creating a new bot</h4> <p>Use the <code>/newbot</code> command to create a new bot. <a href="https://t.me/botfather">@BotFather</a> will ask you for a name and username, then generate an authentication token for your new bot.</p> <ul> -<li> -<p>The <strong>name</strong> of your bot is displayed in contact details and elsewhere.</p> +<li><p>The <strong>name</strong> of your bot is displayed in contact details and elsewhere.</p> </li> -<li> -<p>The <strong>username</strong> is a short name, used in search, mentions and t.me links. Usernames are 5-32 characters long and not case sensitive – but may only include Latin characters, numbers, and underscores. Your bot's username must end in 'bot’, like 'tetris_bot' or 'TetrisBot'.</p> +<li><p>The <strong>username</strong> is a short name, used in search, mentions and t.me links. Usernames are 5-32 characters long and not case sensitive – but may only include Latin characters, numbers, and underscores. Your bot's username must end in 'bot’, like 'tetris_bot' or 'TetrisBot'.</p> </li> -<li> -<p>The <strong>token</strong> is a string, like <code>110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw</code>, which is required to authorize the bot and send requests to the Bot API. Keep your token secure and store it safely, it can be used by anyone to control your bot. </p> +<li><p>The <strong>token</strong> is a string, like <code>110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw</code>, which is required to authorize the bot and send requests to the Bot API. Keep your token secure and store it safely, it can be used by anyone to control your bot. </p> </li> </ul> <blockquote> -<p>Unlike the bot’s name, the username cannot be changed later – so choose it carefully. -When sending a request to api.telegram.org, remember to prefix the word ‘bot’ to your token.</p> +<p>Unlike the bot’s name, the username cannot be changed later – so choose it carefully.<br>When sending a request to api.telegram.org, remember to prefix the word ‘bot’ to your token.</p> </blockquote> -<h4><a class="anchor" href="#about-text-description-and-profile-media" id="about-text-description-and-profile-media" name="about-text-description-and-profile-media"><i class="anchor-icon"></i></a>About text, description and profile media</h4> -<p>When new users open your bot, they will be met with a helpful description in a box titled "What can this bot do?".</p> +<h4><a class="anchor" name="about-text-description-and-profile-media" href="#about-text-description-and-profile-media"><i class="anchor-icon"></i></a>About text, description and profile media</h4> +<p>When new users open your bot, they will be met with a helpful description in a box titled “What can this bot do?”.</p> <p>Properly <a href="#edit-bots">setting this field</a> in <a href="https://t.me/botfather">@BotFather</a> allows everyone to immediately get an idea of what your bot can do – your description should be <strong>brief</strong>, <strong>to the point</strong> and <strong>on topic</strong>.</p> <blockquote> <p>You can also add a photo or video to this field with <code>Edit Description Picture</code> in <a href="https://t.me/botfather">@BotFather</a>.</p> </blockquote> -<p>Additionally, just like normal users, bots also come with a <strong>short bio</strong> available on their profile. If you didn't specify this field while first creating your bot, you can set it at any time with the <code>/setabouttext</code> command in <a href="https://t.me/botfather">@BotFather</a>. Users can interact with many bots and they won't have access to their description after starting them – having a quick reminder of the bot's purpose can be very useful.</p> +<p>Additionally, just like normal users, bots also come with a <strong>short bio</strong> available on their profile. If you didn't specify this field while first creating your bot, you can set it at any time with the <code>/setabouttext</code> command in <a href="https://t.me/botfather">@BotFather</a>. Users can interact with many bots and they won't have access to their description after starting them – having a quick reminder of the bot's purpose can be very useful.</p> <blockquote> <p>Note that both the <strong>Description</strong> and the <strong>About text</strong> can be <a href="https://core.telegram.org/bots/api#setmydescription">natively localized</a> – each user will automatically see the correct translation for their language.</p> </blockquote> @@ -513,38 +508,36 @@ When sending a request to api.telegram.org, remember to prefix the word ‘bot <blockquote> <p>Starting from April 21, 2023 (<a href="https://telegram.org/blog/shareable-folders-custom-wallpapers">Telegram 9.6</a>), you can edit your bot directly from its profile page – including setting a custom <strong>profile video</strong>.</p> </blockquote> -<h4><a class="anchor" href="#generating-an-authentication-token" id="generating-an-authentication-token" name="generating-an-authentication-token"><i class="anchor-icon"></i></a>Generating an authentication token</h4> +<h4><a class="anchor" name="generating-an-authentication-token" href="#generating-an-authentication-token"><i class="anchor-icon"></i></a>Generating an authentication token</h4> <p>If your existing token is <strong>compromised</strong> or <strong>you lost it</strong> for some reason, use the <code>/token</code> command to generate a new one.</p> -<h4><a class="anchor" href="#transfer-ownership" id="transfer-ownership" name="transfer-ownership"><i class="anchor-icon"></i></a>Transfer ownership</h4> -<p>You can transfer ownership of your bot <strong>to another user</strong>. -To do this, send <code>/mybots</code>, select your bot, then <em>transfer ownership</em>. -You can only transfer a bot to users who have interacted with it at least once.</p> +<h4><a class="anchor" name="transfer-ownership" href="#transfer-ownership"><i class="anchor-icon"></i></a>Transfer ownership</h4> +<p>You can transfer ownership of your bot <strong>to another user</strong>.<br>To do this, send <code>/mybots</code>, select your bot, then <em>transfer ownership</em>.<br>You can only transfer a bot to users who have interacted with it at least once.</p> <blockquote> <p>Transferring ownership will give full control of the bot to another user – they will be able to access the bot’s messages and even delete it. The transfer is permanent, so please consider it carefully.</p> </blockquote> -<h4><a class="anchor" href="#botfather-commands" id="botfather-commands" name="botfather-commands"><i class="anchor-icon"></i></a>BotFather commands</h4> +<h4><a class="anchor" name="botfather-commands" href="#botfather-commands"><i class="anchor-icon"></i></a>BotFather commands</h4> <p>The remaining commands are pretty self-explanatory:</p> <ul> <li>/mybots – returns a list of your bots with handy controls to edit their settings.</li> <li>/mygames – does the same for your games.</li> </ul> -<h4><a class="anchor" href="#edit-bots" id="edit-bots" name="edit-bots"><i class="anchor-icon"></i></a>Edit bots</h4> +<h4><a class="anchor" name="edit-bots" href="#edit-bots"><i class="anchor-icon"></i></a>Edit bots</h4> <p>To edit your bot, you have two options.</p> <p>You can use the available commands:</p> <ul> -<li>/setname – change your bot's <strong>name</strong>.</li> -<li>/setdescription – change the bot's <strong>description</strong> (short text up to 512 characters). Users will see this text at the beginning of the conversation with the bot, titled '<em>What can this bot do?</em>'.</li> -<li>/setabouttext – change the bot's <strong>about info</strong>, a shorter text up to 120 characters. Users will see this text on the bot's profile page. When they share your bot with someone, this text is sent together with the link.</li> -<li>/setuserpic – change the bot's <strong>profile picture</strong>. </li> +<li>/setname – change your bot's <strong>name</strong>.</li> +<li>/setdescription – change the bot's <strong>description</strong> (short text up to 512 characters). Users will see this text at the beginning of the conversation with the bot, titled '<em>What can this bot do?</em>'.</li> +<li>/setabouttext – change the bot's <strong>about info</strong>, a shorter text up to 120 characters. Users will see this text on the bot's profile page. When they share your bot with someone, this text is sent together with the link.</li> +<li>/setuserpic – change the bot's <strong>profile picture</strong>. </li> <li>/setcommands – change the list of <strong>commands</strong> supported by your bot. Users will see these commands as suggestions when they type <code>/</code> in the chat with your bot. See <a href="#commands">commands</a> for more info.</li> -<li>/setdomain – link a <strong>website domain</strong> to your bot. See the <a href="#web-login">login widget</a> section.</li> +<li>/setdomain – link a <strong>website domain</strong> to your bot. See the <a href="#login-widget">login widget</a> section.</li> <li>/deletebot – delete your bot and <strong>free its username</strong>. Cannot be undone.</li> </ul> <p>Or you can use the <code>/mybots</code> command, tap on your bot and use the modern inline interface to edit it.</p> <blockquote> -<p>Starting from April 21, 2023 (<a href="https://telegram.org/blog/shareable-folders-custom-wallpapers">Telegram 9.6</a>), you can edit your bot's public-facing info directly from its profile page – including setting a custom <strong>profile video</strong>.</p> +<p>Starting from April 21, 2023 (<a href="https://telegram.org/blog/shareable-folders-custom-wallpapers">Telegram 9.6</a>), you can edit your bot's public-facing info directly from its profile page – including setting a custom <strong>profile video</strong>.</p> </blockquote> -<h4><a class="anchor" href="#edit-settings" id="edit-settings" name="edit-settings"><i class="anchor-icon"></i></a>Edit settings</h4> +<h4><a class="anchor" name="edit-settings" href="#edit-settings"><i class="anchor-icon"></i></a>Edit settings</h4> <ul> <li>/setinline – toggle <strong>inline mode</strong> for your bot.</li> <li>/setinlinegeo – request <strong>location data</strong> to provide location-based inline results.</li> @@ -552,7 +545,7 @@ You can only transfer a bot to users who have interacted with it at least once.< <li>/setinlinefeedback – toggle whether the API should <strong>send updates about the results</strong> chosen by users. See an in-depth explanation <a href="/bots/inline#collecting-feedback">here</a>.</li> <li>/setprivacy – set which messages your bot will receive when added to a group. See <a href="#privacy-mode">privacy-mode</a> for more info.</li> </ul> -<h4><a class="anchor" href="#manage-games" id="manage-games" name="manage-games"><i class="anchor-icon"></i></a>Manage games</h4> +<h4><a class="anchor" name="manage-games" href="#manage-games"><i class="anchor-icon"></i></a>Manage games</h4> <ul> <li>/newgame – create a new game.</li> <li>/listgames – see a list of your games.</li> @@ -566,8 +559,9 @@ You can only transfer a bot to users who have interacted with it at least once.< <p>With this information, you are ready to proceed to our <a href="/bots/api">Full API Reference for Developers</a>.</p> <ul> <li>If you have any questions, check out our <a href="/bots/faq">Bot FAQ</a>.</li> -<li>If you're experiencing issues with our API, please contact <a href="https://t.me/botsupport">@BotSupport</a> on Telegram.</li> -</ul></div> +<li>If you're experiencing issues with our API, please contact <a href="https://t.me/botsupport">@BotSupport</a> on Telegram.</li> +</ul> +</div> </div> diff --git a/data/web/corefork.telegram.org/bots/samples.html b/data/web/corefork.telegram.org/bots/samples.html index d4a862e987..9a30b409d3 100644 --- a/data/web/corefork.telegram.org/bots/samples.html +++ b/data/web/corefork.telegram.org/bots/samples.html @@ -47,369 +47,208 @@ </blockquote> <p>This page lists some libraries and frameworks <strong>developed by the Telegram community</strong> – you should take care to report any bugs you may find to the respective developers, as these projects are not maintained by Telegram.</p> <p>Ping us on <a href="https://telegram.me/botsupport">@BotSupport</a> if you would like your library to appear on this page.</p> -<h4><a class="anchor" href="#php" id="php" name="php"><i class="anchor-icon"></i></a>PHP</h4> +<h4><a class="anchor" name="php" href="#php"><i class="anchor-icon"></i></a>PHP</h4> <ul> -<li> -<p><strong>Nutgram</strong>. The Telegram bot framework that doesn't drive you nuts. -<a href="https://github.com/nutgram/nutgram">https://github.com/nutgram/nutgram</a></p> +<li><p><strong>Nutgram</strong>. The Telegram bot framework that doesn't drive you nuts.<br><a href="https://github.com/nutgram/nutgram">https://github.com/nutgram/nutgram</a></p> </li> -<li> -<p><strong>klev-o/telegram-bot-api</strong>. Simple and convenient object-oriented implementation Telegram Bot API with PHP version ^7.4 support. -<a href="https://github.com/klev-o/telegram-bot-api">https://github.com/klev-o/telegram-bot-api</a></p> +<li><p><strong>klev-o/telegram-bot-api</strong>. Simple and convenient object-oriented implementation Telegram Bot API with PHP version ^7.4 support.<br><a href="https://github.com/klev-o/telegram-bot-api">https://github.com/klev-o/telegram-bot-api</a></p> </li> -<li> -<p><strong>Telegraph</strong>. A Laravel package for fluently interacting with Telegram Bots. -<a href="https://github.com/def-studio/telegraph">https://github.com/def-studio/telegraph</a></p> +<li><p><strong>Telegraph</strong>. A Laravel package for fluently interacting with Telegram Bots.<br><a href="https://github.com/def-studio/telegraph">https://github.com/def-studio/telegraph</a></p> </li> -<li> -<p><strong>TeleBot</strong>. Easy way to create Telegram bots in PHP. Rich Laravel support out of the box. -<a href="https://github.com/westacks/telebot">https://github.com/westacks/telebot</a></p> +<li><p><strong>TeleBot</strong>. Easy way to create Telegram bots in PHP. Rich Laravel support out of the box.<br><a href="https://github.com/westacks/telebot">https://github.com/westacks/telebot</a></p> </li> -<li> -<p><strong>TuriBot</strong>. A simple way to communicate with Telegram APIs in PHP. -<a href="https://github.com/davtur19/TuriBot">https://github.com/davtur19/TuriBot</a></p> +<li><p><strong>TuriBot</strong>. A simple way to communicate with Telegram APIs in PHP.<br><a href="https://github.com/davtur19/TuriBot">https://github.com/davtur19/TuriBot</a></p> </li> -<li> -<p><strong>TelegramBotsApi</strong>. SDK for Telegram Bot API. -<a href="https://github.com/kuvardin/TelegramBotsApi">https://github.com/kuvardin/TelegramBotsApi</a></p> +<li><p><strong>TelegramBotsApi</strong>. SDK for Telegram Bot API.<br><a href="https://github.com/kuvardin/TelegramBotsApi">https://github.com/kuvardin/TelegramBotsApi</a></p> </li> -<li> -<p><strong>PHP Telegram Bot</strong>. PHP Telegram Bot based on the official Telegram Bot API. -<a href="https://github.com/php-telegram-bot/core">https://github.com/php-telegram-bot/core</a></p> +<li><p><strong>PHP Telegram Bot</strong>. PHP Telegram Bot based on the official Telegram Bot API.<br><a href="https://github.com/php-telegram-bot/core">https://github.com/php-telegram-bot/core</a></p> </li> -<li> -<p><strong>Telegram Bot PHP</strong>. A library that makes using Telegram Bot API much easier. -<a href="https://github.com/telegram-bot-php/core">https://github.com/telegram-bot-php/core</a></p> +<li><p><strong>Telegram Bot PHP</strong>. A library that makes using Telegram Bot API much easier.<br><a href="https://github.com/telegram-bot-php/core">https://github.com/telegram-bot-php/core</a></p> </li> -<li> -<p><strong>PHP Telegram API</strong>. A complete async capable Telegram Bot API implementation for PHP7. -<a href="https://github.com/unreal4u/telegram-api">https://github.com/unreal4u/telegram-api</a></p> +<li><p><strong>PHP Telegram API</strong>. A complete async capable Telegram Bot API implementation for PHP7.<br><a href="https://github.com/unreal4u/telegram-api">https://github.com/unreal4u/telegram-api</a></p> </li> -<li> -<p><strong>Telegram Bot Api Base</strong>. Clear and simple Telegram Bot API. -<a href="https://github.com/tg-bot-api/bot-api-base">https://github.com/tg-bot-api/bot-api-base</a></p> +<li><p><strong>Telegram Bot Api Base</strong>. Clear and simple Telegram Bot API.<br><a href="https://github.com/tg-bot-api/bot-api-base">https://github.com/tg-bot-api/bot-api-base</a></p> </li> -<li> -<p><strong>NeleBot X Framework</strong>. Framework for Telegram Bot API. -<a href="https://github.com/NeleB54Gold/NeleBotX">https://github.com/NeleB54Gold/NeleBotX</a></p> +<li><p><strong>NeleBot X Framework</strong>. Framework for Telegram Bot API.<br><a href="https://github.com/NeleB54Gold/NeleBotX">https://github.com/NeleB54Gold/NeleBotX</a></p> </li> -<li> -<p><strong>Bot API PHP SDK</strong>. Telegram Bot API PHP SDK. Supports Laravel out of the box. -<a href="https://github.com/irazasyed/telegram-bot-sdk">https://github.com/irazasyed/telegram-bot-sdk</a></p> +<li><p><strong>Bot API PHP SDK</strong>. Telegram Bot API PHP SDK. Supports Laravel out of the box.<br><a href="https://github.com/irazasyed/telegram-bot-sdk">https://github.com/irazasyed/telegram-bot-sdk</a></p> </li> -<li> -<p><strong>TgBotLib</strong>. A library for creating Telegram Bots in PHP, based on the Telegram Bot API. -<a href="https://git.n64.cc/nosial/libs/tgbot">https://git.n64.cc/nosial/libs/tgbot</a></p> +<li><p><strong>TgBotLib</strong>. A library for creating Telegram Bots in PHP, based on the Telegram Bot API.<br><a href="https://git.n64.cc/nosial/libs/tgbot">https://git.n64.cc/nosial/libs/tgbot</a></p> </li> -<li> -<p><strong>PHP Telegram Bot Api</strong>. Native PHP Wrapper for Telegram BOT API. -<a href="https://github.com/TelegramBot/Api">https://github.com/TelegramBot/Api</a></p> +<li><p><strong>PHP Telegram Bot Api</strong>. Native PHP Wrapper for Telegram BOT API.<br><a href="https://github.com/TelegramBot/Api">https://github.com/TelegramBot/Api</a></p> </li> -<li> -<p><strong>NovaGram</strong>. An Object-Oriented PHP library for Telegram Bots. -<a href="https://github.com/skrtdev/NovaGram">https://github.com/skrtdev/NovaGram</a></p> +<li><p><strong>NovaGram</strong>. An Object-Oriented PHP library for Telegram Bots.<br><a href="https://github.com/skrtdev/NovaGram">https://github.com/skrtdev/NovaGram</a></p> </li> </ul> -<h4><a class="anchor" href="#go" id="go" name="go"><i class="anchor-icon"></i></a>Go</h4> +<h4><a class="anchor" name="go" href="#go"><i class="anchor-icon"></i></a>Go</h4> <ul> -<li> -<p><strong>Golang Telegram Bot library</strong>. An autogenerated wrapper for the Telegram Bot API. Inspired by the python-telegram-bot library. -<a href="https://github.com/paulsonoflars/gotgbot">https://github.com/paulsonoflars/gotgbot</a></p> +<li><p><strong>Golang Telegram Bot library</strong>. An autogenerated wrapper for the Telegram Bot API. Inspired by the python-telegram-bot library.<br><a href="https://github.com/paulsonoflars/gotgbot">https://github.com/paulsonoflars/gotgbot</a></p> </li> -<li> -<p><strong>Telego</strong>. Telegram Bot API library. -<a href="https://github.com/mymmrac/telego">https://github.com/mymmrac/telego</a></p> +<li><p><strong>Telego</strong>. Telegram Bot API library.<br><a href="https://github.com/mymmrac/telego">https://github.com/mymmrac/telego</a></p> </li> -<li> -<p><strong>Golang Telegram Bot</strong>. Telegram Bot API Go framework. -<a href="https://github.com/go-telegram/bot">https://github.com/go-telegram/bot</a></p> +<li><p><strong>Golang Telegram Bot</strong>. Telegram Bot API Go framework.<br><a href="https://github.com/go-telegram/bot">https://github.com/go-telegram/bot</a></p> </li> -<li> -<p><strong>echotron</strong>. An elegant and concurrent library for the Telegram Bot API. -<a href="https://github.com/NicoNex/echotron">https://github.com/NicoNex/echotron</a></p> +<li><p><strong>echotron</strong>. An elegant and concurrent library for the Telegram Bot API.<br><a href="https://github.com/NicoNex/echotron">https://github.com/NicoNex/echotron</a></p> </li> -<li> -<p><strong>Telegram Bot API helper for Golang</strong>. A Telegram Bot API wrapper. -<a href="https://github.com/meinside/telegram-bot-go">https://github.com/meinside/telegram-bot-go</a></p> +<li><p><strong>Telegram Bot API helper for Golang</strong>. A Telegram Bot API wrapper.<br><a href="https://github.com/meinside/telegram-bot-go">https://github.com/meinside/telegram-bot-go</a></p> </li> -<li> -<p><strong>telebot</strong>. A Telegram bot framework. -<a href="https://github.com/tucnak/telebot">https://github.com/tucnak/telebot</a></p> +<li><p><strong>telebot</strong>. A Telegram bot framework.<br><a href="https://github.com/tucnak/telebot">https://github.com/tucnak/telebot</a></p> </li> -<li> -<p><strong>Telegram Bot API client for Golang</strong>. Telegram Bot API client library for golang. -<a href="https://github.com/udev-21/ya-golang-tbot-api">https://github.com/udev-21/ya-golang-tbot-api</a></p> +<li><p><strong>Telegram Bot API client for Golang</strong>. Telegram Bot API client library for golang.<br><a href="https://github.com/udev-21/ya-golang-tbot-api">https://github.com/udev-21/ya-golang-tbot-api</a></p> </li> -<li> -<p><strong>go-tg</strong>. Library for accessing Telegram Bot API, with batteries for building complex bots included. -<a href="https://github.com/mr-linch/go-tg">https://github.com/mr-linch/go-tg</a></p> +<li><p><strong>go-tg</strong>. Library for accessing Telegram Bot API, with batteries for building complex bots included.<br><a href="https://github.com/mr-linch/go-tg">https://github.com/mr-linch/go-tg</a></p> </li> -<li> -<p><strong>Telegram Bot API: Go implementation</strong>. A Telegram IM bots API implementation. -<a href="https://github.com/temoon/telegram-bots-api">https://github.com/temoon/telegram-bots-api</a></p> +<li><p><strong>Telegram Bot API: Go implementation</strong>. A Telegram IM bots API implementation.<br><a href="https://github.com/temoon/telegram-bots-api">https://github.com/temoon/telegram-bots-api</a></p> </li> -<li> -<p><strong>Telegrambot</strong>. Telegram Bot API in Go, but with more clean code. -<a href="https://github.com/nickname76/telegrambot">https://github.com/nickname76/telegrambot</a></p> +<li><p><strong>Telegrambot</strong>. Telegram Bot API in Go, but with more clean code.<br><a href="https://github.com/nickname76/telegrambot">https://github.com/nickname76/telegrambot</a></p> </li> -<li> -<p><strong>go-telegram-bot-api</strong>. Bindings for the Telegram Bot API. -<a href="https://github.com/go-telegram-bot-api/telegram-bot-api">https://github.com/go-telegram-bot-api/telegram-bot-api</a></p> +<li><p><strong>go-telegram-bot-api</strong>. Bindings for the Telegram Bot API.<br><a href="https://github.com/go-telegram-bot-api/telegram-bot-api">https://github.com/go-telegram-bot-api/telegram-bot-api</a></p> </li> -<li> -<p><strong>TgWrap</strong>. A library with Telegram Bot API bindings. -<a href="https://github.com/rogozhka/tgwrap">https://github.com/rogozhka/tgwrap</a></p> +<li><p><strong>TgWrap</strong>. A library with Telegram Bot API bindings.<br><a href="https://github.com/rogozhka/tgwrap">https://github.com/rogozhka/tgwrap</a></p> </li> </ul> -<h4><a class="anchor" href="#python" id="python" name="python"><i class="anchor-icon"></i></a>Python</h4> +<h4><a class="anchor" name="python" href="#python"><i class="anchor-icon"></i></a>Python</h4> <ul> -<li> -<p><strong>python-telegram-bot</strong>. A wrapper you can't refuse. -<a href="https://github.com/python-telegram-bot/python-telegram-bot">https://github.com/python-telegram-bot/python-telegram-bot</a></p> +<li><p><strong>python-telegram-bot</strong>. A wrapper you can't refuse.<br><a href="https://github.com/python-telegram-bot/python-telegram-bot">https://github.com/python-telegram-bot/python-telegram-bot</a></p> </li> -<li> -<p><strong>pyTelegramBotAPI</strong>. A simple, but extensible Python implementation for the Telegram Bot API. -<a href="https://github.com/eternnoir/pyTelegramBotAPI">https://github.com/eternnoir/pyTelegramBotAPI</a></p> +<li><p><strong>pyTelegramBotAPI</strong>. A simple, but extensible Python implementation for the Telegram Bot API.<br><a href="https://github.com/eternnoir/pyTelegramBotAPI">https://github.com/eternnoir/pyTelegramBotAPI</a></p> </li> -<li> -<p><strong>AIOGram</strong>. A pretty simple and fully asynchronous library for Telegram Bot API written with asyncio and aiohttp. -<a href="https://github.com/aiogram/aiogram">https://github.com/aiogram/aiogram</a></p> +<li><p><strong>AIOGram</strong>. A pretty simple and fully asynchronous library for Telegram Bot API written with asyncio and aiohttp.<br><a href="https://github.com/aiogram/aiogram">https://github.com/aiogram/aiogram</a></p> </li> -<li> -<p><strong>TGramBot</strong>. A partially auto-generated and asynchronous Minimal Telegram Bot API framework. -<a href="https://github.com/KeralaBots/TGramBot">https://github.com/KeralaBots/TGramBot</a></p> +<li><p><strong>TGramBot</strong>. A partially auto-generated and asynchronous Minimal Telegram Bot API framework.<br><a href="https://github.com/KeralaBots/TGramBot">https://github.com/KeralaBots/TGramBot</a></p> </li> -<li> -<p><strong>OrigamiBot</strong>. A pythonic Telegram bot API library. -<a href="https://github.com/cmd410/OrigamiBot">https://github.com/cmd410/OrigamiBot</a></p> +<li><p><strong>OrigamiBot</strong>. A pythonic Telegram bot API library.<br><a href="https://github.com/cmd410/OrigamiBot">https://github.com/cmd410/OrigamiBot</a></p> </li> -<li> -<p><strong>pytgbot</strong>. A module to access the Telegram Bot API. -<a href="https://github.com/luckydonald/pytgbot">https://github.com/luckydonald/pytgbot</a></p> +<li><p><strong>pytgbot</strong>. A module to access the Telegram Bot API.<br><a href="https://github.com/luckydonald/pytgbot">https://github.com/luckydonald/pytgbot</a></p> </li> -<li> -<p><strong>teleflask</strong>. A framework based on flask and pytgbot. -<a href="https://github.com/luckydonald/teleflask">https://github.com/luckydonald/teleflask</a></p> +<li><p><strong>teleflask</strong>. A framework based on flask and pytgbot.<br><a href="https://github.com/luckydonald/teleflask">https://github.com/luckydonald/teleflask</a></p> </li> -<li> -<p><strong>telegram-text</strong>. A Python markup module, which can be used with other frameworks. -<a href="https://github.com/SKY-ALIN/telegram-text">https://github.com/SKY-ALIN/telegram-text</a></p> +<li><p><strong>telegram-text</strong>. A Python markup module, which can be used with other frameworks.<br><a href="https://github.com/SKY-ALIN/telegram-text">https://github.com/SKY-ALIN/telegram-text</a></p> </li> </ul> -<h4><a class="anchor" href="#rust" id="rust" name="rust"><i class="anchor-icon"></i></a>Rust</h4> +<h4><a class="anchor" name="rust" href="#rust"><i class="anchor-icon"></i></a>Rust</h4> <ul> -<li> -<p><strong>Frankenstein</strong>. A Telegram Bot API client. -<a href="https://github.com/ayrat555/frankenstein">https://github.com/ayrat555/frankenstein</a></p> +<li><p><strong>Frankenstein</strong>. A Telegram Bot API client.<br><a href="https://github.com/ayrat555/frankenstein">https://github.com/ayrat555/frankenstein</a></p> </li> -<li> -<p><strong>teloxide</strong>. An elegant Telegram bots framework. -<a href="https://github.com/teloxide/teloxide">https://github.com/teloxide/teloxide</a></p> +<li><p><strong>teloxide</strong>. An elegant Telegram bots framework.<br><a href="https://github.com/teloxide/teloxide">https://github.com/teloxide/teloxide</a></p> </li> -<li> -<p><strong>Ferrisgram</strong>. An asynchronous autogenerated wrapper for the Telegram Bot API. -<a href="https://github.com/ferrisgram/ferrisgram">https://github.com/ferrisgram/ferrisgram</a></p> +<li><p><strong>Ferrisgram</strong>. An asynchronous autogenerated wrapper for the Telegram Bot API.<br><a href="https://github.com/ferrisgram/ferrisgram">https://github.com/ferrisgram/ferrisgram</a></p> </li> -<li> -<p><strong>carapax</strong>. A Telegram Bot API framework. -<a href="https://github.com/tg-rs/carapax">https://github.com/tg-rs/carapax</a></p> +<li><p><strong>carapax</strong>. A Telegram Bot API framework.<br><a href="https://github.com/tg-rs/carapax">https://github.com/tg-rs/carapax</a></p> </li> -<li> -<p><strong>tgbotapi</strong>. A library for using the Telegram Bot API. -<a href="https://github.com/Syfaro/tgbotapi-rs">https://github.com/Syfaro/tgbotapi-rs</a></p> +<li><p><strong>tgbotapi</strong>. A library for using the Telegram Bot API.<br><a href="https://github.com/Syfaro/tgbotapi-rs">https://github.com/Syfaro/tgbotapi-rs</a></p> </li> -<li> -<p><strong>telegram-bot</strong>. A Library for creating a Telegram Bot. -<a href="https://github.com/telegram-rs/telegram-bot">https://github.com/telegram-rs/telegram-bot</a></p> +<li><p><strong>telegram-bot</strong>. A Library for creating a Telegram Bot.<br><a href="https://github.com/telegram-rs/telegram-bot">https://github.com/telegram-rs/telegram-bot</a></p> </li> -<li> -<p><strong>Telebot</strong>. Write Telegram bots with Tokio and Futures. -<a href="https://github.com/bytesnake/telebot">https://github.com/bytesnake/telebot</a></p> +<li><p><strong>Telebot</strong>. Write Telegram bots with Tokio and Futures.<br><a href="https://github.com/bytesnake/telebot">https://github.com/bytesnake/telebot</a></p> </li> </ul> -<h4><a class="anchor" href="#kotlin" id="kotlin" name="kotlin"><i class="anchor-icon"></i></a>Kotlin</h4> +<h4><a class="anchor" name="kotlin" href="#kotlin"><i class="anchor-icon"></i></a>Kotlin</h4> <ul> -<li> -<p><strong>TelegramBotAPI</strong>. Type-safe library for work with Telegram Bot API. -<a href="https://github.com/InsanusMokrassar/TelegramBotAPI">https://github.com/InsanusMokrassar/TelegramBotAPI</a></p> +<li><p><strong>TelegramBotAPI</strong>. Type-safe library for work with Telegram Bot API.<br><a href="https://github.com/InsanusMokrassar/TelegramBotAPI">https://github.com/InsanusMokrassar/TelegramBotAPI</a></p> </li> -<li> -<p><strong>Kotlin Telegram Bot</strong>. Telegram Bot API wrapper, with handy Kotlin DSL. -<a href="https://github.com/vendelieu/telegram-bot">https://github.com/vendelieu/telegram-bot</a></p> +<li><p><strong>Kotlin Telegram Bot</strong>. Telegram Bot API wrapper, with handy Kotlin DSL.<br><a href="https://github.com/vendelieu/telegram-bot">https://github.com/vendelieu/telegram-bot</a></p> </li> -<li> -<p><strong>Kotlin Telegram Bot</strong>. A wrapper for the Telegram Bot API. -<a href="https://github.com/kotlin-telegram-bot/kotlin-telegram-bot">https://github.com/kotlin-telegram-bot/kotlin-telegram-bot</a></p> +<li><p><strong>Kotlin Telegram Bot</strong>. A wrapper for the Telegram Bot API.<br><a href="https://github.com/kotlin-telegram-bot/kotlin-telegram-bot">https://github.com/kotlin-telegram-bot/kotlin-telegram-bot</a></p> </li> -<li> -<p><strong>Telegram Bot API in Kotlin Multiplatform</strong>. Telegram Bot API in Kotlin. -<a href="https://github.com/omarmiatello/telegram">https://github.com/omarmiatello/telegram</a></p> +<li><p><strong>Telegram Bot API in Kotlin Multiplatform</strong>. Telegram Bot API in Kotlin.<br><a href="https://github.com/omarmiatello/telegram">https://github.com/omarmiatello/telegram</a></p> </li> -<li> -<p><strong>kt-telegram-bot</strong>. Telegram Bot API library for Kotlin language. -<a href="https://github.com/elbekD/kt-telegram-bot">https://github.com/elbekD/kt-telegram-bot</a></p> +<li><p><strong>kt-telegram-bot</strong>. Telegram Bot API library for Kotlin language.<br><a href="https://github.com/elbekD/kt-telegram-bot">https://github.com/elbekD/kt-telegram-bot</a></p> </li> -<li> -<p><strong>Iris Telegram API</strong>. Yet another Telegram API bot created with Kotlin. -<a href="https://github.com/iris2iris/iris-telegram-api">https://github.com/iris2iris/iris-telegram-api</a></p> +<li><p><strong>Iris Telegram API</strong>. Yet another Telegram API bot created with Kotlin.<br><a href="https://github.com/iris2iris/iris-telegram-api">https://github.com/iris2iris/iris-telegram-api</a></p> </li> </ul> -<h4><a class="anchor" href="#nodejs" id="nodejs" name="nodejs"><i class="anchor-icon"></i></a>Node.js</h4> +<h4><a class="anchor" name="node-js" href="#node-js"><i class="anchor-icon"></i></a>Node.js</h4> <ul> -<li> -<p><strong>Telegraf</strong>. Modern Telegram Bot Framework for Node.js. -<a href="https://github.com/telegraf/telegraf">https://github.com/telegraf/telegraf</a></p> +<li><p><strong>Telegraf</strong>. Modern Telegram Bot Framework for Node.js.<br><a href="https://github.com/telegraf/telegraf">https://github.com/telegraf/telegraf</a></p> </li> -<li> -<p><strong>Node-Telegram-bot</strong>. Node.js module to interact with the official Telegram Bot API. -<a href="https://github.com/yagop/node-telegram-bot-api">https://github.com/yagop/node-telegram-bot-api</a></p> +<li><p><strong>Node-Telegram-bot</strong>. Node.js module to interact with the official Telegram Bot API.<br><a href="https://github.com/yagop/node-telegram-bot-api">https://github.com/yagop/node-telegram-bot-api</a></p> </li> -<li> -<p><strong>Telebot</strong>. The easy way to write Telegram bots. -<a href="https://github.com/mullwar/telebot">https://github.com/mullwar/telebot</a></p> +<li><p><strong>Telebot</strong>. The easy way to write Telegram bots.<br><a href="https://github.com/mullwar/telebot">https://github.com/mullwar/telebot</a></p> </li> -<li> -<p><strong>Slimbot</strong>. A fuss-free, thin wrapper around Telegram Bot API for Node.js. No frills. -<a href="https://github.com/edisonchee/slimbot">https://github.com/edisonchee/slimbot</a></p> +<li><p><strong>Slimbot</strong>. A fuss-free, thin wrapper around Telegram Bot API for Node.js. No frills.<br><a href="https://github.com/edisonchee/slimbot">https://github.com/edisonchee/slimbot</a></p> </li> </ul> -<h4><a class="anchor" href="#net" id="net" name="net"><i class="anchor-icon"></i></a>.NET</h4> +<h4><a class="anchor" name="net" href="#net"><i class="anchor-icon"></i></a>.NET</h4> <ul> -<li> -<p><strong>Telegram.bot</strong>. .NET Client for Telegram Bot API. -<a href="https://github.com/TelegramBots/Telegram.Bot">https://github.com/TelegramBots/Telegram.Bot</a></p> +<li><p><strong>Telegram.bot</strong>. .NET Client for Telegram Bot API.<br><a href="https://github.com/TelegramBots/Telegram.Bot">https://github.com/TelegramBots/Telegram.Bot</a></p> </li> -<li> -<p><strong>Telegram.Bots</strong>. A .NET 5 wrapper for the Telegram Bot API. -<a href="https://github.com/TelegramBotsAPI/Telegram.Bots">https://github.com/TelegramBotsAPI/Telegram.Bots</a></p> +<li><p><strong>Telegram.Bots</strong>. A .NET 5 wrapper for the Telegram Bot API.<br><a href="https://github.com/TelegramBotsAPI/Telegram.Bots">https://github.com/TelegramBotsAPI/Telegram.Bots</a></p> </li> -<li> -<p><strong>RxTelegram.Bot</strong>. RxTelegram uses a reactive approach to make Updates available. -<a href="https://github.com/RxTelegram/RxTelegram.Bot">https://github.com/RxTelegram/RxTelegram.Bot</a></p> +<li><p><strong>RxTelegram.Bot</strong>. RxTelegram uses a reactive approach to make Updates available.<br><a href="https://github.com/RxTelegram/RxTelegram.Bot">https://github.com/RxTelegram/RxTelegram.Bot</a></p> </li> -<li> -<p><strong>Telegram.BotAPI for NET</strong>. One of the most complete libraries available to interact with the Telegram Bot API. -<a href="https://github.com/Eptagone/Telegram.BotAPI">https://github.com/Eptagone/Telegram.BotAPI</a></p> +<li><p><strong>Telegram.BotAPI for NET</strong>. One of the most complete libraries available to interact with the Telegram Bot API.<br><a href="https://github.com/Eptagone/Telegram.BotAPI">https://github.com/Eptagone/Telegram.BotAPI</a></p> </li> </ul> -<h4><a class="anchor" href="#swift" id="swift" name="swift"><i class="anchor-icon"></i></a>Swift</h4> +<h4><a class="anchor" name="swift" href="#swift"><i class="anchor-icon"></i></a>Swift</h4> <ul> -<li> -<p><strong>Telegram Vapor Bot</strong>. The wrapper for the Telegram Bot API written in Swift with Vapor. -<a href="https://github.com/nerzh/telegram-vapor-bot">https://github.com/nerzh/telegram-vapor-bot</a></p> +<li><p><strong>Telegram Vapor Bot</strong>. The wrapper for the Telegram Bot API written in Swift with Vapor.<br><a href="https://github.com/nerzh/telegram-vapor-bot">https://github.com/nerzh/telegram-vapor-bot</a></p> </li> -<li> -<p><strong>telegram-bot-swift</strong>. Telegram Bot SDK for Swift. -<a href="https://github.com/rapierorg/telegram-bot-swift">https://github.com/rapierorg/telegram-bot-swift</a></p> +<li><p><strong>telegram-bot-swift</strong>. Telegram Bot SDK for Swift.<br><a href="https://github.com/rapierorg/telegram-bot-swift">https://github.com/rapierorg/telegram-bot-swift</a></p> </li> -<li> -<p><strong>Telegrammer</strong>. Telegram Bot Framework written in Swift 5.1 with SwiftNIO network framework. -<a href="https://github.com/givip/Telegrammer">https://github.com/givip/Telegrammer</a></p> +<li><p><strong>Telegrammer</strong>. Telegram Bot Framework written in Swift 5.1 with SwiftNIO network framework.<br><a href="https://github.com/givip/Telegrammer">https://github.com/givip/Telegrammer</a></p> </li> </ul> -<h4><a class="anchor" href="#typescript" id="typescript" name="typescript"><i class="anchor-icon"></i></a>TypeScript</h4> +<h4><a class="anchor" name="typescript" href="#typescript"><i class="anchor-icon"></i></a>TypeScript</h4> <ul> -<li> -<p><strong>grammY</strong>. The Telegram Bot Framework. -<a href="https://github.com/grammyjs/grammY">https://github.com/grammyjs/grammY</a></p> +<li><p><strong>grammY</strong>. The Telegram Bot Framework.<br><a href="https://github.com/grammyjs/grammY">https://github.com/grammyjs/grammY</a></p> </li> -<li> -<p><strong>Nestgram</strong>. Framework for working with Telegram Bot API on TypeScript like Nest.js. -<a href="https://github.com/Degreet/nestgram">https://github.com/Degreet/nestgram</a></p> +<li><p><strong>Nestgram</strong>. Framework for working with Telegram Bot API on TypeScript like Nest.js.<br><a href="https://github.com/Degreet/nestgram">https://github.com/Degreet/nestgram</a></p> </li> -<li> -<p><strong>puregram</strong>. Powerful and modern telegram bot api sdk for node.js and typescript. -<a href="https://github.com/nitreojs/puregram">https://github.com/nitreojs/puregram</a></p> +<li><p><strong>puregram</strong>. Powerful and modern telegram bot api sdk for node.js and typescript.<br><a href="https://github.com/nitreojs/puregram">https://github.com/nitreojs/puregram</a></p> </li> </ul> -<h4><a class="anchor" href="#java" id="java" name="java"><i class="anchor-icon"></i></a>Java</h4> +<h4><a class="anchor" name="java" href="#java"><i class="anchor-icon"></i></a>Java</h4> <ul> -<li> -<p><strong>TelegramBots</strong>. A simple to use library to create Telegram Bots. -<a href="https://github.com/rubenlagus/TelegramBots">https://github.com/rubenlagus/TelegramBots</a></p> +<li><p><strong>TelegramBots</strong>. A simple to use library to create Telegram Bots.<br><a href="https://github.com/rubenlagus/TelegramBots">https://github.com/rubenlagus/TelegramBots</a></p> </li> -<li> -<p><strong>Java API</strong>. Telegram Bot API for Java. -<a href="https://github.com/pengrad/java-telegram-bot-api">https://github.com/pengrad/java-telegram-bot-api</a></p> +<li><p><strong>Java API</strong>. Telegram Bot API for Java.<br><a href="https://github.com/pengrad/java-telegram-bot-api">https://github.com/pengrad/java-telegram-bot-api</a></p> </li> -<li> -<p><strong>ReBot</strong>. A Java EE Telegram Bot API. -<a href="https://github.com/rebasing-xyz/rebot">https://github.com/rebasing-xyz/rebot</a></p> +<li><p><strong>ReBot</strong>. A Java EE Telegram Bot API.<br><a href="https://github.com/rebasing-xyz/rebot">https://github.com/rebasing-xyz/rebot</a></p> </li> </ul> -<h4><a class="anchor" href="#scala" id="scala" name="scala"><i class="anchor-icon"></i></a>Scala</h4> +<h4><a class="anchor" name="scala" href="#scala"><i class="anchor-icon"></i></a>Scala</h4> <ul> -<li> -<p><strong>canoe</strong>. Functional Telegram Bot API. -<a href="https://github.com/augustjune/canoe">https://github.com/augustjune/canoe</a></p> +<li><p><strong>canoe</strong>. Functional Telegram Bot API.<br><a href="https://github.com/augustjune/canoe">https://github.com/augustjune/canoe</a></p> </li> -<li> -<p><strong>bot4s.telegram</strong>. Simple, extensible, strongly-typed wrapper for the Telegram Bot API. -<a href="https://github.com/bot4s/telegram">https://github.com/bot4s/telegram</a></p> +<li><p><strong>bot4s.telegram</strong>. Simple, extensible, strongly-typed wrapper for the Telegram Bot API.<br><a href="https://github.com/bot4s/telegram">https://github.com/bot4s/telegram</a></p> </li> -<li> -<p><strong>F[Tg] - Telegramium</strong>. Pure functional Telegram Bot API implementation. -<a href="https://github.com/apimorphism/telegramium">https://github.com/apimorphism/telegramium</a></p> +<li><p><strong>F[Tg] - Telegramium</strong>. Pure functional Telegram Bot API implementation.<br><a href="https://github.com/apimorphism/telegramium">https://github.com/apimorphism/telegramium</a></p> </li> </ul> -<h4><a class="anchor" href="#ruby" id="ruby" name="ruby"><i class="anchor-icon"></i></a>Ruby</h4> +<h4><a class="anchor" name="ruby" href="#ruby"><i class="anchor-icon"></i></a>Ruby</h4> <ul> -<li> -<p><strong>Telegram::Bot</strong>. Ruby gem for building Telegram Bot with optional Rails integration. -<a href="https://github.com/telegram-bot-rb/telegram-bot">https://github.com/telegram-bot-rb/telegram-bot</a></p> +<li><p><strong>Telegram::Bot</strong>. Ruby gem for building Telegram Bot with optional Rails integration.<br><a href="https://github.com/telegram-bot-rb/telegram-bot">https://github.com/telegram-bot-rb/telegram-bot</a></p> </li> -<li> -<p><strong>telegram-bot-ruby</strong>. Ruby wrapper for Telegram's Bot API. -<a href="https://github.com/atipugin/telegram-bot-ruby">https://github.com/atipugin/telegram-bot-ruby</a></p> +<li><p><strong>telegram-bot-ruby</strong>. Ruby wrapper for Telegram's Bot API.<br><a href="https://github.com/atipugin/telegram-bot-ruby">https://github.com/atipugin/telegram-bot-ruby</a></p> </li> </ul> -<h4><a class="anchor" href="#other-languages" id="other-languages" name="other-languages"><i class="anchor-icon"></i></a>Other Languages</h4> +<h4><a class="anchor" name="other-languages" href="#other-languages"><i class="anchor-icon"></i></a>Other Languages</h4> <ul> -<li> -<p>Elixir. <strong>ExGram</strong>. Telegram Bot API low level API and framework. -<a href="https://github.com/rockneurotiko/ex_gram">https://github.com/rockneurotiko/ex_gram</a></p> +<li><p>Elixir. <strong>ExGram</strong>. Telegram Bot API low level API and framework.<br><a href="https://github.com/rockneurotiko/ex_gram">https://github.com/rockneurotiko/ex_gram</a></p> </li> -<li> -<p>Elixir. <strong>Nadia</strong>. Telegram Bot API Wrapper. -<a href="https://github.com/zhyu/nadia">https://github.com/zhyu/nadia</a></p> +<li><p>Elixir. <strong>Nadia</strong>. Telegram Bot API Wrapper.<br><a href="https://github.com/zhyu/nadia">https://github.com/zhyu/nadia</a></p> </li> -<li> -<p>C++. <strong>tgbot-cpp</strong>. A library for Telegram Bot API. -<a href="https://github.com/reo7sp/tgbot-cpp">https://github.com/reo7sp/tgbot-cpp</a></p> +<li><p>C++. <strong>tgbot-cpp</strong>. A library for Telegram Bot API.<br><a href="https://github.com/reo7sp/tgbot-cpp">https://github.com/reo7sp/tgbot-cpp</a></p> </li> -<li> -<p>C++. <strong>tgbot</strong>. A library for Telegram Bot API with generated API types and methods. -<a href="https://github.com/egorpugin/tgbot">https://github.com/egorpugin/tgbot</a></p> +<li><p>C++. <strong>tgbot</strong>. A library for Telegram Bot API with generated API types and methods.<br><a href="https://github.com/egorpugin/tgbot">https://github.com/egorpugin/tgbot</a></p> </li> -<li> -<p>Dart. <strong>TeleDart</strong>. A library interfacing with the latest Telegram Bot API. -<a href="https://github.com/DinoLeung/TeleDart">https://github.com/DinoLeung/TeleDart</a></p> +<li><p>Dart. <strong>TeleDart</strong>. A library interfacing with the latest Telegram Bot API.<br><a href="https://github.com/DinoLeung/TeleDart">https://github.com/DinoLeung/TeleDart</a></p> </li> -<li> -<p>Pascal. <strong>TGBotMini</strong>. Telegram Bot Mini API. -<a href="https://github.com/HemulGM/TGBotMini">https://github.com/HemulGM/TGBotMini</a></p> +<li><p>Pascal. <strong>TGBotMini</strong>. Telegram Bot Mini API.<br><a href="https://github.com/HemulGM/TGBotMini">https://github.com/HemulGM/TGBotMini</a></p> </li> -<li> -<p>Clojure. <strong>telegrambot-lib</strong>. A library for interacting with the Telegram Bot API. -<a href="https://github.com/wdhowe/telegrambot-lib">https://github.com/wdhowe/telegrambot-lib</a></p> +<li><p>Clojure. <strong>telegrambot-lib</strong>. A library for interacting with the Telegram Bot API.<br><a href="https://github.com/wdhowe/telegrambot-lib">https://github.com/wdhowe/telegrambot-lib</a></p> </li> -<li> -<p>Lua. <strong>telegram-bot-lua</strong>. A feature-filled Telegram Bot API library. -<a href="https://github.com/wrxck/telegram-bot-lua">https://github.com/wrxck/telegram-bot-lua</a></p> +<li><p>Lua. <strong>telegram-bot-lua</strong>. A feature-filled Telegram Bot API library.<br><a href="https://github.com/wrxck/telegram-bot-lua">https://github.com/wrxck/telegram-bot-lua</a></p> </li> -<li> -<p>OCaml. <strong>TelegraML</strong>. A library for creating bots for Telegram. -<a href="https://github.com/nv-vn/TelegraML">https://github.com/nv-vn/TelegraML</a></p> +<li><p>OCaml. <strong>TelegraML</strong>. A library for creating bots for Telegram.<br><a href="https://github.com/nv-vn/TelegraML">https://github.com/nv-vn/TelegraML</a></p> </li> -<li> -<p>Haskell. <strong>haskell-telegram-api</strong>. High-level bindings to the Telegram Bot API based on <a href="https://haskell-servant.github.io/">servant</a> library. -<a href="https://github.com/klappvisor/haskell-telegram-api">https://github.com/klappvisor/haskell-telegram-api</a></p> +<li><p>Haskell. <strong>haskell-telegram-api</strong>. High-level bindings to the Telegram Bot API based on <a href="https://haskell-servant.github.io/">servant</a> library.<br><a href="https://github.com/klappvisor/haskell-telegram-api">https://github.com/klappvisor/haskell-telegram-api</a></p> </li> -<li> -<p>Perl. <strong>Telegram Bot</strong>. A genuine Perl 6 client for the Telegram's Bot API. -<a href="https://github.com/GildedHonour/TelegramBot">https://github.com/GildedHonour/TelegramBot</a></p> +<li><p>Perl. <strong>Telegram Bot</strong>. A genuine Perl 6 client for the Telegram's Bot API.<br><a href="https://github.com/GildedHonour/TelegramBot">https://github.com/GildedHonour/TelegramBot</a></p> </li> -</ul></div> +</ul> +</div> </div> diff --git a/data/web/corefork.telegram.org/bots/webapps.html b/data/web/corefork.telegram.org/bots/webapps.html index 20e3662d44..14ba25cbe6 100644 --- a/data/web/corefork.telegram.org/bots/webapps.html +++ b/data/web/corefork.telegram.org/bots/webapps.html @@ -49,33 +49,34 @@ <div class="blog_video_player_wrap" style="max-width: 600px; margin: 20px auto 20px;"> <video class="blog_video_player tl_blog_vid_autoplay" onclick="videoTogglePlay(this)" autoplay loop controls muted poster="/file/464001434/100bf/eWprjdgzEbE.100386/644bbea83084f44c8f" style="max-width: 600px;" title="console.log('Vive la révolution')" alt="Bot Revolution"> <source src="/file/464001679/11aa9/KQx_BlPVXRo.4922145.mp4/c65433c8ac11a347a8" type="video/mp4"> - </source></video> + </video> </div> + <blockquote> <p>To see a <strong>Web App</strong> in action, try our sample <a href="https://t.me/durgerkingbot">@DurgerKingBot</a>.</p> </blockquote> <hr> -<h3><a class="anchor" href="#recent-changes" id="recent-changes" name="recent-changes"><i class="anchor-icon"></i></a>Recent changes</h3> -<h4><a class="anchor" href="#april-21-2023" id="april-21-2023" name="april-21-2023"><i class="anchor-icon"></i></a>April 21, 2023</h4> +<h3><a class="anchor" name="recent-changes" href="#recent-changes"><i class="anchor-icon"></i></a>Recent changes</h3> +<h4><a class="anchor" name="april-21-2023" href="#april-21-2023"><i class="anchor-icon"></i></a>April 21, 2023</h4> <p><strong>Bot API 6.7</strong></p> <ul> <li>Added support for launching Web Apps from inline query results and from a direct link.</li> <li>Added the method <em>switchInlineQuery</em> to the class <a href="#initializing-web-apps">WebApp</a>.</li> </ul> -<h4><a class="anchor" href="#december-30-2022" id="december-30-2022" name="december-30-2022"><i class="anchor-icon"></i></a>December 30, 2022</h4> +<h4><a class="anchor" name="december-30-2022" href="#december-30-2022"><i class="anchor-icon"></i></a>December 30, 2022</h4> <p><strong>Bot API 6.4</strong></p> <ul> <li>Added the field <em>platform</em>, the optional parameter <em>options</em> to the method <em>openLink</em> and the methods <em>showScanQrPopup</em>, <em>closeScanQrPopup</em>, <em>readTextFromClipboard</em> to the class <a href="#initializing-web-apps">WebApp</a>.</li> <li>Added the events <em>qrTextReceived</em>, <em>clipboardTextReceived</em>.</li> </ul> -<h4><a class="anchor" href="#august-12-2022" id="august-12-2022" name="august-12-2022"><i class="anchor-icon"></i></a>August 12, 2022</h4> +<h4><a class="anchor" name="august-12-2022" href="#august-12-2022"><i class="anchor-icon"></i></a>August 12, 2022</h4> <p><strong>Bot API 6.2</strong></p> <ul> <li>Added the field <em>isClosingConfirmationEnabled</em> and the methods <em>enableClosingConfirmation</em>, <em>disableClosingConfirmation</em>, <em>showPopup</em>, <em>showAlert</em>, <em>showConfirm</em> to the class <a href="#initializing-web-apps">WebApp</a>.</li> <li>Added the field <em>is_premium</em> to the class <a href="#webappuser">WebAppUser</a>.</li> <li>Added the event <em>popupClosed</em>.</li> </ul> -<h4><a class="anchor" href="#june-20-2022" id="june-20-2022" name="june-20-2022"><i class="anchor-icon"></i></a>June 20, 2022</h4> +<h4><a class="anchor" name="june-20-2022" href="#june-20-2022"><i class="anchor-icon"></i></a>June 20, 2022</h4> <p><strong>Bot API 6.1</strong></p> <ul> <li>Added the ability to use bots added to the attachment menu in group, supergroup and channel chats.</li> @@ -87,18 +88,19 @@ <li>Added the <a href="#events-available-for-web-apps">events</a> <em>backButtonClicked</em>, <em>settingsButtonClicked</em>, <em>invoiceClosed</em>.</li> </ul> <hr> -<h3><a class="anchor" href="#designing-web-apps" id="designing-web-apps" name="designing-web-apps"><i class="anchor-icon"></i></a>Designing Web Apps</h3> -<h4><a class="anchor" href="#color-schemes" id="color-schemes" name="color-schemes"><i class="anchor-icon"></i></a>Color Schemes</h4> -<p>Web Apps always receive data about the user's current <strong>color theme</strong> in real time, so you can adjust the appearance of your interfaces to match it. For example, when users switch between <strong>Day and Night</strong> modes or use various <a href="https://telegram.org/blog/protected-content-delete-by-date-and-more#global-chat-themes-on-android">custom themes</a>.</p> +<h3><a class="anchor" name="designing-web-apps" href="#designing-web-apps"><i class="anchor-icon"></i></a>Designing Web Apps</h3> +<h4><a class="anchor" name="color-schemes" href="#color-schemes"><i class="anchor-icon"></i></a>Color Schemes</h4> +<p>Web Apps always receive data about the user's current <strong>color theme</strong> in real time, so you can adjust the appearance of your interfaces to match it. For example, when users switch between <strong>Day and Night</strong> modes or use various <a href="https://telegram.org/blog/protected-content-delete-by-date-and-more#global-chat-themes-on-android">custom themes</a>.</p> <div class="blog_video_player_wrap" style="max-width: 600px; margin: 20px auto 20px;"> <video class="blog_video_player tl_blog_vid_autoplay" onclick="videoTogglePlay(this)" autoplay loop controls muted poster="/file/464001576/10249/wikoQUNnrH4.112118/7b6c8d3366ada2615b" style="max-width: 600px;" title="" alt="Switching Colors"> <source src="/file/464001257/12087/QNQUbIi864k.909800.mp4/8ea7adad7db407388e" type="video/mp4"> - </source></video> + </video> </div> + <blockquote> <p><a href="#themeparams">Jump to technical information</a></p> </blockquote> -<h4><a class="anchor" href="#design-guidelines" id="design-guidelines" name="design-guidelines"><i class="anchor-icon"></i></a>Design Guidelines</h4> +<h4><a class="anchor" name="design-guidelines" href="#design-guidelines"><i class="anchor-icon"></i></a>Design Guidelines</h4> <p>Telegram apps are known for being snappy, smooth and following a consistent cross-platform design. Your Web App should ideally reflect these principles.</p> <ul> <li>All elements should be responsive and designed with a mobile-first approach.</li> @@ -108,12 +110,13 @@ <li>The app should deliver a seamless experience by monitoring the <a href="#color-schemes">dynamic theme-based colors</a> provided by the API and using them accordingly.</li> </ul> <hr> -<h3><a class="anchor" href="#implementing-web-apps" id="implementing-web-apps" name="implementing-web-apps"><i class="anchor-icon"></i></a>Implementing Web Apps</h3> -<p>Telegram currently supports six different ways of launching Web Apps: from a <a href="#keyboard-button-web-apps">keyboard button</a>, from an <a href="#inline-button-web-apps">inline button</a>, from the <a href="#launching-web-apps-from-the-menu-button">bot menu button</a>, via <a href="#inline-mode-web-apps">inline mode</a>, from a <a href="#direct-link-web-apps">direct link</a> – and even from the <a href="#launching-web-apps-from-the-attachment-menu">attachment menu</a>.</p> +<h3><a class="anchor" name="implementing-web-apps" href="#implementing-web-apps"><i class="anchor-icon"></i></a>Implementing Web Apps</h3> +<p>Telegram currently supports six different ways of launching Web Apps: from a <a href="#keyboard-button-web-apps">keyboard button</a>, from an <a href="#inline-button-web-apps">inline button</a>, from the <a href="#launching-web-apps-from-the-menu-button">bot menu button</a>, via <a href="#inline-mode-web-apps">inline mode</a>, from a <a href="#direct-link-web-apps">direct link</a> – and even from the <a href="#launching-web-apps-from-the-attachment-menu">attachment menu</a>.</p> <div> - <a href="/file/464001388/10b1a/IYpn0wWfggw.1156850/fd9a32baa81dcecbe4" target="_blank"><img src="/file/464001388/10b1a/IYpn0wWfggw.1156850/fd9a32baa81dcecbe4" title="" alt="Types of buttons" class="dev_page_image"></a> + <a href="/file/464001388/10b1a/IYpn0wWfggw.1156850/fd9a32baa81dcecbe4" target="_blank"><img src="/file/464001388/10b1a/IYpn0wWfggw.1156850/fd9a32baa81dcecbe4" title="" alt="Types of buttons" class="dev_page_image" /></a> </div> -<h4><a class="anchor" href="#keyboard-button-web-apps" id="keyboard-button-web-apps" name="keyboard-button-web-apps"><i class="anchor-icon"></i></a>Keyboard Button Web Apps</h4> + +<h4><a class="anchor" name="keyboard-button-web-apps" href="#keyboard-button-web-apps"><i class="anchor-icon"></i></a>Keyboard Button Web Apps</h4> <blockquote> <p><strong>TL;DR:</strong> Web Apps launched from a <strong>web_app</strong> type <a href="/bots/api#keyboardbutton">keyboard button</a> can send data back to the bot in a <em>service message</em> using <a href="#initializing-web-apps">Telegram.WebApp.sendData</a>. This makes it possible for the bot to produce a response without communicating with any external servers.</p> </blockquote> @@ -122,84 +125,84 @@ <p>To transmit data from the user back to the bot, the Web App can call the <a href="#initializing-web-apps">Telegram.WebApp.sendData</a> method. Data will be transmitted to the bot as a String in a service message. The bot can continue communicating with the user after receiving it.</p> <p><strong>Good for:</strong></p> <ul> -<li><strong>Сustom data input interfaces</strong> (a personalized calendar for selecting dates; selecting data from a list with advanced search options; a randomizer that lets the user "spin a wheel" and chooses one of the available options, etc.)</li> +<li><strong>Сustom data input interfaces</strong> (a personalized calendar for selecting dates; selecting data from a list with advanced search options; a randomizer that lets the user “spin a wheel” and chooses one of the available options, etc.)</li> <li><strong>Reusable components</strong> that do not depend on a particular bot.</li> </ul> -<h4><a class="anchor" href="#inline-button-web-apps" id="inline-button-web-apps" name="inline-button-web-apps"><i class="anchor-icon"></i></a>Inline Button Web Apps</h4> +<h4><a class="anchor" name="inline-button-web-apps" href="#inline-button-web-apps"><i class="anchor-icon"></i></a>Inline Button Web Apps</h4> <blockquote> <p><strong>TL;DR:</strong> For more interactive Web Apps like <a href="https://t.me/durgerkingbot">@DurgerKingBot</a>, use a <strong>web_app</strong> type <a href="/bots/api#inlinekeyboardbutton">Inline KeyboardButton</a>, which gets basic user information and can be used to send a message on behalf of the user to the chat with the bot.</p> </blockquote> <p>If receiving text data alone is insufficient or you need a more advanced and personalized interface, you can open a Web App using a <strong>web_app</strong> type <a href="/bots/api#inlinekeyboardbutton">Inline KeyboardButton</a>.</p> -<p>From the button, a Web App will open with the URL specified in the button. In addition to the user's <a href="#color-schemes">theme settings</a>, it will receive basic user information (<code>ID</code>, <code>name</code>, <code>username</code>, <code>language_code</code>) and a unique identifier for the session, <strong>query_id</strong>, which allows messages on behalf of the user to be sent back to the bot.</p> +<p>From the button, a Web App will open with the URL specified in the button. In addition to the user's <a href="#color-schemes">theme settings</a>, it will receive basic user information (<code>ID</code>, <code>name</code>, <code>username</code>, <code>language_code</code>) and a unique identifier for the session, <strong>query_id</strong>, which allows messages on behalf of the user to be sent back to the bot.</p> <p>The bot can call the Bot API method <a href="/bots/api#answerwebappquery">answerWebAppQuery</a> to send an inline message from the user back to the bot and close the Web App. After receiving the message, the bot can continue communicating with the user.</p> <p><strong>Good for:</strong></p> <ul> <li>Fully-fledged web services and integrations of any kind.</li> <li>The use cases are effectively <strong>unlimited</strong>.</li> </ul> -<h4><a class="anchor" href="#launching-web-apps-from-the-menu-button" id="launching-web-apps-from-the-menu-button" name="launching-web-apps-from-the-menu-button"><i class="anchor-icon"></i></a>Launching Web Apps from the Menu Button</h4> +<h4><a class="anchor" name="launching-web-apps-from-the-menu-button" href="#launching-web-apps-from-the-menu-button"><i class="anchor-icon"></i></a>Launching Web Apps from the Menu Button</h4> <blockquote> <p><strong>TL;DR:</strong> Web Apps can be launched from a customized menu button. This simply offers a quicker way to access the app and is otherwise <strong>identical</strong> to <a href="#inline-button-web-apps">launching a Web App from an inline button</a>.</p> </blockquote> <p>By default, chats with bots always show a convenient <strong>menu button</strong> that provides quick access to all listed <a href="/bots#commands">commands</a>. With <a href="https://core.telegram.org/bots/api-changelog#april-16-2022">Bot API 6.0</a>, this button can be used to <strong>launch a Web App</strong> instead.</p> <div class="blog_video_player_wrap" style="max-width: 600px; margin: 20px auto 20px;"> -<video class="blog_video_player tl_blog_vid_autoplay" onclick="videoTogglePlay(this)" autoplay loop controls muted poster="/file/464001829/12247/e6LoU12o4Ng.109921/1226afb8f18f8ea8c4 + <video class="blog_video_player tl_blog_vid_autoplay" onclick="videoTogglePlay(this)" autoplay loop controls muted poster="/file/464001829/12247/e6LoU12o4Ng.109921/1226afb8f18f8ea8c4 " style="max-width: 600px;" title="" alt="Menu Button"> <source src="/file/464001838/10fa2/WrJmkuIMan0.1217917.mp4/e25a5f31bc4e6493f7" type="video/mp4"> - </source></video> + </video> </div> + <p>To configure the menu button, you must specify the text it should show and the Web App URL. There are two ways to set these parameters:</p> <ul> <li>To customize the button for <strong>all users</strong>, use <a href="https://t.me/botfather">@BotFather</a> (the <code>/setmenubutton</code> command or <em>Bot Settings > Menu Button</em>).</li> -<li>To customize the button for both <strong>all users</strong> and <strong>specific users</strong>, use the <a href="/bots/api#setchatmenubutton">setChatMenuButton</a> method in the Bot API. For example, change the button text according to the user's language, or show links to different Web Apps based on a user's settings in your bot.</li> +<li>To customize the button for both <strong>all users</strong> and <strong>specific users</strong>, use the <a href="/bots/api#setchatmenubutton">setChatMenuButton</a> method in the Bot API. For example, change the button text according to the user's language, or show links to different Web Apps based on a user's settings in your bot.</li> </ul> <p>Apart from this, Web Apps opened via the menu button work in the exact same way as when <a href="#inline-button-web-apps">using inline buttons</a>.</p> <blockquote> <p><a href="https://t.me/durgerkingbot">@DurgerKingBot</a> allows launching its Web App both from an inline button and from the menu button.</p> </blockquote> -<h4><a class="anchor" href="#inline-mode-web-apps" id="inline-mode-web-apps" name="inline-mode-web-apps"><i class="anchor-icon"></i></a>Inline Mode Web Apps</h4> +<h4><a class="anchor" name="inline-mode-web-apps" href="#inline-mode-web-apps"><i class="anchor-icon"></i></a>Inline Mode Web Apps</h4> <blockquote> <p><strong>TL;DR:</strong> Web Apps launched via <strong>web_app</strong> type <a href="/bots/api#inlinequeryresultsbutton">InlineQueryResultsButton</a> can be used anywhere in inline mode. Users can create content in a web interface and then seamlessly send it to the current chat via inline mode.</p> </blockquote> -<p>^==NEW==^ You can use the <em>button</em> parameter in the <a href="/bots/api#answerinlinequery">answerInlineQuery</a> method to display a special 'Switch to Web App' button either above or in place of the inline results. This button will <strong>open a Web App</strong> from the specified URL. Once done, you can call the <a href="#initializing-web-apps">Telegram.WebApp.switchInlineQuery</a> method to send the user back to inline mode.</p> -<p>Inline Web Apps have <strong>no access</strong> to the chat – they can't read messages or send new ones on behalf of the user. To send messages, the user must be redirected to <strong>inline mode</strong> and actively pick a result.</p> +<p><sup><mark>NEW</mark></sup> You can use the <em>button</em> parameter in the <a href="/bots/api#answerinlinequery">answerInlineQuery</a> method to display a special 'Switch to Web App' button either above or in place of the inline results. This button will <strong>open a Web App</strong> from the specified URL. Once done, you can call the <a href="#initializing-web-apps">Telegram.WebApp.switchInlineQuery</a> method to send the user back to inline mode.</p> +<p>Inline Web Apps have <strong>no access</strong> to the chat – they can't read messages or send new ones on behalf of the user. To send messages, the user must be redirected to <strong>inline mode</strong> and actively pick a result.</p> <p><strong>Good for:</strong></p> <ul> <li>Fully-fledged web services and integrations in inline mode.</li> </ul> -<h4><a class="anchor" href="#direct-link-web-apps" id="direct-link-web-apps" name="direct-link-web-apps"><i class="anchor-icon"></i></a>Direct Link Web Apps</h4> +<h4><a class="anchor" name="direct-link-web-apps" href="#direct-link-web-apps"><i class="anchor-icon"></i></a>Direct Link Web Apps</h4> <blockquote> <p><strong>TL;DR:</strong> Web App Bots can be launched from a direct link in any chat. They support a <em>startapp</em> parameter and are aware of the current chat context.</p> </blockquote> -<p>^==NEW==^ You can use direct links to <strong>open a Web App</strong> directly in the current chat. If a non-empty <em>startapp</em> parameter is included in the link, it will be passed to the Web App in the <em>start_param</em> field and in the GET parameter <em>tgWebAppStartParam</em>.</p> +<p><sup><mark>NEW</mark></sup> You can use direct links to <strong>open a Web App</strong> directly in the current chat. If a non-empty <em>startapp</em> parameter is included in the link, it will be passed to the Web App in the <em>start_param</em> field and in the GET parameter <em>tgWebAppStartParam</em>.</p> <p>In this mode, Web Apps can use the <em>chat_type</em> and <em>chat_instance</em> parameters to keep track of the current chat context. This introduces support for <strong>concurrent</strong> and <strong>shared</strong> usage by multiple chat members – to create live whiteboards, group orders, multiplayer games and similar apps.</p> -<p>Web Apps opened from a direct link have <strong>no access</strong> to the chat – they can't read messages or send new ones on behalf of the user. To send messages, the user must be redirected to <strong>inline mode</strong> and actively pick a result.</p> +<p>Web Apps opened from a direct link have <strong>no access</strong> to the chat – they can't read messages or send new ones on behalf of the user. To send messages, the user must be redirected to <strong>inline mode</strong> and actively pick a result.</p> <p><strong>Examples</strong></p> -<p><code>https://t.me/botusername/appname</code> -<code>https://t.me/botusername/appname?startapp=command</code></p> +<p><code>https://t.me/botusername/appname</code><br><code>https://t.me/botusername/appname?startapp=command</code></p> <p><strong>Good for:</strong></p> <ul> <li>Fully-fledged web services and integrations that any user can open in one tap.</li> <li>Cooperative, multiplayer or teamwork-oriented services within a chat context.</li> <li>The use cases are effectively <strong>unlimited</strong>.</li> </ul> -<h4><a class="anchor" href="#launching-web-apps-from-the-attachment-menu" id="launching-web-apps-from-the-attachment-menu" name="launching-web-apps-from-the-attachment-menu"><i class="anchor-icon"></i></a>Launching Web Apps from the Attachment Menu</h4> +<h4><a class="anchor" name="launching-web-apps-from-the-attachment-menu" href="#launching-web-apps-from-the-attachment-menu"><i class="anchor-icon"></i></a>Launching Web Apps from the Attachment Menu</h4> <blockquote> -<p><strong>TL;DR:</strong> Web App Bots can request to be added directly to a user's attachment menu, allowing them to be quickly launched from any chat. To try this mode, open this <a href="https://t.me/durgerkingbot?startattach">attachment menu link</a> for <em>@DurgerKingBot</em>, then use the <img src="/file/464001085/2/E4hNXSNQimQ.2503/bf6ffcab3cb3afd43d" alt="Attach"> menu in <strong>any type of chat</strong>.</p> +<p><strong>TL;DR:</strong> Web App Bots can request to be added directly to a user's attachment menu, allowing them to be quickly launched from any chat. To try this mode, open this <a href="https://t.me/durgerkingbot?startattach">attachment menu link</a> for <em>@DurgerKingBot</em>, then use the <img class="icon" src="/file/464001085/2/E4hNXSNQimQ.2503/bf6ffcab3cb3afd43d" alt="Attach"> menu in <strong>any type of chat</strong>.</p> </blockquote> -<p>Web App Bots can request to be added directly to a user's attachment menu, allowing them to be quickly launched from <strong>any type of chat</strong>. You can configure in which types of chats your web app can be started from the attachment menu (private, groups, supergroups or channels).</p> -<p>Attachment menu integration is currently only available for major advertisers on the <a href="https://promote.telegram.org/basics">Telegram Ad Platform</a>. However, <strong>all bots</strong> can use it in the <a href="#using-bots-in-the-test-environment">test server environment</a>.</p> -<p>To enable this feature for your bot, open <a href="https://t.me/botfather">@BotFather</a> <a href="#using-bots-in-the-test-environment">from an account on the test server</a> and send the <code>/setattach</code> command – or go to <em>Bot Settings > Configure Attachment Menu</em>. Then specify the URL that will be opened to launch the bot's Web App via its icon in the attachment menu.</p> -<p>You can add a 'Settings' item to the context menu of your Web App using <a href="https://t.me/botfather">@BotFather</a>. When users select this option from the menu, your bot will receive a <code>settingsButtonClicked</code> event.</p> -<p>In addition to the user's <a href="#color-schemes">theme settings</a>, the bot will receive basic user information (<code>ID</code>, <code>name</code>, <code>username</code>, <code>language_code</code>, <code>photo</code>), as well as public info about the chat partner (<code>ID</code>, <code>name</code>, <code>username</code>, <code>photo</code>) or the chat info (<code>ID</code>, <code>type</code>, <code>title</code>, <code>username</code>, <code>photo</code>) and a unique identifier for the web view session <strong>query_id</strong>, which allows messages of any type to be sent to the chat on behalf of the user that opened the bot.</p> +<p>Web App Bots can request to be added directly to a user's attachment menu, allowing them to be quickly launched from <strong>any type of chat</strong>. You can configure in which types of chats your web app can be started from the attachment menu (private, groups, supergroups or channels).</p> +<p>Attachment menu integration is currently only available for major advertisers on the <a href="https://promote.telegram.org/basics">Telegram Ad Platform</a>. However, <strong>all bots</strong> can use it in the <a href="#using-bots-in-the-test-environment">test server environment</a>.</p> +<p>To enable this feature for your bot, open <a href="https://t.me/botfather">@BotFather</a> <a href="#using-bots-in-the-test-environment">from an account on the test server</a> and send the <code>/setattach</code> command – or go to <em>Bot Settings > Configure Attachment Menu</em>. Then specify the URL that will be opened to launch the bot's Web App via its icon in the attachment menu.</p> +<p>You can add a 'Settings' item to the context menu of your Web App using <a href="https://t.me/botfather">@BotFather</a>. When users select this option from the menu, your bot will receive a <code>settingsButtonClicked</code> event.</p> +<p>In addition to the user's <a href="#color-schemes">theme settings</a>, the bot will receive basic user information (<code>ID</code>, <code>name</code>, <code>username</code>, <code>language_code</code>, <code>photo</code>), as well as public info about the chat partner (<code>ID</code>, <code>name</code>, <code>username</code>, <code>photo</code>) or the chat info (<code>ID</code>, <code>type</code>, <code>title</code>, <code>username</code>, <code>photo</code>) and a unique identifier for the web view session <strong>query_id</strong>, which allows messages of any type to be sent to the chat on behalf of the user that opened the bot.</p> <p>The bot can call the Bot API method <a href="/bots/api#answerwebappquery">answerWebAppQuery</a>, which sends an inline message from the user via the bot to the chat where it was launched and closes the Web App.</p> <blockquote> <p>You can read more about adding bots to the attachment menu <a href="#adding-bots-to-the-attachment-menu">here</a>.</p> </blockquote> <hr> -<h3><a class="anchor" href="#initializing-web-apps" id="initializing-web-apps" name="initializing-web-apps"><i class="anchor-icon"></i></a>Initializing Web Apps</h3> +<h3><a class="anchor" name="initializing-web-apps" href="#initializing-web-apps"><i class="anchor-icon"></i></a>Initializing Web Apps</h3> <p>To connect your Web App to the Telegram client, place the script <a href="https://telegram.org/js/telegram-web-app.js">telegram-web-app.js</a> in the <code><head></code> tag before any other scripts, using this code:</p> -<pre><code><script src="https://telegram.org/js/telegram-web-app.js"></script></code></pre> +<pre><code><script src="https://telegram.org/js/telegram-web-app.js"></script></code></pre> <p>Once the script is connected, a <code>window.Telegram.WebApp</code> object will become available with the following fields:</p> <table class="table"> <thead> @@ -213,27 +216,27 @@ <tr> <td>initData</td> <td>String</td> -<td>A string with raw data transferred to the Web App, convenient for <a href="#validating-data-received-via-the-web-app">validating data</a>.<br><strong>WARNING:</strong> <a href="#validating-data-received-via-the-web-app">Validate data</a> from this field before using it on the bot's server.</td> +<td>A string with raw data transferred to the Web App, convenient for <a href="#validating-data-received-via-the-web-app">validating data</a>.<br><strong>WARNING:</strong> <a href="#validating-data-received-via-the-web-app">Validate data</a> from this field before using it on the bot's server.</td> </tr> <tr> <td>initDataUnsafe</td> <td><a href="#webappinitdata">WebAppInitData</a></td> -<td>An object with input data transferred to the Web App.<br><strong>WARNING:</strong> Data from this field should not be trusted. You should only use data from <em>initData</em> on the bot's server and only after it has been <a href="#validating-data-received-via-the-web-app">validated</a>.</td> +<td>An object with input data transferred to the Web App.<br><strong>WARNING:</strong> Data from this field should not be trusted. You should only use data from <em>initData</em> on the bot's server and only after it has been <a href="#validating-data-received-via-the-web-app">validated</a>.</td> </tr> <tr> <td>version</td> <td>String</td> -<td>The version of the Bot API available in the user's Telegram app.</td> +<td>The version of the Bot API available in the user's Telegram app.</td> </tr> <tr> <td>platform</td> <td>String</td> -<td>The name of the platform of the user's Telegram app.</td> +<td>The name of the platform of the user's Telegram app.</td> </tr> <tr> <td>colorScheme</td> <td>String</td> -<td>The color scheme currently used in the Telegram app. Either “light” or “dark”. <br>Also available as the CSS variable <code>var(--tg-color-scheme)</code>.</td> +<td>The color scheme currently used in the Telegram app. Either “light” or “dark”.<br>Also available as the CSS variable <code>var(--tg-color-scheme)</code>.</td> </tr> <tr> <td>themeParams</td> @@ -248,12 +251,12 @@ <tr> <td>viewportHeight</td> <td>Float</td> -<td>The current height of the visible area of the Web App. Also available in CSS as the variable <code>var(--tg-viewport-height)</code>. <br><br>The application can display just the top part of the Web App, with its lower part remaining outside the screen area. From this position, the user can "pull" the Web App to its maximum height, while the bot can do the same by calling the <strong>expand()</strong> method. As the position of the Web App changes, the current height value of the visible area will be updated in real time.<br><br>Please note that the refresh rate of this value is not sufficient to smoothly follow the lower border of the window. It should not be used to pin interface elements to the bottom of the visible area. It's more appropriate to use the value of the <code>viewportStableHeight</code> field for this purpose.</td> +<td>The current height of the visible area of the Web App. Also available in CSS as the variable <code>var(--tg-viewport-height)</code>.<br><br>The application can display just the top part of the Web App, with its lower part remaining outside the screen area. From this position, the user can “pull” the Web App to its maximum height, while the bot can do the same by calling the <strong>expand()</strong> method. As the position of the Web App changes, the current height value of the visible area will be updated in real time.<br><br>Please note that the refresh rate of this value is not sufficient to smoothly follow the lower border of the window. It should not be used to pin interface elements to the bottom of the visible area. It's more appropriate to use the value of the <code>viewportStableHeight</code> field for this purpose.</td> </tr> <tr> <td>viewportStableHeight</td> <td>Float</td> -<td>The height of the visible area of the Web App in its last stable state. Also available in CSS as a variable <code>var(--tg-viewport-stable-height)</code>.<br><br>The application can display just the top part of the Web App, with its lower part remaining outside the screen area. From this position, the user can "pull" the Web App to its maximum height, while the bot can do the same by calling the <strong>expand()</strong> method. Unlike the value of <code>viewportHeight</code>, the value of <code>viewportStableHeight</code> does not change as the position of the Web App changes with user gestures or during animations. The value of <code>viewportStableHeight</code> will be updated after all gestures and animations are completed and the Web App reaches its final size.<br><br><em>Note the <a href="#events-available-for-web-apps">event</a> <code>viewportChanged</code> with the passed parameter <code>isStateStable=true</code>, which will allow you to track when the stable state of the height of the visible area changes.</em></td> +<td>The height of the visible area of the Web App in its last stable state. Also available in CSS as a variable <code>var(--tg-viewport-stable-height)</code>.<br><br>The application can display just the top part of the Web App, with its lower part remaining outside the screen area. From this position, the user can “pull” the Web App to its maximum height, while the bot can do the same by calling the <strong>expand()</strong> method. Unlike the value of <code>viewportHeight</code>, the value of <code>viewportStableHeight</code> does not change as the position of the Web App changes with user gestures or during animations. The value of <code>viewportStableHeight</code> will be updated after all gestures and animations are completed and the Web App reaches its final size.<br><br><em>Note the <a href="#events-available-for-web-apps">event</a> <code>viewportChanged</code> with the passed parameter <code>isStateStable=true</code>, which will allow you to track when the stable state of the height of the visible area changes.</em></td> </tr> <tr> <td>headerColor</td> @@ -288,27 +291,27 @@ <tr> <td>isVersionAtLeast(version)</td> <td>Function</td> -<td>Returns true if the user's app supports a version of the Bot API that is equal to or higher than the version passed as the parameter.</td> +<td>Returns true if the user's app supports a version of the Bot API that is equal to or higher than the version passed as the parameter.</td> </tr> <tr> <td>setHeaderColor(color)</td> <td>Function</td> -<td>==Bot API 6.1+== A method that sets the app header color. You can only pass <em>Telegram.WebApp.themeParams.bg_color</em> or <em>Telegram.WebApp.themeParams.secondary_bg_color</em> as a color or you can use keywords <em>bg_color</em>, <em>secondary_bg_color</em> instead.</td> +<td><mark>Bot API 6.1+</mark> A method that sets the app header color. You can only pass <em>Telegram.WebApp.themeParams.bg_color</em> or <em>Telegram.WebApp.themeParams.secondary_bg_color</em> as a color or you can use keywords <em>bg_color</em>, <em>secondary_bg_color</em> instead.</td> </tr> <tr> <td>setBackgroundColor(color)</td> <td>Function</td> -<td>==Bot API 6.1+== A method that sets the app background color in the <code>#RRGGBB</code> format or you can use keywords <em>bg_color</em>, <em>secondary_bg_color</em> instead.</td> +<td><mark>Bot API 6.1+</mark> A method that sets the app background color in the <code>#RRGGBB</code> format or you can use keywords <em>bg_color</em>, <em>secondary_bg_color</em> instead.</td> </tr> <tr> <td>enableClosingConfirmation()</td> <td>Function</td> -<td>==Bot API 6.2+== A method that enables a confirmation dialog while the user is trying to close the Web App.</td> +<td><mark>Bot API 6.2+</mark> A method that enables a confirmation dialog while the user is trying to close the Web App.</td> </tr> <tr> <td>disableClosingConfirmation()</td> <td>Function</td> -<td>==Bot API 6.2+== A method that disables the confirmation dialog while the user is trying to close the Web App.</td> +<td><mark>Bot API 6.2+</mark> A method that disables the confirmation dialog while the user is trying to close the Web App.</td> </tr> <tr> <td>onEvent(eventType, eventHandler)</td> @@ -326,14 +329,14 @@ <td>A method used to send data to the bot. When this method is called, a service message is sent to the bot containing the data <em>data</em> of the length up to 4096 bytes, and the Web App is closed. See the field <em>web_app_data</em> in the class <a href="/bots/api#message">Message</a>.<br><br><em>This method is only available for Web Apps launched via a <a href="#keyboard-button-web-apps">Keyboard button</a>.</em></td> </tr> <tr> -<td>switchInlineQuery(query[, choose_chat_types]) ^==NEW==^</td> +<td>switchInlineQuery(query[, choose_chat_types]) <sup><mark>NEW</mark></sup></td> <td>Function</td> -<td>==Bot API 6.7+== A method that inserts the bot's username and the specified inline <em>query</em> in the current chat's input field. Query may be empty, in which case only the bot's username will be inserted. If an optional <em>choose_chat_types</em> parameter was passed, the client prompts the user to choose a specific chat, then opens that chat and inserts the bot's username and the specified inline query in the input field. You can specify which types of chats the user will be able to choose from. It can be one or more of the following types: <em>users</em>, <em>bots</em>, <em>groups</em>, <em>channels</em>.</td> +<td><mark>Bot API 6.7+</mark> A method that inserts the bot's username and the specified inline <em>query</em> in the current chat's input field. Query may be empty, in which case only the bot's username will be inserted. If an optional <em>choose_chat_types</em> parameter was passed, the client prompts the user to choose a specific chat, then opens that chat and inserts the bot's username and the specified inline query in the input field. You can specify which types of chats the user will be able to choose from. It can be one or more of the following types: <em>users</em>, <em>bots</em>, <em>groups</em>, <em>channels</em>.</td> </tr> <tr> <td>openLink(url[, options])</td> <td>Function</td> -<td>A method that opens a link in an external browser. The Web App will <em>not</em> be closed. <br>==Bot API 6.4+== If the optional <em>options</em> parameter is passed with the field <em>try_instant_view=true</em>, the link will be opened in <a href="https://instantview.telegram.org/">Instant View</a> mode if possible. <br><br><em>Note that this method can be called only in response to user interaction with the Web App interface (e.g. a click inside the Web App or on the main button)</em></td> +<td>A method that opens a link in an external browser. The Web App will <em>not</em> be closed.<br><mark>Bot API 6.4+</mark> If the optional <em>options</em> parameter is passed with the field <em>try_instant_view=true</em>, the link will be opened in <a href="https://instantview.telegram.org/">Instant View</a> mode if possible.<br><br><em>Note that this method can be called only in response to user interaction with the Web App interface (e.g. a click inside the Web App or on the main button)</em></td> </tr> <tr> <td>openTelegramLink(url)</td> @@ -343,42 +346,42 @@ <tr> <td>openInvoice(url[, callback])</td> <td>Function</td> -<td>==Bot API 6.1+== A method that opens an invoice using the link <em>url</em>. The Web App will receive the <a href="#events-available-for-web-apps">event</a> <em>invoiceClosed</em> when the invoice is closed. If an optional <em>callback</em> parameter was passed, the <em>callback</em> function will be called and the invoice status will be passed as the first argument.</td> +<td><mark>Bot API 6.1+</mark> A method that opens an invoice using the link <em>url</em>. The Web App will receive the <a href="#events-available-for-web-apps">event</a> <em>invoiceClosed</em> when the invoice is closed. If an optional <em>callback</em> parameter was passed, the <em>callback</em> function will be called and the invoice status will be passed as the first argument.</td> </tr> <tr> <td>showPopup(params[, callback])</td> <td>Function</td> -<td>==Bot API 6.2+== A method that shows a native popup described by the <em>params</em> argument of the type <a href="#popupparams">PopupParams</a>. The Web App will receive the <a href="#events-available-for-web-apps">event</a> <em>popupClosed</em> when the popup is closed. If an optional <em>callback</em> parameter was passed, the <em>callback</em> function will be called and the field <em>id</em> of the pressed button will be passed as the first argument.</td> +<td><mark>Bot API 6.2+</mark> A method that shows a native popup described by the <em>params</em> argument of the type <a href="#popupparams">PopupParams</a>. The Web App will receive the <a href="#events-available-for-web-apps">event</a> <em>popupClosed</em> when the popup is closed. If an optional <em>callback</em> parameter was passed, the <em>callback</em> function will be called and the field <em>id</em> of the pressed button will be passed as the first argument.</td> </tr> <tr> <td>showAlert(message[, callback])</td> <td>Function</td> -<td>==Bot API 6.2+== A method that shows <em>message</em> in a simple alert with a 'Close' button. If an optional <em>callback</em> parameter was passed, the <em>callback</em> function will be called when the popup is closed.</td> +<td><mark>Bot API 6.2+</mark> A method that shows <em>message</em> in a simple alert with a 'Close' button. If an optional <em>callback</em> parameter was passed, the <em>callback</em> function will be called when the popup is closed.</td> </tr> <tr> <td>showConfirm(message[, callback])</td> <td>Function</td> -<td>==Bot API 6.2+== A method that shows <em>message</em> in a simple confirmation window with 'OK' and 'Cancel' buttons. If an optional <em>callback</em> parameter was passed, the <em>callback</em> function will be called when the popup is closed and the first argument will be a boolean indicating whether the user pressed the 'OK' button.</td> +<td><mark>Bot API 6.2+</mark> A method that shows <em>message</em> in a simple confirmation window with 'OK' and 'Cancel' buttons. If an optional <em>callback</em> parameter was passed, the <em>callback</em> function will be called when the popup is closed and the first argument will be a boolean indicating whether the user pressed the 'OK' button.</td> </tr> <tr> <td>showScanQrPopup(params[, callback])</td> <td>Function</td> -<td>==Bot API 6.4+== A method that shows a native popup for scanning a QR code described by the <em>params</em> argument of the type <a href="#scanqrpopupparams">ScanQrPopupParams</a>. The Web App will receive the <a href="#events-available-for-web-apps">event</a> <em>qrTextReceived</em> every time the scanner catches a code with text data. If an optional <em>callback</em> parameter was passed, the <em>callback</em> function will be called and the text from the QR code will be passed as the first argument. Returning <em>true</em> inside this callback function causes the popup to be closed.</td> +<td><mark>Bot API 6.4+</mark> A method that shows a native popup for scanning a QR code described by the <em>params</em> argument of the type <a href="#scanqrpopupparams">ScanQrPopupParams</a>. The Web App will receive the <a href="#events-available-for-web-apps">event</a> <em>qrTextReceived</em> every time the scanner catches a code with text data. If an optional <em>callback</em> parameter was passed, the <em>callback</em> function will be called and the text from the QR code will be passed as the first argument. Returning <em>true</em> inside this callback function causes the popup to be closed.</td> </tr> <tr> <td>closeScanQrPopup()</td> <td>Function</td> -<td>==Bot API 6.4+== A method that closes the native popup for scanning a QR code opened with the <em>showScanQrPopup</em> method. Run it if you received valid data in the <a href="#events-available-for-web-apps">event</a> <em>qrTextReceived</em>.</td> +<td><mark>Bot API 6.4+</mark> A method that closes the native popup for scanning a QR code opened with the <em>showScanQrPopup</em> method. Run it if you received valid data in the <a href="#events-available-for-web-apps">event</a> <em>qrTextReceived</em>.</td> </tr> <tr> <td>readTextFromClipboard([callback])</td> <td>Function</td> -<td>==Bot API 6.4+== A method that requests text from the clipboard. The Web App will receive the <a href="#events-available-for-web-apps">event</a> <em>clipboardTextReceived</em>. If an optional <em>callback</em> parameter was passed, the <em>callback</em> function will be called and the text from the clipboard will be passed as the first argument.<br><br><em>Note: this method can be called only for Web Apps launched from the attachment menu and only in response to a user interaction with the Web App interface (e.g. a click inside the Web App or on the main button).</em></td> +<td><mark>Bot API 6.4+</mark> A method that requests text from the clipboard. The Web App will receive the <a href="#events-available-for-web-apps">event</a> <em>clipboardTextReceived</em>. If an optional <em>callback</em> parameter was passed, the <em>callback</em> function will be called and the text from the clipboard will be passed as the first argument.<br><br><em>Note: this method can be called only for Web Apps launched from the attachment menu and only in response to a user interaction with the Web App interface (e.g. a click inside the Web App or on the main button).</em></td> </tr> <tr> <td>ready()</td> <td>Function</td> -<td>A method that informs the Telegram app that the Web App is ready to be displayed. <br>It is recommended to call this method as early as possible, as soon as all essential interface elements are loaded. Once this method is called, the loading placeholder is hidden and the Web App is shown. <br>If the method is not called, the placeholder will be hidden only when the page is fully loaded.</td> +<td>A method that informs the Telegram app that the Web App is ready to be displayed.<br>It is recommended to call this method as early as possible, as soon as all essential interface elements are loaded. Once this method is called, the loading placeholder is hidden and the Web App is shown.<br>If the method is not called, the placeholder will be hidden only when the page is fully loaded.</td> </tr> <tr> <td>expand()</td> @@ -392,8 +395,8 @@ </tr> </tbody> </table> -<h4><a class="anchor" href="#themeparams" id="themeparams" name="themeparams"><i class="anchor-icon"></i></a>ThemeParams</h4> -<p>Web Apps can <a href="#color-schemes">adjust the appearance</a> of the interface to match the Telegram user's app in real time. This object contains the user's current theme settings:</p> +<h4><a class="anchor" name="themeparams" href="#themeparams"><i class="anchor-icon"></i></a>ThemeParams</h4> +<p>Web Apps can <a href="#color-schemes">adjust the appearance</a> of the interface to match the Telegram user's app in real time. This object contains the user's current theme settings:</p> <table class="table"> <thead> <tr> @@ -406,44 +409,45 @@ <tr> <td>bg_color</td> <td>String</td> -<td><em>Optional</em>. Background color in the <code>#RRGGBB</code> format. <br>Also available as the CSS variable <code>var(--tg-theme-bg-color)</code>.</td> +<td><em>Optional</em>. Background color in the <code>#RRGGBB</code> format.<br>Also available as the CSS variable <code>var(--tg-theme-bg-color)</code>.</td> </tr> <tr> <td>text_color</td> <td>String</td> -<td><em>Optional</em>. Main text color in the <code>#RRGGBB</code> format. <br>Also available as the CSS variable <code>var(--tg-theme-text-color)</code>.</td> +<td><em>Optional</em>. Main text color in the <code>#RRGGBB</code> format.<br>Also available as the CSS variable <code>var(--tg-theme-text-color)</code>.</td> </tr> <tr> <td>hint_color</td> <td>String</td> -<td><em>Optional</em>. Hint text color in the <code>#RRGGBB</code> format. <br>Also available as the CSS variable <code>var(--tg-theme-hint-color)</code>.</td> +<td><em>Optional</em>. Hint text color in the <code>#RRGGBB</code> format.<br>Also available as the CSS variable <code>var(--tg-theme-hint-color)</code>.</td> </tr> <tr> <td>link_color</td> <td>String</td> -<td><em>Optional</em>. Link color in the <code>#RRGGBB</code> format. <br>Also available as the CSS variable <code>var(--tg-theme-link-color)</code>.</td> +<td><em>Optional</em>. Link color in the <code>#RRGGBB</code> format.<br>Also available as the CSS variable <code>var(--tg-theme-link-color)</code>.</td> </tr> <tr> <td>button_color</td> <td>String</td> -<td><em>Optional</em>. Button color in the <code>#RRGGBB</code> format. <br>Also available as the CSS variable <code>var(--tg-theme-button-color)</code>.</td> +<td><em>Optional</em>. Button color in the <code>#RRGGBB</code> format.<br>Also available as the CSS variable <code>var(--tg-theme-button-color)</code>.</td> </tr> <tr> <td>button_text_color</td> <td>String</td> -<td><em>Optional</em>. Button text color in the <code>#RRGGBB</code> format. <br>Also available as the CSS variable <code>var(--tg-theme-button-text-color)</code>.</td> +<td><em>Optional</em>. Button text color in the <code>#RRGGBB</code> format.<br>Also available as the CSS variable <code>var(--tg-theme-button-text-color)</code>.</td> </tr> <tr> <td>secondary_bg_color</td> <td>String</td> -<td><em>Optional</em>. ==Bot API 6.1+== Secondary background color in the <code>#RRGGBB</code> format. <br>Also available as the CSS variable <code>var(--tg-theme-secondary-bg-color)</code>.</td> +<td><em>Optional</em>. <mark>Bot API 6.1+</mark> Secondary background color in the <code>#RRGGBB</code> format.<br>Also available as the CSS variable <code>var(--tg-theme-secondary-bg-color)</code>.</td> </tr> </tbody> </table> <div> - <a href="/file/464001695/11185/DAwyUjA7LNA.215601/26f4c8ebf862ae860d" target="_blank"><img src="/file/464001695/11185/DAwyUjA7LNA.215601/26f4c8ebf862ae860d" title="WebViewColors explained" class="dev_page_image"></a> + <a href="/file/464001695/11185/DAwyUjA7LNA.215601/26f4c8ebf862ae860d" target="_blank"><img src="/file/464001695/11185/DAwyUjA7LNA.215601/26f4c8ebf862ae860d" title="WebViewColors explained" class="dev_page_image" /></a> </div> -<h4><a class="anchor" href="#popupparams" id="popupparams" name="popupparams"><i class="anchor-icon"></i></a>PopupParams</h4> + +<h4><a class="anchor" name="popupparams" href="#popupparams"><i class="anchor-icon"></i></a>PopupParams</h4> <p>This object describes the native popup.</p> <table class="table"> <thead> @@ -467,11 +471,11 @@ <tr> <td>buttons</td> <td>Array of <a href="#popupbutton">PopupButton</a></td> -<td><em>Optional</em>. List of buttons to be displayed in the popup, 1-3 buttons. Set to <em>[{"type":"close"}]</em> by default.</td> +<td><em>Optional</em>. List of buttons to be displayed in the popup, 1-3 buttons. Set to <em>[{“type”:“close”}]</em> by default.</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#scanqrpopupparams" id="scanqrpopupparams" name="scanqrpopupparams"><i class="anchor-icon"></i></a>ScanQrPopupParams</h4> +<h4><a class="anchor" name="scanqrpopupparams" href="#scanqrpopupparams"><i class="anchor-icon"></i></a>ScanQrPopupParams</h4> <p>This object describes the native popup for scanning QR codes.</p> <table class="table"> <thead> @@ -485,11 +489,11 @@ <tr> <td>text</td> <td>String</td> -<td><em>Optional</em>. The text to be displayed under the 'Scan QR' heading, 0-64 characters.</td> +<td><em>Optional</em>. The text to be displayed under the 'Scan QR' heading, 0-64 characters.</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#popupbutton" id="popupbutton" name="popupbutton"><i class="anchor-icon"></i></a>PopupButton</h4> +<h4><a class="anchor" name="popupbutton" href="#popupbutton"><i class="anchor-icon"></i></a>PopupButton</h4> <p>This object describes the native popup button.</p> <table class="table"> <thead> @@ -503,12 +507,12 @@ <tr> <td>id</td> <td>String</td> -<td><em>Optional</em>. Identifier of the button, 0-64 characters. Set to empty string by default. <br>If the button is pressed, its <em>id</em> is returned in the callback and the <em>popupClosed</em> event.</td> +<td><em>Optional</em>. Identifier of the button, 0-64 characters. Set to empty string by default.<br>If the button is pressed, its <em>id</em> is returned in the callback and the <em>popupClosed</em> event.</td> </tr> <tr> <td>type</td> <td>String</td> -<td><em>Optional</em>. Type of the button. Set to <em>default</em> by default. <br>Can be one of these values: <br>- <em>default</em>, a button with the default style, <br>- <em>ok</em>, a button with the localized text "OK", <br>- <em>close</em>, a button with the localized text "Close", <br>- <em>cancel</em>, a button with the localized text "Cancel", <br>- <em>destructive</em>, a button with a style that indicates a destructive action (e.g. "Remove", "Delete", etc.).</td> +<td><em>Optional</em>. Type of the button. Set to <em>default</em> by default.<br>Can be one of these values:<br>- <em>default</em>, a button with the default style,<br>- <em>ok</em>, a button with the localized text “OK”,<br>- <em>close</em>, a button with the localized text “Close”,<br>- <em>cancel</em>, a button with the localized text “Cancel”,<br>- <em>destructive</em>, a button with a style that indicates a destructive action (e.g. “Remove”, “Delete”, etc.).</td> </tr> <tr> <td>text</td> @@ -517,7 +521,7 @@ </tr> </tbody> </table> -<h4><a class="anchor" href="#backbutton" id="backbutton" name="backbutton"><i class="anchor-icon"></i></a>BackButton</h4> +<h4><a class="anchor" name="backbutton" href="#backbutton"><i class="anchor-icon"></i></a>BackButton</h4> <p>This object controls the <strong>back</strong> button, which can be displayed in the header of the Web App in the Telegram interface.</p> <table class="table"> <thead> @@ -536,27 +540,27 @@ <tr> <td>onClick(callback)</td> <td>Function</td> -<td>==Bot API 6.1+== A method that sets the button press event handler. An alias for <code>Telegram.WebApp.onEvent('backButtonClicked', callback)</code></td> +<td><mark>Bot API 6.1+</mark> A method that sets the button press event handler. An alias for <code>Telegram.WebApp.onEvent('backButtonClicked', callback)</code></td> </tr> <tr> <td>offClick(callback)</td> <td>Function</td> -<td>==Bot API 6.1+== A method that removes the button press event handler. An alias for <code>Telegram.WebApp.offEvent('backButtonClicked', callback)</code></td> +<td><mark>Bot API 6.1+</mark> A method that removes the button press event handler. An alias for <code>Telegram.WebApp.offEvent('backButtonClicked', callback)</code></td> </tr> <tr> <td>show()</td> <td>Function</td> -<td>==Bot API 6.1+== A method to make the button active and visible.</td> +<td><mark>Bot API 6.1+</mark> A method to make the button active and visible.</td> </tr> <tr> <td>hide()</td> <td>Function</td> -<td>==Bot API 6.1+== A method to hide the button.</td> +<td><mark>Bot API 6.1+</mark> A method to hide the button.</td> </tr> </tbody> </table> <p>All these methods return the BackButton object so they can be chained.</p> -<h4><a class="anchor" href="#mainbutton" id="mainbutton" name="mainbutton"><i class="anchor-icon"></i></a>MainButton</h4> +<h4><a class="anchor" name="mainbutton" href="#mainbutton"><i class="anchor-icon"></i></a>MainButton</h4> <p>This object controls the main button, which is displayed at the bottom of the Web App in the Telegram interface.</p> <table class="table"> <thead> @@ -605,17 +609,17 @@ <tr> <td>onClick(callback)</td> <td>Function</td> -<td>A method that sets the button press event handler. An alias for <code>Telegram.WebApp.onEvent('mainButtonClicked', callback)</code></td> +<td>A method that sets the button press event handler. An alias for <code>Telegram.WebApp.onEvent('mainButtonClicked', callback)</code></td> </tr> <tr> <td>offClick(callback)</td> <td>Function</td> -<td>A method that removes the button press event handler. An alias for <code>Telegram.WebApp.offEvent('mainButtonClicked', callback)</code></td> +<td>A method that removes the button press event handler. An alias for <code>Telegram.WebApp.offEvent('mainButtonClicked', callback)</code></td> </tr> <tr> <td>show()</td> <td>Function</td> -<td>A method to make the button visible. <br><em>Note that opening the Web App from the <a href="#launching-web-apps-from-the-attachment-menu">attachment menu</a> hides the main button until the user interacts with the Web App interface.</em></td> +<td>A method to make the button visible.<br><em>Note that opening the Web App from the <a href="#launching-web-apps-from-the-attachment-menu">attachment menu</a> hides the main button until the user interacts with the Web App interface.</em></td> </tr> <tr> <td>hide()</td> @@ -635,7 +639,7 @@ <tr> <td>showProgress(leaveActive)</td> <td>Function</td> -<td>A method to show a loading indicator on the button. <br>It is recommended to display loading progress if the action tied to the button may take a long time. By default, the button is disabled while the action is in progress. If the parameter <code>leaveActive=true</code> is passed, the button remains enabled.</td> +<td>A method to show a loading indicator on the button.<br>It is recommended to display loading progress if the action tied to the button may take a long time. By default, the button is disabled while the action is in progress. If the parameter <code>leaveActive=true</code> is passed, the button remains enabled.</td> </tr> <tr> <td>hideProgress()</td> @@ -645,12 +649,12 @@ <tr> <td>setParams(params)</td> <td>Function</td> -<td>A method to set the button parameters. The <em>params</em> parameter is an object containing one or several fields that need to be changed: <br><strong>text</strong> - button text; <br><strong>color</strong> - button color; <br><strong>text_color</strong> - button text color; <br><strong>is_active</strong> - enable the button; <br><strong>is_visible</strong> - show the button.</td> +<td>A method to set the button parameters. The <em>params</em> parameter is an object containing one or several fields that need to be changed:<br><strong>text</strong> - button text;<br><strong>color</strong> - button color;<br><strong>text_color</strong> - button text color;<br><strong>is_active</strong> - enable the button;<br><strong>is_visible</strong> - show the button.</td> </tr> </tbody> </table> <p>All these methods return the MainButton object so they can be chained.</p> -<h4><a class="anchor" href="#hapticfeedback" id="hapticfeedback" name="hapticfeedback"><i class="anchor-icon"></i></a>HapticFeedback</h4> +<h4><a class="anchor" name="hapticfeedback" href="#hapticfeedback"><i class="anchor-icon"></i></a>HapticFeedback</h4> <p>This object controls haptic feedback.</p> <table class="table"> <thead> @@ -664,22 +668,22 @@ <tr> <td>impactOccurred(style)</td> <td>Function</td> -<td>==Bot API 6.1+== A method tells that an impact occurred. The Telegram app may play the appropriate haptics based on style value passed. Style can be one of these values: <br>- <em>light</em>, indicates a collision between small or lightweight UI objects, <br>- <em>medium</em>, indicates a collision between medium-sized or medium-weight UI objects, <br>- <em>heavy</em>, indicates a collision between large or heavyweight UI objects, <br>- <em>rigid</em>, indicates a collision between hard or inflexible UI objects, <br>- <em>soft</em>, indicates a collision between soft or flexible UI objects.</td> +<td><mark>Bot API 6.1+</mark> A method tells that an impact occurred. The Telegram app may play the appropriate haptics based on style value passed. Style can be one of these values:<br>- <em>light</em>, indicates a collision between small or lightweight UI objects,<br>- <em>medium</em>, indicates a collision between medium-sized or medium-weight UI objects,<br>- <em>heavy</em>, indicates a collision between large or heavyweight UI objects,<br>- <em>rigid</em>, indicates a collision between hard or inflexible UI objects,<br>- <em>soft</em>, indicates a collision between soft or flexible UI objects.</td> </tr> <tr> <td>notificationOccurred(type)</td> <td>Function</td> -<td>==Bot API 6.1+== A method tells that a task or action has succeeded, failed, or produced a warning. The Telegram app may play the appropriate haptics based on type value passed. Type can be one of these values: <br>- <em>error</em>, indicates that a task or action has failed, <br>- <em>success</em>, indicates that a task or action has completed successfully, <br>- <em>warning</em>, indicates that a task or action produced a warning.</td> +<td><mark>Bot API 6.1+</mark> A method tells that a task or action has succeeded, failed, or produced a warning. The Telegram app may play the appropriate haptics based on type value passed. Type can be one of these values:<br>- <em>error</em>, indicates that a task or action has failed,<br>- <em>success</em>, indicates that a task or action has completed successfully,<br>- <em>warning</em>, indicates that a task or action produced a warning.</td> </tr> <tr> <td>selectionChanged()</td> <td>Function</td> -<td>==Bot API 6.1+== A method tells that the user has changed a selection. The Telegram app may play the appropriate haptics. <br><br><em>Do not use this feedback when the user makes or confirms a selection; use it only when the selection changes.</em></td> +<td><mark>Bot API 6.1+</mark> A method tells that the user has changed a selection. The Telegram app may play the appropriate haptics.<br><br><em>Do not use this feedback when the user makes or confirms a selection; use it only when the selection changes.</em></td> </tr> </tbody> </table> <p>All these methods return the HapticFeedback object so they can be chained.</p> -<h4><a class="anchor" href="#webappinitdata" id="webappinitdata" name="webappinitdata"><i class="anchor-icon"></i></a>WebAppInitData</h4> +<h4><a class="anchor" name="webappinitdata" href="#webappinitdata"><i class="anchor-icon"></i></a>WebAppInitData</h4> <p>This object contains data that is transferred to the Web App when it is opened. It is empty if the Web App was launched from a <a href="#keyboard-button-web-apps">keyboard button</a> or from <a href="#inline-mode-web-apps">inline mode</a>.</p> <table class="table"> <thead> @@ -711,19 +715,19 @@ <td><em>Optional.</em> An object containing data about the chat where the bot was launched via the attachment menu. Returned for supergroups, channels and group chats – only for Web Apps launched via the attachment menu.</td> </tr> <tr> -<td>chat_type ^==NEW==^</td> +<td>chat_type <sup><mark>NEW</mark></sup></td> <td>String</td> -<td><em>Optional.</em> Type of the chat from which the Web App was opened. Can be either "sender" for a private chat with the user opening the link, "private", "group", "supergroup", or "channel". Returned only for Web Apps launched from direct links.</td> +<td><em>Optional.</em> Type of the chat from which the Web App was opened. Can be either “sender” for a private chat with the user opening the link, “private”, “group”, “supergroup”, or “channel”. Returned only for Web Apps launched from direct links.</td> </tr> <tr> -<td>chat_instance ^==NEW==^</td> +<td>chat_instance <sup><mark>NEW</mark></sup></td> <td>String</td> <td><em>Optional.</em> Global identifier, uniquely corresponding to the chat from which the Web App was opened. Returned only for Web Apps launched from a direct link.</td> </tr> <tr> <td>start_param</td> <td>String</td> -<td><em>Optional.</em> The value of the <em>startattach</em> parameter, passed <a href="#adding-bots-to-the-attachment-menu">via link</a>. Only returned for Web Apps when launched from the attachment menu via link. <br><br>The value of the <code>start_param</code> parameter will also be passed in the GET-parameter <code>tgWebAppStartParam</code>, so the Web App can load the correct interface right away.</td> +<td><em>Optional.</em> The value of the <em>startattach</em> parameter, passed <a href="#adding-bots-to-the-attachment-menu">via link</a>. Only returned for Web Apps when launched from the attachment menu via link.<br><br>The value of the <code>start_param</code> parameter will also be passed in the GET-parameter <code>tgWebAppStartParam</code>, so the Web App can load the correct interface right away.</td> </tr> <tr> <td>can_send_after</td> @@ -742,7 +746,7 @@ </tr> </tbody> </table> -<h4><a class="anchor" href="#webappuser" id="webappuser" name="webappuser"><i class="anchor-icon"></i></a>WebAppUser</h4> +<h4><a class="anchor" name="webappuser" href="#webappuser"><i class="anchor-icon"></i></a>WebAppUser</h4> <p>This object contains the data of the Web App user.</p> <table class="table"> <thead> @@ -781,7 +785,7 @@ <tr> <td>language_code</td> <td>String</td> -<td><em>Optional</em>. <a href="https://en.wikipedia.org/wiki/IETF_language_tag">IETF language tag</a> of the user's language. Returns in <em>user</em> field only.</td> +<td><em>Optional</em>. <a href="https://en.wikipedia.org/wiki/IETF_language_tag">IETF language tag</a> of the user's language. Returns in <em>user</em> field only.</td> </tr> <tr> <td>is_premium</td> @@ -795,7 +799,7 @@ </tr> </tbody> </table> -<h4><a class="anchor" href="#webappchat" id="webappchat" name="webappchat"><i class="anchor-icon"></i></a>WebAppChat</h4> +<h4><a class="anchor" name="webappchat" href="#webappchat"><i class="anchor-icon"></i></a>WebAppChat</h4> <p>This object represents a chat.</p> <table class="table"> <thead> @@ -814,7 +818,7 @@ <tr> <td>type</td> <td>String</td> -<td>Type of chat, can be either "group", "supergroup" or "channel"</td> +<td>Type of chat, can be either “group”, “supergroup” or “channel”</td> </tr> <tr> <td>title</td> @@ -833,19 +837,19 @@ </tr> </tbody> </table> -<h4><a class="anchor" href="#validating-data-received-via-the-web-app" id="validating-data-received-via-the-web-app" name="validating-data-received-via-the-web-app"><i class="anchor-icon"></i></a>Validating data received via the Web App</h4> -<p>To validate data received via the Web App, one should send the data from the <em>Telegram.WebApp.initData</em> field to the bot's backend. The data is a query string, which is composed of a series of field-value pairs.</p> -<p>You can verify the integrity of the data received by comparing the received <em>hash</em> parameter with the hexadecimal representation of the <a href="https://en.wikipedia.org/wiki/Hash-based_message_authentication_code">HMAC-SHA-256</a> signature of the <strong>data-check-string</strong> with the secret key, which is the <a href="https://en.wikipedia.org/wiki/Hash-based_message_authentication_code">HMAC-SHA-256</a> signature of the <a href="/bots#creating-a-new-bot">bot's token</a> with the constant string <code>WebAppData</code> used as a key.</p> -<p><strong>Data-check-string</strong> is a chain of all received fields, sorted alphabetically, in the format <code>key=<value></code> with a <a href="https://en.wikipedia.org/wiki/Newline">line feed</a> character ('\n', 0x0A) used as separator – e.g., <code>'auth_date=<auth_date>\nquery_id=<query_id>\nuser=<user>'</code>.</p> +<h4><a class="anchor" name="validating-data-received-via-the-web-app" href="#validating-data-received-via-the-web-app"><i class="anchor-icon"></i></a>Validating data received via the Web App</h4> +<p>To validate data received via the Web App, one should send the data from the <em>Telegram.WebApp.initData</em> field to the bot's backend. The data is a query string, which is composed of a series of field-value pairs.</p> +<p>You can verify the integrity of the data received by comparing the received <em>hash</em> parameter with the hexadecimal representation of the <a href="https://en.wikipedia.org/wiki/Hash-based_message_authentication_code">HMAC-SHA-256</a> signature of the <strong>data-check-string</strong> with the secret key, which is the <a href="https://en.wikipedia.org/wiki/Hash-based_message_authentication_code">HMAC-SHA-256</a> signature of the <a href="/bots#creating-a-new-bot">bot's token</a> with the constant string <code>WebAppData</code> used as a key.</p> +<p><strong>Data-check-string</strong> is a chain of all received fields, sorted alphabetically, in the format <code>key=<value></code> with a <a href="https://en.wikipedia.org/wiki/Newline">line feed</a> character ('\n', 0x0A) used as separator – e.g., <code>'auth_date=<auth_date>\nquery_id=<query_id>\nuser=<user>'</code>.</p> <p>The full check might look like:</p> <pre><code>data_check_string = ... -<a href='/constructor/secret_key'>secret_key</a> = <a href='/type/HMAC_SHA256%28%3Cbot_token%26gt'>HMAC_SHA256(<bot_token></a>;, "WebAppData") +secret_key = HMAC_SHA256(<bot_token>, "WebAppData") if (hex(HMAC_SHA256(data_check_string, secret_key)) == hash) { // data is from Telegram }</code></pre> <p>To prevent the use of outdated data, you can additionally check the <em>auth_date</em> field, which contains a Unix timestamp of when it was received by the Web App.</p> <p>Once validated, the data may be used on your server. Complex data types are represented as JSON-serialized objects.</p> -<h4><a class="anchor" href="#events-available-for-web-apps" id="events-available-for-web-apps" name="events-available-for-web-apps"><i class="anchor-icon"></i></a>Events Available for Web Apps</h4> +<h4><a class="anchor" name="events-available-for-web-apps" href="#events-available-for-web-apps"><i class="anchor-icon"></i></a>Events Available for Web Apps</h4> <p>The Web App can receive events from the Telegram app, onto which a handler can be attached using the <code>Telegram.WebApp.onEvent(eventType, eventHandler)</code> method. Inside <code>eventHandler</code> the <em>this</em> object refers to <em>Telegram.WebApp</em>, the set of parameters sent to the handler depends on the event type. Below is a list of possible events:</p> <table class="table"> <thead> @@ -857,64 +861,58 @@ if (hex(HMAC_SHA256(data_check_string, secret_key)) == hash) { <tbody> <tr> <td><code>themeChanged</code></td> -<td>Occurs whenever theme settings are changed in the user's Telegram app (including switching to night mode). <br><em>eventHandler</em> receives no parameters, new theme settings and color scheme can be received via <em>this.themeParams</em> and <em>this.colorScheme</em> respectively.</td> +<td>Occurs whenever theme settings are changed in the user's Telegram app (including switching to night mode).<br><em>eventHandler</em> receives no parameters, new theme settings and color scheme can be received via <em>this.themeParams</em> and <em>this.colorScheme</em> respectively.</td> </tr> <tr> <td><code>viewportChanged</code></td> -<td>Occurs when the visible section of the Web App is changed. <br><em>eventHandler</em> receives an object with the single field <em>isStateStable</em>. If <em>isStateStable</em> is true, the resizing of the Web App is finished. If it is false, the resizing is ongoing (the user is expanding or collapsing the Web App or an animated object is playing). The current value of the visible section’s height is available in <em>this.viewportHeight</em>.</td> +<td>Occurs when the visible section of the Web App is changed.<br><em>eventHandler</em> receives an object with the single field <em>isStateStable</em>. If <em>isStateStable</em> is true, the resizing of the Web App is finished. If it is false, the resizing is ongoing (the user is expanding or collapsing the Web App or an animated object is playing). The current value of the visible section’s height is available in <em>this.viewportHeight</em>.</td> </tr> <tr> <td><code>mainButtonClicked</code></td> -<td>Occurs when the <a href="#mainbutton">main button</a> is pressed. <br><em>eventHandler</em> receives no parameters.</td> +<td>Occurs when the <a href="#mainbutton">main button</a> is pressed.<br><em>eventHandler</em> receives no parameters.</td> </tr> <tr> <td><code>backButtonClicked</code></td> -<td>==Bot API 6.1+== Occurrs when the <a href="#backbutton">back button</a> is pressed. <br><em>eventHandler</em> receives no parameters.</td> +<td><mark>Bot API 6.1+</mark> Occurrs when the <a href="#backbutton">back button</a> is pressed.<br><em>eventHandler</em> receives no parameters.</td> </tr> <tr> <td><code>settingsButtonClicked</code></td> -<td>==Bot API 6.1+== Occurrs when the Settings item in context menu is pressed. <br><em>eventHandler</em> receives no parameters.</td> +<td><mark>Bot API 6.1+</mark> Occurrs when the Settings item in context menu is pressed.<br><em>eventHandler</em> receives no parameters.</td> </tr> <tr> <td><code>invoiceClosed</code></td> -<td>==Bot API 6.1+== Occurrs when the opened invoice is closed. <br><em>eventHandler</em> receives an object with the two fields: <em>url</em> – invoice link provided and <em>status</em> – one of the invoice statuses: <br>- <strong>paid</strong> – invoice was paid successfully, <br>- <strong>cancelled</strong> – user closed this invoice without paying, <br>- <strong>failed</strong> – user tried to pay, but the payment was failed, <br>- <strong>pending</strong> – the payment is still processing. The bot will receive a service message about a <a href="https://core.telegram.org/bots/api#successfulpayment">successful payment</a> when the payment is successfully paid.</td> +<td><mark>Bot API 6.1+</mark> Occurrs when the opened invoice is closed.<br><em>eventHandler</em> receives an object with the two fields: <em>url</em> – invoice link provided and <em>status</em> – one of the invoice statuses:<br>- <strong>paid</strong> – invoice was paid successfully,<br>- <strong>cancelled</strong> – user closed this invoice without paying,<br>- <strong>failed</strong> – user tried to pay, but the payment was failed,<br>- <strong>pending</strong> – the payment is still processing. The bot will receive a service message about a <a href="https://core.telegram.org/bots/api#successfulpayment">successful payment</a> when the payment is successfully paid.</td> </tr> <tr> <td><code>popupClosed</code></td> -<td>==Bot API 6.2+== Occurrs when the opened popup is closed. <br><em>eventHandler</em> receives an object with the single field <em>button_id</em> – the value of the field <em>id</em> of the pressed button. If no buttons were pressed, the field <em>button_id</em> will be <em>null</em>.</td> +<td><mark>Bot API 6.2+</mark> Occurrs when the opened popup is closed.<br><em>eventHandler</em> receives an object with the single field <em>button_id</em> – the value of the field <em>id</em> of the pressed button. If no buttons were pressed, the field <em>button_id</em> will be <em>null</em>.</td> </tr> <tr> <td><code>qrTextReceived</code></td> -<td>==Bot API 6.4+== Occurs when the QR code scanner catches a code with text data. <br><em>eventHandler</em> receives an object with the single field <em>data</em> containing text data from the QR code.</td> +<td><mark>Bot API 6.4+</mark> Occurs when the QR code scanner catches a code with text data.<br><em>eventHandler</em> receives an object with the single field <em>data</em> containing text data from the QR code.</td> </tr> <tr> <td><code>clipboardTextReceived</code></td> -<td>==Bot API 6.4+== Occurrs when the <code>readTextFromClipboard</code> method is called. <br><em>eventHandler</em> receives an object with the single field <em>data</em> containing text data from the clipboard. If the clipboard contains non-text data, the field <em>data</em> will be an empty string. If the Web App has no access to the clipboard, the field <em>data</em> will be <em>null</em>.</td> +<td><mark>Bot API 6.4+</mark> Occurrs when the <code>readTextFromClipboard</code> method is called.<br><em>eventHandler</em> receives an object with the single field <em>data</em> containing text data from the clipboard. If the clipboard contains non-text data, the field <em>data</em> will be an empty string. If the Web App has no access to the clipboard, the field <em>data</em> will be <em>null</em>.</td> </tr> </tbody> </table> -<h4><a class="anchor" href="#adding-bots-to-the-attachment-menu" id="adding-bots-to-the-attachment-menu" name="adding-bots-to-the-attachment-menu"><i class="anchor-icon"></i></a>Adding Bots to the Attachment Menu</h4> -<p>Attachment menu integration is currently only available for major advertisers on the <a href="https://promote.telegram.org/basics">Telegram Ad Platform</a>. However, <strong>all bots</strong> can use it in the <a href="#using-bots-in-the-test-environment">test server environment</a>. Talk to Botfather on the test server to <a href="#using-bots-in-the-test-environment">set up the integration</a>.</p> +<h4><a class="anchor" name="adding-bots-to-the-attachment-menu" href="#adding-bots-to-the-attachment-menu"><i class="anchor-icon"></i></a>Adding Bots to the Attachment Menu</h4> +<p>Attachment menu integration is currently only available for major advertisers on the <a href="https://promote.telegram.org/basics">Telegram Ad Platform</a>. However, <strong>all bots</strong> can use it in the <a href="#using-bots-in-the-test-environment">test server environment</a>. Talk to Botfather on the test server to <a href="#using-bots-in-the-test-environment">set up the integration</a>.</p> <p>A special link is used to add bots to the attachment menu:</p> -<p><code>https://t.me/botusername?startattach</code> -or -<code>https://t.me/botusername?startattach=command</code></p> +<p><code>https://t.me/botusername?startattach</code><br>or<br><code>https://t.me/botusername?startattach=command</code></p> <blockquote> -<p>For example, open this <a href="https://t.me/durgerkingbot?startattach">attachment menu link</a> for <em>@DurgerKingBot</em>, then use the <img src="/file/464001085/2/E4hNXSNQimQ.2503/bf6ffcab3cb3afd43d" alt="Attach"> menu in any <strong>private chat</strong>.</p> +<p>For example, open this <a href="https://t.me/durgerkingbot?startattach">attachment menu link</a> for <em>@DurgerKingBot</em>, then use the <img class="icon" src="/file/464001085/2/E4hNXSNQimQ.2503/bf6ffcab3cb3afd43d" alt="Attach"> menu in any <strong>private chat</strong>.</p> </blockquote> <p>Opening the link prompts the user to add the bot to their attachment menu. If the bot has already been added, the attachment menu will open in the current chat and redirect to the bot there (if the link is opened from a 1-on-1 chat). If a non-empty <em>startattach</em> parameter was included in the link, it will be passed to the Web App in the <em>start_param</em> field and in the GET parameter <em>tgWebAppStartParam</em>.</p> <p>The following link formats are also supported:</p> -<p><code>https://t.me/username?attach=botusername</code> -<code>https://t.me/username?attach=botusername&startattach=command</code> -<code>https://t.me/+1234567890?attach=botusername</code> -<code>https://t.me/+1234567890?attach=botusername&startattach=command</code></p> -<p>These links open the Web App in the attachment menu in the chat with a specific user. If the bot wasn't already added to the attachment menu, the user will be prompted to do so. If a non-empty <em>startattach</em> parameter was included in the link, it will be passed to the Web App in the <em>start_param</em> field and in the GET parameter <em>tgWebAppStartParam</em>.</p> -<p>==Bot API 6.1+== supports a new link format:</p> -<p><code>https://t.me/botusername?startattach&choose=users+bots</code> -<code>https://t.me/botusername?startattach=command&choose=groups+channels</code></p> -<p>Opening such a link prompts the user to choose a specific chat and opens the attachment menu in that chat. If the bot wasn't already added to the attachment menu, the user will be prompted to do so. You can specify which types of chats the user will be able to choose from. It can be one or more of the following types: <em>users</em>, <em>bots</em>, <em>groups</em>, <em>channels</em> separated by a <code>+</code> sign. If a non-empty <em>startattach</em> parameter was included in the link, it will be passed to the Web App in the <em>start_param</em> field and in the GET parameter <em>tgWebAppStartParam</em>.</p> -<h3><a class="anchor" href="#testing-web-apps" id="testing-web-apps" name="testing-web-apps"><i class="anchor-icon"></i></a>Testing Web Apps</h3> -<h4><a class="anchor" href="#using-bots-in-the-test-environment" id="using-bots-in-the-test-environment" name="using-bots-in-the-test-environment"><i class="anchor-icon"></i></a>Using bots in the test environment</h4> +<p><code>https://t.me/username?attach=botusername</code><br><code>https://t.me/username?attach=botusername&startattach=command</code><br><code>https://t.me/+1234567890?attach=botusername</code><br><code>https://t.me/+1234567890?attach=botusername&startattach=command</code></p> +<p>These links open the Web App in the attachment menu in the chat with a specific user. If the bot wasn't already added to the attachment menu, the user will be prompted to do so. If a non-empty <em>startattach</em> parameter was included in the link, it will be passed to the Web App in the <em>start_param</em> field and in the GET parameter <em>tgWebAppStartParam</em>.</p> +<p><mark>Bot API 6.1+</mark> supports a new link format:</p> +<p><code>https://t.me/botusername?startattach&choose=users+bots</code><br><code>https://t.me/botusername?startattach=command&choose=groups+channels</code></p> +<p>Opening such a link prompts the user to choose a specific chat and opens the attachment menu in that chat. If the bot wasn't already added to the attachment menu, the user will be prompted to do so. You can specify which types of chats the user will be able to choose from. It can be one or more of the following types: <em>users</em>, <em>bots</em>, <em>groups</em>, <em>channels</em> separated by a <code>+</code> sign. If a non-empty <em>startattach</em> parameter was included in the link, it will be passed to the Web App in the <em>start_param</em> field and in the GET parameter <em>tgWebAppStartParam</em>.</p> +<h3><a class="anchor" name="testing-web-apps" href="#testing-web-apps"><i class="anchor-icon"></i></a>Testing Web Apps</h3> +<h4><a class="anchor" name="using-bots-in-the-test-environment" href="#using-bots-in-the-test-environment"><i class="anchor-icon"></i></a>Using bots in the test environment</h4> <p>To log in to the test environment, use either of the following:</p> <ul> <li><strong>iOS:</strong> tap 10 times on the Settings icon > Accounts > Login to another account > Test.</li> @@ -927,7 +925,7 @@ or <blockquote> <p><strong>Note:</strong> When working with the test environment, you may use HTTP links without TLS to test your Web App.</p> </blockquote> -<h4><a class="anchor" href="#debug-mode-for-web-apps" id="debug-mode-for-web-apps" name="debug-mode-for-web-apps"><i class="anchor-icon"></i></a>Debug Mode for Web Apps</h4> +<h4><a class="anchor" name="debug-mode-for-web-apps" href="#debug-mode-for-web-apps"><i class="anchor-icon"></i></a>Debug Mode for Web Apps</h4> <p>Use these tools to find app-specific issues in your Web App:</p> <p><strong>Android</strong></p> <ul> @@ -945,9 +943,10 @@ or <p><strong>Telegram macOS</strong></p> <ul> <li>Download and launch the <a href="https://telegram.org/dl/macos/beta">Beta Version</a> of Telegram macOS.</li> -<li>Quickly click 5 times on the Settings icon to open the debug menu and enable "Debug Web Apps".</li> +<li>Quickly click 5 times on the Settings icon to open the debug menu and enable “Debug Web Apps”.</li> <li>Right click in the web app and choose <em>Inspect Element</em>.</li> -</ul></div> +</ul> +</div> </div> diff --git a/data/web/corefork.telegram.org/mtproto.html b/data/web/corefork.telegram.org/mtproto.html index d9305420be..4f2dea8ce9 100644 --- a/data/web/corefork.telegram.org/mtproto.html +++ b/data/web/corefork.telegram.org/mtproto.html @@ -47,42 +47,24 @@ Client developers are required to comply with the Security…"> <div id="dev_page_content"><!-- scroll_nav --> <blockquote> -<p>Please feel free to check out our <a href="http://core.telegram.org/techfaq">FAQ for the Technically Inclined</a>. -Client developers are required to comply with the <a href="/mtproto/security_guidelines">Security Guidelines</a>.</p> +<p>Please feel free to check out our <a href="http://core.telegram.org/techfaq">FAQ for the Technically Inclined</a>.<br>Client developers are required to comply with the <a href="/mtproto/security_guidelines">Security Guidelines</a>.</p> </blockquote> -<h3><a class="anchor" href="#related-articles" id="related-articles" name="related-articles"><i class="anchor-icon"></i></a>Related articles</h3> +<h3><a class="anchor" name="related-articles" href="#related-articles"><i class="anchor-icon"></i></a>Related articles</h3> <p><div class="dev_page_nav_wrap"></p> <ul> -<li> -<p><a href="/mtproto/description">Mobile Protocol: Detailed Description</a></p> +<li><a href="/mtproto/description">Mobile Protocol: Detailed Description</a></li> +<li><a href="/mtproto/auth_key">Creating an Authorization Key</a></li> +<li><a href="/mtproto/samples-auth_key">Creating an Authorization Key: Example</a></li> +<li><a href="/mtproto/service_messages">Mobile Protocol: Service Messages</a></li> +<li><a href="/mtproto/service_messages_about_messages">Mobile Protocol: Service Messages about Messages</a></li> +<li><a href="/mtproto/serialize">Binary Data Serialization</a></li> +<li><p><a href="/mtproto/TL">TL Language</a></p> </li> -<li> -<p><a href="/mtproto/auth_key">Creating an Authorization Key</a></p> -</li> -<li> -<p><a href="/mtproto/service_messages">Mobile Protocol: Service Messages</a></p> -</li> -<li> -<p><a href="/mtproto/service_messages_about_messages">Mobile Protocol: Service Messages about Messages</a></p> -</li> -<li> -<p><a href="/mtproto/serialize">Binary Data Serialization</a></p> -</li> -<li> -<p><a href="/mtproto/TL">TL Language</a></p> -</li> -<li> -<p><a href="/schema/mtproto">MTProto TL-schema</a></p> -</li> -<li> -<p><a href="/api/end-to-end">End-to-end encryption, Secret Chats</a></p> -</li> -<li> -<p><a href="/schema/end-to-end">End-to-end TL-schema</a></p> -</li> -<li> -<p><a href="/mtproto/security_guidelines">Security Guidelines for Client Software Developers</a></p> +<li><p><a href="/schema/mtproto">MTProto TL-schema</a></p> </li> +<li><a href="/api/end-to-end">End-to-end encryption, Secret Chats</a></li> +<li><a href="/schema/end-to-end">End-to-end TL-schema</a></li> +<li><a href="/mtproto/security_guidelines">Security Guidelines for Client Software Developers</a></li> </ul> <p></div></p> <hr> @@ -91,7 +73,7 @@ Client developers are required to comply with the <a href="/mtproto/security_gui <li><a href="/api/end-to-end">Secret Chats, end-to-end-encryption</a></li> <li><a href="/api/end-to-end/voice-calls">End-to-end encrypted Voice Calls</a></li> </ul> -<h3><a class="anchor" href="#general-description" id="general-description" name="general-description"><i class="anchor-icon"></i></a>General Description</h3> +<h3><a class="anchor" name="general-description" href="#general-description"><i class="anchor-icon"></i></a>General Description</h3> <p>The protocol is designed for access to a server API from applications running on mobile devices. It must be emphasized that a web browser is not such an application.</p> <p>The protocol is subdivided into three virtually independent components:</p> <ul> @@ -100,14 +82,14 @@ Client developers are required to comply with the <a href="/mtproto/security_gui <li>Transport component: defines the method for the client and the server to transmit messages over some other existing network protocol (such as HTTP, HTTPS, WS (plain WebSockets), WSS (WebSockets over HTTPS), TCP, UDP).</li> </ul> <div><a href="/file/811140746/2/CzMyJPVnPo8.81605/c2310d6ede1a5e220f"> - <img src="/file/811140746/2/CzMyJPVnPo8.81605/c2310d6ede1a5e220f" alt="MTProto 2.0, server-client encryption, cloud chats" class="dev_page_image" style="max-width: 600px;"> + <img src="/file/811140746/2/CzMyJPVnPo8.81605/c2310d6ede1a5e220f" alt="MTProto 2.0, server-client encryption, cloud chats" class="dev_page_image" style="max-width: 600px;" /> </a></div> + <blockquote> -<p>As of version 4.6, major Telegram clients are using <strong>MTProto 2.0</strong>, described in this article. -MTProto v1.0 (<a href="/mtproto_v1">described here</a> for reference) is deprecated and is currently being phased out. </p> +<p>As of version 4.6, major Telegram clients are using <strong>MTProto 2.0</strong>, described in this article.<br>MTProto v1.0 (<a href="/mtproto_v1">described here</a> for reference) is deprecated and is currently being phased out. </p> </blockquote> -<h3><a class="anchor" href="#brief-component-summary" id="brief-component-summary" name="brief-component-summary"><i class="anchor-icon"></i></a>Brief Component Summary</h3> -<h4><a class="anchor" href="#high-level-component-rpc-query-languageapi" id="high-level-component-rpc-query-languageapi" name="high-level-component-rpc-query-languageapi"><i class="anchor-icon"></i></a>High-Level Component (RPC Query Language/API)</h4> +<h3><a class="anchor" name="brief-component-summary" href="#brief-component-summary"><i class="anchor-icon"></i></a>Brief Component Summary</h3> +<h4><a class="anchor" name="high-level-component-rpc-query-language-api" href="#high-level-component-rpc-query-language-api"><i class="anchor-icon"></i></a>High-Level Component (RPC Query Language/API)</h4> <p>From the standpoint of the high-level component, the client and the server exchange <em>messages</em> inside a <em>session</em>. The session is attached to the client device (the application, to be more exact) rather than a specific websocket/http/https/tcp connection. In addition, each session is attached to a <em>user key ID</em> by which authorization is actually accomplished.</p> <p>Several connections to a server may be open; messages may be sent in either direction through any of the connections (a response to a query is not necessarily returned through the same connection that carried the original query, although most often, that is the case; however, in no case can a message be returned through a connection belonging to a different session). When the UDP protocol is used, a response might be returned by a different IP address than the one to which the query had been sent.</p> <p>There are several types of messages:</p> @@ -121,19 +103,19 @@ MTProto v1.0 (<a href="/mtproto_v1">described here</a> for reference) is depreca <p>From the standpoint of lower level protocols, a message is a binary data stream aligned along a 4 or 16-byte boundary. The first several fields in the message are fixed and are used by the cryptographic/authorization system.</p> <p>Each message, either individual or inside a container, consists of a <em>message identifier</em> (64 bits, see below), a <em>message sequence number within a session</em> (32 bits), the <em>length</em> (of the message body in bytes; 32 bits), and a <em>body</em> (any size which is a multiple of 4 bytes). In addition, when a container or a single message is sent, an <em>internal header</em> is added at the top (see below), then the entire message is encrypted, and an <em>external header</em> is placed at the top of the message (a 64-bit <em>key identifier</em> and a 128-bit <em>message key</em>).</p> <p>A <em>message body</em> normally consists of a 32-bit <em>message type</em> followed by type-dependent <em>parameters</em>. In particular, each RPC function has a corresponding message type. For more detail, see <a href="/mtproto/serialize">Binary Data Serialization</a>, <a href="/mtproto/service_messages">Mobile Protocol: Service Messages</a>.</p> -<p>All numbers are written as little endian. However, very large numbers (2048-bit or <code>pq</code>, <code>p</code>, <code>q</code> params) used in RSA and DH are written in the big endian format because that is how the OpenSSL library does it.</p> -<h4><a class="anchor" href="#authorization-and-encryption" id="authorization-and-encryption" name="authorization-and-encryption"><i class="anchor-icon"></i></a>Authorization and Encryption</h4> +<p>All numbers are written as little endian. However, very large numbers (2048-bit) used in RSA and DH are written in the big endian format because that is how the OpenSSL library does it.</p> +<h4><a class="anchor" name="authorization-and-encryption" href="#authorization-and-encryption"><i class="anchor-icon"></i></a>Authorization and Encryption</h4> <p>Prior to a message (or a multipart message) being transmitted over a network using a transport protocol, it is encrypted in a certain way, and an <em>external header</em> is added at the top of the message which is: a 64-bit <em>key identifier</em> (that uniquely identifies an <em>authorization key</em> for the server as well as the <em>user</em>) and a 128-bit <em>message key</em>. A user key together with the message key defines an actual 256-bit key which is what encrypts the message using AES-256 encryption. Note that the initial part of the message to be encrypted contains variable data (session, message ID, sequence number, server salt) that obviously influences the message key (and thus the AES key and iv). The message key is defined as the 128 middle bits of the SHA256 of the message body (including session, message ID, etc.), including the padding bytes, prepended by 32 bytes taken from the authorization key. Multipart messages are encrypted as a single message.</p> <blockquote> <p>For a technical specification, see <a href="/mtproto/description">Mobile Protocol: Detailed Description</a></p> </blockquote> <p>The first thing a client application must do is <a href="/mtproto/auth_key">create an authorization key</a> which is normally generated when it is first run and almost never changes.</p> -<p>To prevent attackers potentially intercepting encrypted messages from decrypting them <em>post factum</em> by somehow appropriating the authorization key (for example, by stealing a device – even though in that case one could also gain access to all the information cached on the device without decrypting anything), MTProto supports <a href="https://core.telegram.org/api/pfs">Perfect Forward Secrecy</a> in both <a href="https://core.telegram.org/api/pfs">cloud chats</a> and <a href="https://core.telegram.org/api/end-to-end/pfs">secret chats</a>.</p> -<h4><a class="anchor" href="#time-synchronization" id="time-synchronization" name="time-synchronization"><i class="anchor-icon"></i></a>Time Synchronization</h4> -<p>If client time diverges widely from server time, a server may start ignoring client messages, or vice versa, because of an invalid message identifier (which is closely related to creation time). Under these circumstances, the server will send the client a special message containing the correct time and a certain 128-bit salt (either explicitly provided by the client in a special RPC synchronization request or equal to the key of the latest message received from the client during the current session). This message could be the first one in a container that includes other messages (if the time discrepancy is significant but does not as yet result in the client's messages being ignored).</p> -<p>Having received such a message or a container holding it, the client first performs a time synchronization (in effect, simply storing the difference between the server's time and its own to be able to compute the “correct” time in the future) and then verifies the message identifiers for correctness.</p> +<p>To prevent attackers potentially intercepting encrypted messages from decrypting them <em>post factum</em> by somehow appropriating the authorization key (for example, by stealing a device – even though in that case one could also gain access to all the information cached on the device without decrypting anything), MTProto supports <a href="https://core.telegram.org/api/pfs">Perfect Forward Secrecy</a> in both <a href="https://core.telegram.org/api/pfs">cloud chats</a> and <a href="https://core.telegram.org/api/end-to-end/pfs">secret chats</a>.</p> +<h4><a class="anchor" name="time-synchronization" href="#time-synchronization"><i class="anchor-icon"></i></a>Time Synchronization</h4> +<p>If client time diverges widely from server time, a server may start ignoring client messages, or vice versa, because of an invalid message identifier (which is closely related to creation time). Under these circumstances, the server will send the client a special message containing the correct time and a certain 128-bit salt (either explicitly provided by the client in a special RPC synchronization request or equal to the key of the latest message received from the client during the current session). This message could be the first one in a container that includes other messages (if the time discrepancy is significant but does not as yet result in the client's messages being ignored).</p> +<p>Having received such a message or a container holding it, the client first performs a time synchronization (in effect, simply storing the difference between the server's time and its own to be able to compute the “correct” time in the future) and then verifies the message identifiers for correctness.</p> <p>Where a correction has been neglected, the client will have to generate a new session to assure the monotonicity of message identifiers.</p> -<h3><a class="anchor" href="#mtproto-transport" id="mtproto-transport" name="mtproto-transport"><i class="anchor-icon"></i></a>MTProto transport</h3> +<h3><a class="anchor" name="mtproto-transport" href="#mtproto-transport"><i class="anchor-icon"></i></a>MTProto transport</h3> <p>Before being sent using the selected transport protocol, the payload has to be wrapped in a secondary protocol header, defined by the appropriate MTProto transport protocol. </p> <ul> <li><a href="mtproto/mtproto-transports#abridged">Abridged</a></li> @@ -141,17 +123,15 @@ MTProto v1.0 (<a href="/mtproto_v1">described here</a> for reference) is depreca <li><a href="mtproto/mtproto-transports#padded-intermediate">Padded intermediate</a></li> <li><a href="mtproto/mtproto-transports#full">Full</a></li> </ul> -<p>The server recognizes these different protocols (and distinguishes them from HTTP, too) by the header. -Additionally, the following transport features can be used: </p> +<p>The server recognizes these different protocols (and distinguishes them from HTTP, too) by the header.<br>Additionally, the following transport features can be used: </p> <ul> <li><a href="mtproto/mtproto-transports#quick-ack">Quick ack</a></li> <li><a href="mtproto/mtproto-transports#transport-errors">Transport errors</a></li> <li><a href="mtproto/mtproto-transports#transport-obfuscation">Transport obfuscation</a></li> </ul> -<p>Example implementations for these protocols can be seen in <a href="https://github.com/tdlib/td/blob/master/td/mtproto/TcpTransport.cpp">tdlib</a> and <a href="https://github.com/danog/MadelineProto/tree/v8/src/Stream/MTProtoTransport">MadelineProto</a>.</p> -<h3><a class="anchor" href="#transport" id="transport" name="transport"><i class="anchor-icon"></i></a>Transport</h3> -<p>Enables the delivery of encrypted containers together with the external header (hereinafter, <em>Payload</em>) from client to server and back. -Multiple transport protocols are defined:</p> +<p>Example implementations for these protocols can be seen in <a href="https://github.com/tdlib/td/blob/master/td/mtproto/TcpTransport.cpp">tdlib</a> and <a href="https://github.com/danog/MadelineProto/tree/master/src/danog/MadelineProto/Stream/MTProtoTransport">MadelineProto</a>.</p> +<h3><a class="anchor" name="transport" href="#transport"><i class="anchor-icon"></i></a>Transport</h3> +<p>Enables the delivery of encrypted containers together with the external header (hereinafter, <em>Payload</em>) from client to server and back.<br>Multiple transport protocols are defined:</p> <ul> <li><a href="/mtproto/transports#tcp">TCP</a></li> <li><a href="/mtproto/transports#websocket">Websocket</a></li> @@ -161,10 +141,10 @@ Multiple transport protocols are defined:</p> <li>UDP</li> </ul> <p>(We shall examine only the first five types.)</p> -<h3><a class="anchor" href="#recap" id="recap" name="recap"><i class="anchor-icon"></i></a>Recap</h3> +<h3><a class="anchor" name="recap" href="#recap"><i class="anchor-icon"></i></a>Recap</h3> <p>To recap, using the <a href="https://en.wikipedia.org/wiki/OSI_model#Layer_architecture">ISO/OSI stack as comparison</a>: </p> <ul> -<li>Layer 7 (Application): <a href="#high-level-component-rpc-query-languageapi">High-level RPC API</a></li> +<li>Layer 7 (Application): <a href="#high-level-component-rpc-query-language-api">High-level RPC API</a></li> <li>Layer 6 (Presentation): <a href="/mtproto/TL">Type Language</a></li> <li>Layer 5 (Session): <a href="https://core.telegram.org/mtproto/description#session">MTProto session</a></li> <li>Layer 4 (Transport):<ul> @@ -175,8 +155,9 @@ Multiple transport protocols are defined:</p> </li> <li>Layer 3 (Network): IP</li> <li>Layer 2 (Data link): MAC/LLC</li> -<li>Layer 1 (Physical): IEEE 802.3, IEEE 802.11, etc...</li> -</ul></div> +<li>Layer 1 (Physical): IEEE 802.3, IEEE 802.11, etc…</li> +</ul> +</div> </div> diff --git a/data/web/corefork.telegram.org/mtproto/auth_key.html b/data/web/corefork.telegram.org/mtproto/auth_key.html index 1b2a012437..969d04c14d 100644 --- a/data/web/corefork.telegram.org/mtproto/auth_key.html +++ b/data/web/corefork.telegram.org/mtproto/auth_key.html @@ -44,88 +44,85 @@ <div id="dev_page_content"><p>The query format is described using <a href="/mtproto/serialize">Binary Data Serialization</a> and the <a href="/mtproto/TL">TL Language</a>. All large numbers are transmitted as strings containing the required sequence of bytes in big endian order. Hash functions, such as SHA1, return strings (of 20 bytes) which can also be interpreted as big endian numbers. Small numbers (<code>int</code>, <code>long</code>, <code>int128</code>, <code>int256</code>) are normally little endian; however, if they are part of SHA1, the bytes are not rearranged. This way, if <code>long</code> <code>x</code> is the 64 lower-order bits of SHA1 of string <code>s</code>, then the <em>final</em> 8 bytes of 20-byte string <code>SHA1(s)</code> are taken and interpreted as a 64-bit integer.</p> <p>Prior to sending off unencrypted messages (required in this instance to generate an authorization key), the client must undergo (p,q) authorization as follows.</p> -<h4><a class="anchor" href="#dh-exchange-initiation" id="dh-exchange-initiation" name="dh-exchange-initiation"><i class="anchor-icon"></i></a>DH exchange initiation</h4> -<h5><a class="anchor" href="#1-client-sends-query-to-server" id="1-client-sends-query-to-server" name="1-client-sends-query-to-server"><i class="anchor-icon"></i></a>1) Client sends query to server</h5> +<h4><a class="anchor" name="dh-exchange-initiation" href="#dh-exchange-initiation"><i class="anchor-icon"></i></a>DH exchange initiation</h4> +<p>1) Client sends query to server</p> <pre><code>req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;</code></pre> <p>The value of <em>nonce</em> is selected randomly by the client (random number) and identifies the client within this communication. Following this step, it is known to all.</p> -<h5><a class="anchor" href="#2-server-sends-response-of-the-form" id="2-server-sends-response-of-the-form" name="2-server-sends-response-of-the-form"><i class="anchor-icon"></i></a>2) Server sends response of the form</h5> +<p>2) Server sends response of the form</p> <pre><code>resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector long = ResPQ;</code></pre> <p>Here, string pq is a representation of a natural number (in binary big endian format). This number is the product of two different odd prime numbers. Normally, pq is less than or equal to 2^63-1. The value of <em>server_nonce</em> is selected randomly by the server; following this step, it is known to all.</p> <p><code>server_public_key_fingerprints</code> is a list of public RSA key fingerprints (64 lower-order bits of SHA1 (server_public_key); the public key is represented as a bare type <code>rsa_public_key n:string e:string = RSAPublicKey</code>, where, as usual, n and e are numbers in big endian format serialized as strings of bytes, following which SHA1 is computed) received by the server.</p> <p>All subsequent messages contain the pair (nonce, server_nonce) both in the plain-text, and the encrypted portions which makes it possible to identify a “temporary session” — one run of the key generation protocol described on this page that uses the same (nonce, server_nonce) pair. An intruder could not create a parallel session with the server with the same parameters and reuse parts of server- or client-encrypted messages for its own purposes in such a parallel session, because a different server_nonce would be selected by the server for any new “temporary session”.</p> -<h4><a class="anchor" href="#proof-of-work" id="proof-of-work" name="proof-of-work"><i class="anchor-icon"></i></a>Proof of work</h4> -<h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p--q" id="3-client-decomposes-pq-into-prime-factors-such-that-p--q" name="3-client-decomposes-pq-into-prime-factors-such-that-p--q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p < q.</h5> +<h4><a class="anchor" name="proof-of-work" href="#proof-of-work"><i class="anchor-icon"></i></a>Proof of work</h4> +<p>3) Client decomposes pq into prime factors such that p < q.</p> <p>This starts a round of Diffie-Hellman key exchanges.</p> -<h4><a class="anchor" href="#presenting-proof-of-work-server-authentication" id="presenting-proof-of-work-server-authentication" name="presenting-proof-of-work-server-authentication"><i class="anchor-icon"></i></a>Presenting proof of work; Server authentication</h4> -<h5><a class="anchor" href="#4-encrypted-data-payload-generation" id="4-encrypted-data-payload-generation" name="4-encrypted-data-payload-generation"><i class="anchor-icon"></i></a>4) <code>encrypted_data</code> payload generation</h5> -<p>First of all, generate an <code>encrypted_data</code> payload as follows:</p> +<h4><a class="anchor" name="presenting-proof-of-work-server-authentication" href="#presenting-proof-of-work-server-authentication"><i class="anchor-icon"></i></a>Presenting proof of work; Server authentication</h4> +<p>4) Client sends query to server</p> +<pre><code>req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params</code></pre> +<p>Here, encrypted_data is obtained as follows:</p> <ul> -<li> -<p>new_nonce := another (good) random number generated by the client; after this query, it is known to both client and server;</p> -</li> -<li> -<p>data := a serialization of </p> +<li>new_nonce := another (good) random number generated by the client; after this query, it is known to both client and server;</li> +<li><p>data := a serialization of </p> <pre><code>p_q_inner_data_dc#a9f55f95 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data;</code></pre> <p>or of</p> <pre><code>p_q_inner_data_temp_dc#56fddf88 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int expires_in:int = P_Q_inner_data;</code></pre> -<p>where <code>dc</code> is the ID of the DC we're talking to; <code>10000</code> has to be added to the DC ID when connecting to the test servers; it has to be made negative if the DC we're connecting to is a media (not CDN) DC. </p> </li> -<li> -<p>encrypted_data := RSA_PAD (data, server_public_key), where RSA_PAD is a version of RSA with a variant of OAEP+ padding explained below in 4.1).</p> +<li><p>encrypted_data := RSA_PAD (data, server_public_key), where RSA_PAD is a version of RSA with a variant of OAEP+ padding explained below in 4.1).</p> </li> </ul> -<p>Someone might intercept the query and replace it with their own, independently decomposing pq into factors instead of the client. The only field that it makes sense to modify is new_nonce which would be the one an intruder would have to re-generate (because an intruder cannot decrypt the encrypted data sent by the client). Since all subsequent messages are encrypted using new_nonce or contain new_nonce_hash, they will not be processed by the client (an intruder would not be able to make it look as though they had been generated by the server because they would not contain new_nonce). Therefore, this intercept will only result in the intruder's completing the authorization key generation protocol in place of the client and creating a new key (that has nothing to do with the client); however, the same effect could be achieved simply by creating a new key in one's own name.</p> +<p>Someone might intercept the query and replace it with their own, independently decomposing pq into factors instead of the client. The only field that it makes sense to modify is new_nonce which would be the one an intruder would have to re-generate (because an intruder cannot decrypt the encrypted data sent by the client). Since all subsequent messages are encrypted using new_nonce or contain new_nonce_hash, they will not be processed by the client (an intruder would not be able to make it look as though they had been generated by the server because they would not contain new_nonce). Therefore, this intercept will only result in the intruder's completing the authorization key generation protocol in place of the client and creating a new key (that has nothing to do with the client); however, the same effect could be achieved simply by creating a new key in one's own name.</p> <p>An alternative form of inner data (<code>p_q_inner_data_temp_dc</code>) is used to create temporary keys, that are only stored in the server RAM and are discarded after at most <code>expires_in</code> seconds. The server is free to discard its copy earlier. In all other respects the temporary key generation protocol is the same. After a temporary key is created, the client usually binds it to its principal authorisation key by means of the <a href="/method/auth.bindTempAuthKey">auth.bindTempAuthKey</a> method, and uses it for all client-server communication until it expires; then a new temporary key is generated. Thus Perfect Forward Secrecy (PFS) in client-server communication is achieved. <a href="/api/pfs">Read more about PFS »</a></p> -<h5><a class="anchor" href="#41-rsa-paddata-server-public-key-mentioned-above-is-implemented-as-follows" id="41-rsa-paddata-server-public-key-mentioned-above-is-implemented-as-follows" name="41-rsa-paddata-server-public-key-mentioned-above-is-implemented-as-follows"><i class="anchor-icon"></i></a>4.1) <code>RSA_PAD(data, server_public_key)</code> mentioned above is implemented as follows:</h5> +<p>4.1) RSA_PAD(data, server_public_key) mentioned above is implemented as follows:</p> <ul> -<li>data_with_padding := data + random_padding_bytes; -- where random_padding_bytes are chosen so that the resulting length of data_with_padding is precisely 192 bytes, and data is the TL-serialized data to be encrypted as before. One has to check that data is not longer than 144 bytes.</li> -<li>data_pad_reversed := BYTE_REVERSE(data_with_padding); -- is obtained from data_with_padding by reversing the byte order.</li> +<li>data_with_padding := data + random_padding_bytes; — where random_padding_bytes are chosen so that the resulting length of data_with_padding is precisely 192 bytes, and data is the TL-serialized data to be encrypted as before. One has to check that data is not longer than 144 bytes.</li> +<li>data_pad_reversed := BYTE_REVERSE(data_with_padding); — is obtained from data_with_padding by reversing the byte order.</li> <li>a random 32-byte temp_key is generated.</li> -<li>data_with_hash := data_pad_reversed + SHA256(temp_key + data_with_padding); -- after this assignment, data_with_hash is exactly 224 bytes long.</li> -<li>aes_encrypted := AES256_IGE(data_with_hash, temp_key, 0); -- AES256-IGE encryption with zero IV.</li> -<li>temp_key_xor := temp_key XOR SHA256(aes_encrypted); -- adjusted key, 32 bytes</li> -<li>key_aes_encrypted := temp_key_xor + aes_encrypted; -- exactly 256 bytes (2048 bits) long</li> +<li>data_with_hash := data_pad_reversed + SHA256(temp_key + data_with_padding); — after this assignment, data_with_hash is exactly 224 bytes long.</li> +<li>aes_encrypted := AES256_IGE(data_with_hash, temp_key, 0); — AES256-IGE encryption with zero IV.</li> +<li>temp_key_xor := temp_key XOR SHA256(aes_encrypted); — adjusted key, 32 bytes</li> +<li>key_aes_encrypted := temp_key_xor + aes_encrypted; — exactly 256 bytes (2048 bits) long</li> <li>The value of key_aes_encrypted is compared with the RSA-modulus of server_pubkey as a big-endian 2048-bit (256-byte) unsigned integer. If key_aes_encrypted turns out to be greater than or equal to the RSA modulus, the previous steps starting from the generation of new random temp_key are repeated. Otherwise the final step is performed:</li> -<li>encrypted_data := RSA(key_aes_encrypted, server_pubkey); -- 256-byte big-endian integer is elevated to the requisite power from the RSA public key modulo the RSA modulus, and the result is stored as a big-endian integer consisting of exactly 256 bytes (with leading zero bytes if required).</li> +<li>encrypted_data := RSA(key_aes_encrypted, server_pubkey); — 256-byte big-endian integer is elevated to the requisite power from the RSA public key modulo the RSA modulus, and the result is stored as a big-endian integer consisting of exactly 256 bytes (with leading zero bytes if required).</li> </ul> -<h5><a class="anchor" href="#5-send-req-dh-params-query-with-generated-encrypted-data" id="5-send-req-dh-params-query-with-generated-encrypted-data" name="5-send-req-dh-params-query-with-generated-encrypted-data"><i class="anchor-icon"></i></a>5) Send req_DH_params query with generated <code>encrypted_data</code></h5> -<pre><code>req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params</code></pre> -<h5><a class="anchor" href="#6-server-responds-with" id="6-server-responds-with" name="6-server-responds-with"><i class="anchor-icon"></i></a>6) Server responds with:</h5> +<p>5) Server responds with:</p> <pre><code>server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;</code></pre> <blockquote> -<p>If the query is incorrect, the server returns a <code>-404</code> error and the handshake must be restarted (any subsequent request also returns <code>-404</code>, even if it is correct).<br> -A <code>-444</code> error may also be returned if a test DC ID is passed in <code>p_q_inner_data_(_temp)dc</code> when handshaking with a production DC, and vice versa. </p> +<p>If the query is incorrect, the server returns a <code>-404</code> error and the handshake must be restarted (any subsequent request also returns <code>-404</code>, even if it is correct).</p> </blockquote> <p>Here, encrypted_answer is obtained as follows:</p> <ul> <li>new_nonce_hash := 128 lower-order bits of SHA1 (new_nonce);</li> -<li>answer := serialization <pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre> +<li><p>answer := serialization </p> +<pre><code> server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre> +</li> +<li><p>answer_with_hash := SHA1(answer) + answer + (0-15 random bytes); such that the length be divisible by 16;</p> </li> -<li>answer_with_hash := SHA1(answer) + answer + (0-15 random bytes); such that the length be divisible by 16;</li> <li>tmp_aes_key := SHA1(new_nonce + server_nonce) + substr (SHA1(server_nonce + new_nonce), 0, 12);</li> <li>tmp_aes_iv := substr (SHA1(server_nonce + new_nonce), 12, 8) + SHA1(new_nonce + new_nonce) + substr (new_nonce, 0, 4);</li> <li>encrypted_answer := AES256_ige_encrypt (answer_with_hash, tmp_aes_key, tmp_aes_iv); here, tmp_aes_key is a 256-bit key, and tmp_aes_iv is a 256-bit initialization vector. The same as in all the other instances that use AES encryption, the encrypted data is padded with random bytes to a length divisible by 16 immediately prior to encryption.</li> </ul> <p>Following this step, new_nonce is still known to client and server only. The client is certain that it is the server that responded and that the response was generated specifically in response to client query req_DH_params, since the response data are encrypted using new_nonce.</p> -<p>Client is expected to check whether <strong>p = dh_prime</strong> is a safe 2048-bit prime (meaning that both <strong>p</strong> and <strong>(p-1)/2</strong> are prime, and that 2^2047 < p < 2^2048), and that <strong>g</strong> generates a cyclic subgroup of prime order <strong>(p-1)/2</strong>, i.e. is a quadratic residue <strong>mod p</strong>. Since <strong>g</strong> is always equal to 2, 3, 4, 5, 6 or 7, this is easily done using quadratic reciprocity law, yielding a simple condition on <strong>p mod 4g</strong> -- namely, <strong>p mod 8 = 7</strong> for <strong>g = 2</strong>; <strong>p mod 3 = 2</strong> for <strong>g = 3</strong>; no extra condition for <strong>g = 4</strong>; <strong>p mod 5 = 1 or 4</strong> for <strong>g = 5</strong>; <strong>p mod 24 = 19 or 23</strong> for <strong>g = 6</strong>; and <strong>p mod 7 = 3, 5 or 6</strong> for <strong>g = 7</strong>. After <strong>g</strong> and <strong>p</strong> have been checked by the client, it makes sense to cache the result, so as not to repeat lengthy computations in future.</p> -<p>If the verification takes too long time (which is the case for older mobile devices), one might initially run only 15 Miller--Rabin iterations for verifying primeness of <strong>p</strong> and <strong>(p - 1)/2</strong> with error probability not exceeding one billionth, and do more iterations later in the background.</p> -<p>Another optimization is to embed into the client application code a small table with some known "good" couples <strong>(g,p)</strong> (or just known safe primes <strong>p</strong>, since the condition on <strong>g</strong> is easily verified during execution), checked during code generation phase, so as to avoid doing such verification during runtime altogether. Server changes these values rarely, thus one usually has to put the current value of server's <strong>dh_prime</strong> into such a table. For example, current value of <strong>dh_prime</strong> equals (in big-endian byte order)</p> +<p>Client is expected to check whether <strong>p = dh_prime</strong> is a safe 2048-bit prime (meaning that both <strong>p</strong> and <strong>(p-1)/2</strong> are prime, and that 2<sup>2047 < p < 2</sup>2048), and that <strong>g</strong> generates a cyclic subgroup of prime order <strong>(p-1)/2</strong>, i.e. is a quadratic residue <strong>mod p</strong>. Since <strong>g</strong> is always equal to 2, 3, 4, 5, 6 or 7, this is easily done using quadratic reciprocity law, yielding a simple condition on <strong>p mod 4g</strong> — namely, <strong>p mod 8 = 7</strong> for <strong>g = 2</strong>; <strong>p mod 3 = 2</strong> for <strong>g = 3</strong>; no extra condition for <strong>g = 4</strong>; <strong>p mod 5 = 1 or 4</strong> for <strong>g = 5</strong>; <strong>p mod 24 = 19 or 23</strong> for <strong>g = 6</strong>; and <strong>p mod 7 = 3, 5 or 6</strong> for <strong>g = 7</strong>. After <strong>g</strong> and <strong>p</strong> have been checked by the client, it makes sense to cache the result, so as not to repeat lengthy computations in future.</p> +<p>If the verification takes too long time (which is the case for older mobile devices), one might initially run only 15 Miller—Rabin iterations for verifying primeness of <strong>p</strong> and <strong>(p - 1)/2</strong> with error probability not exceeding one billionth, and do more iterations later in the background.</p> +<p>Another optimization is to embed into the client application code a small table with some known “good” couples <strong>(g,p)</strong> (or just known safe primes <strong>p</strong>, since the condition on <strong>g</strong> is easily verified during execution), checked during code generation phase, so as to avoid doing such verification during runtime altogether. Server changes these values rarely, thus one usually has to put the current value of server's <strong>dh_prime</strong> into such a table. For example, current value of <strong>dh_prime</strong> equals (in big-endian byte order)</p> <pre><code>C7 1C AE B9 C6 B1 C9 04 8E 6C 52 2F 70 F1 3F 73 98 0D 40 23 8E 3E 21 C1 49 34 D0 37 56 3D 93 0F 48 19 8A 0A A7 C1 40 58 22 94 93 D2 25 30 F4 DB FA 33 6F 6E 0A C9 25 13 95 43 AE D4 4C CE 7C 37 20 FD 51 F6 94 58 70 5A C6 8C D4 FE 6B 6B 13 AB DC 97 46 51 29 69 32 84 54 F1 8F AF 8C 59 5F 64 24 77 FE 96 BB 2A 94 1D 5B CD 1D 4A C8 CC 49 88 07 08 FA 9B 37 8E 3C 4F 3A 90 60 BE E6 7C F9 A4 A4 A6 95 81 10 51 90 7E 16 27 53 B5 6B 0F 6B 41 0D BA 74 D8 A8 4B 2A 14 B3 14 4E 0E F1 28 47 54 FD 17 ED 95 0D 59 65 B4 B9 DD 46 58 2D B1 17 8D 16 9C 6B C4 65 B0 D6 FF 9C A3 92 8F EF 5B 9A E4 E4 18 FC 15 E8 3E BE A0 F8 7F A9 FF 5E ED 70 05 0D ED 28 49 F4 7B F9 59 D9 56 85 0C E9 29 85 1F 0D 81 15 F6 35 B1 05 EE 2E 4E 15 D0 4B 24 54 BF 6F 4F AD F0 34 B1 04 03 11 9C D8 E3 B9 2F CC 5B</code></pre> -<h5><a class="anchor" href="#7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message" id="7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message" name="7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message"><i class="anchor-icon"></i></a>7) Client computes random 2048-bit number <em>b</em> (using a sufficient amount of entropy) and sends the server a message</h5> +<p>6) Client computes random 2048-bit number <em>b</em> (using a sufficient amount of entropy) and sends the server a message</p> <pre><code>set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;</code></pre> <p>Here, encrypted_data is obtained thus:</p> <ul> <li>g_b := pow(g, b) mod dh_prime;</li> -<li>data := serialization <pre><code>client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data</code></pre> +<li><p>data := serialization </p> +<pre><code> client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data</code></pre> +</li> +<li><p>data_with_hash := SHA1(data) + data + (0-15 random bytes); such that length be divisible by 16;</p> </li> -<li>data_with_hash := SHA1(data) + data + (0-15 random bytes); such that length be divisible by 16;</li> <li>encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);</li> </ul> -<p>The retry_id field is equal to zero at the time of the first attempt; otherwise, it is equal to auth_key_aux_hash from the previous failed attempt (see <a href="#9-server-responds-in-one-of-three-ways">Item 9</a>).</p> -<h5><a class="anchor" href="#8-thereafter-auth-key-equals-powg-ab-mod-dh-prime-on-the-server-it-is-computed-as-powg-b-a-mod-dh-prime-and-on-the-client-as-g-ab-mod-dh-prime" id="8-thereafter-auth-key-equals-powg-ab-mod-dh-prime-on-the-server-it-is-computed-as-powg-b-a-mod-dh-prime-and-on-the-client-as-g-ab-mod-dh-prime" name="8-thereafter-auth-key-equals-powg-ab-mod-dh-prime-on-the-server-it-is-computed-as-powg-b-a-mod-dh-prime-and-on-the-client-as-g-ab-mod-dh-prime"><i class="anchor-icon"></i></a>8) Thereafter, auth_key equals <code>pow(g, {ab}) mod dh_prime</code>; on the server, it is computed as <code>pow(g_b, a) mod dh_prime</code>, and on the client as <code>(g_a)^b mod dh_prime</code>.</h5> -<p>Auth_key_hash is computed := 64 lower-order bits of SHA1 (auth_key). The server checks whether there already is another key with the same auth_key_hash and responds in one of the following ways.</p> -<h4><a class="anchor" href="#dh-key-exchange-complete" id="dh-key-exchange-complete" name="dh-key-exchange-complete"><i class="anchor-icon"></i></a>DH key exchange complete</h4> -<h5><a class="anchor" href="#9-server-responds-in-one-of-three-ways" id="9-server-responds-in-one-of-three-ways" name="9-server-responds-in-one-of-three-ways"><i class="anchor-icon"></i></a>9) Server responds in one of three ways:</h5> +<p>The retry_id field is equal to zero at the time of the first attempt; otherwise, it is equal to auth_key_aux_hash from the previous failed attempt (see Item 9).</p> +<p>7) Thereafter, auth_key equals <code>pow(g, {ab}) mod dh_prime</code>; on the server, it is computed as <code>pow(g_b, a) mod dh_prime</code>, and on the client as <code>(g_a)^b mod dh_prime</code>.</p> +<p>8) auth_key_hash is computed := 64 lower-order bits of SHA1 (auth_key). The server checks whether there already is another key with the same auth_key_hash and responds in one of the following ways.</p> +<h4><a class="anchor" name="dh-key-exchange-complete" href="#dh-key-exchange-complete"><i class="anchor-icon"></i></a>DH key exchange complete</h4> +<p>9) Server responds in one of three ways:</p> <pre><code>dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer; dh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer; dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;</code></pre> @@ -133,12 +130,14 @@ dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = S <li>new_nonce_hash1, new_nonce_hash2, and new_nonce_hash3 are obtained as the 128 lower-order bits of SHA1 of the byte string derived from the new_nonce string by adding a single byte with the value of 1, 2, or 3, and followed by another 8 bytes with auth_key_aux_hash. Different values are required to prevent an intruder from changing server response dh_gen_ok into dh_gen_retry.</li> <li>auth_key_aux_hash is the 64 <em>higher-order</em> bits of SHA1(auth_key). It must not be confused with auth_key_hash.</li> </ul> -<p>In the other case, the client goes to <a href="/mtproto/auth_key#7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message">Item 7)</a> generating a new <em>b</em>. -In the first case, the client and the server have negotiated auth_key, following which they forget all other temporary data, and the client creates another encrypted session using auth_key. At the same time, server_salt is initially set to <code>substr(new_nonce, 0, 8) XOR substr(server_nonce, 0, 8)</code>. If required, the client stores the difference between server_time received in 5) and its local time, to be able always to have a good approximation of server time which is required to generate correct message identifiers.</p> +<p>In the other case, the client goes to Item 6) generating a new <em>b</em>.<br>In the first case, the client and the server have negotiated auth_key, following which they forget all other temporary data, and the client creates another encrypted session using auth_key. At the same time, server_salt is initially set to <code>substr(new_nonce, 0, 8) XOR substr(server_nonce, 0, 8)</code>. If required, the client stores the difference between server_time received in 5) and its local time, to be able always to have a good approximation of server time which is required to generate correct message identifiers.</p> <p><strong>IMPORTANT</strong>: Apart from the conditions on the Diffie-Hellman prime <strong>dh_prime</strong> and generator <strong>g</strong>, both sides are to check that <strong>g</strong>, <strong>g_a</strong> and <strong>g_b</strong> are greater than <strong>1</strong> and less than <strong>dh_prime - 1</strong>. We recommend checking that <strong>g_a</strong> and <strong>g_b</strong> are between <strong>2^{2048-64}</strong> and <strong>dh_prime - 2^{2048-64}</strong> as well.</p> -<h4><a class="anchor" href="#error-handling-lost-queries-and-responses" id="error-handling-lost-queries-and-responses" name="error-handling-lost-queries-and-responses"><i class="anchor-icon"></i></a>Error Handling (Lost Queries and Responses)</h4> +<h4><a class="anchor" name="error-handling-lost-queries-and-responses" href="#error-handling-lost-queries-and-responses"><i class="anchor-icon"></i></a>Error Handling (Lost Queries and Responses)</h4> <p>If the client fails to receive any response to its query from the server within a certain time interval, it may simply re-send the query. If the server has already sent a response to this query (<em>exactly</em> the same request and not just similar: all the parameters during the repeat request must take on the same values) but it did not get to the client, the server will simply re-send the same response. The server remembers the response for up to 10 minutes after having received the query in 1). If the server has already forgotten the response or the requisite temporary data, the client will have to start from the beginning.</p> -<p>The server may consider that if the client has already sent in the next query using the data from the previous server response to the specific client, the response is known to have been received by the client and may be forgotten by the server.</p></div> +<p>The server may consider that if the client has already sent in the next query using the data from the previous server response to the specific client, the response is known to have been received by the client and may be forgotten by the server.</p> +<h4><a class="anchor" name="usage-example" href="#usage-example"><i class="anchor-icon"></i></a>Usage Example</h4> +<p>An example of a complete list of queries required to generate an authorization key is shown on <a href="/mtproto/samples-auth_key">a separate page</a>.</p> +</div> </div> diff --git a/data/web/corefork.telegram.org/mtproto/mtproto-transports.html b/data/web/corefork.telegram.org/mtproto/mtproto-transports.html index 510aad1db2..900fe12172 100644 --- a/data/web/corefork.telegram.org/mtproto/mtproto-transports.html +++ b/data/web/corefork.telegram.org/mtproto/mtproto-transports.html @@ -64,7 +64,7 @@ Additionally, the following transport features can be used: </p> <li><a href="#transport-errors">Transport errors</a></li> <li><a href="#transport-obfuscation">Transport obfuscation</a></li> </ul> -<p>Example implementations for these protocols can be seen in <a href="https://github.com/tdlib/td/blob/master/td/mtproto/TcpTransport.cpp">tdlib</a> and <a href="https://github.com/danog/MadelineProto/tree/v8/src/Stream/MTProtoTransport">MadelineProto</a>.</p> +<p>Example implementations for these protocols can be seen in <a href="https://github.com/tdlib/td/blob/master/td/mtproto/TcpTransport.cpp">tdlib</a> and <a href="https://github.com/danog/MadelineProto/tree/master/src/danog/MadelineProto/Stream/MTProtoTransport">MadelineProto</a>.</p> <h3><a class="anchor" href="#abridged" id="abridged" name="abridged"><i class="anchor-icon"></i></a>Abridged</h3> <p>The lightest protocol available.</p> <ul> diff --git a/data/web/corefork.telegram.org/mtproto/samples-auth_key.html b/data/web/corefork.telegram.org/mtproto/samples-auth_key.html index bc8c139180..6463f8fce4 100644 --- a/data/web/corefork.telegram.org/mtproto/samples-auth_key.html +++ b/data/web/corefork.telegram.org/mtproto/samples-auth_key.html @@ -2,12 +2,14 @@ <html class=""> <head> <meta charset="utf-8"> - <title>Auth key generation example</title> + <title>samples-auth_key</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta property="description" content="A full auth key generation example"> - <meta property="og:title" content="Auth key generation example"> + <meta property="description" content="In the examples below, the transport headers are omitted: +For example, for an abridged version of the transport the client…"> + <meta property="og:title" content="samples-auth_key"> <meta property="og:image" content="71a15765997de28d38"> - <meta property="og:description" content="A full auth key generation example"> + <meta property="og:description" content="In the examples below, the transport headers are omitted: +For example, for an abridged version of the transport the client…"> <link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4"> <link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png"> @@ -39,25 +41,15 @@ <div class="container clearfix"> <div class="dev_page"> <div id="dev_page_content_wrap" class=" "> - <div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/mtproto" >Mobile Protocol</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/mtproto/samples-auth_key" >Auth key generation example</a></li></ul></div> - <h1 id="dev_page_title">Auth key generation example</h1> + <div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/mtproto" >Mobile Protocol</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/mtproto/samples-auth_key" >samples-auth_key</a></li></ul></div> + <h1 id="dev_page_title">samples-auth_key</h1> - <div id="dev_page_content"><!-- scroll_nav --> - -<h1><a class="anchor" href="#" id="" name=""><i class="anchor-icon"></i></a></h1> -<p>In the examples below, the <a href="/mtproto#transport">transport</a> headers are omitted:</p> + <div id="dev_page_content"><p>In the examples below, the <a href="/mtproto#transport">transport</a> headers are omitted:</p> <blockquote> -<p>For example, for the <a href="/mtproto/mtproto-transports#abridged">abridged version of the transport »</a>, the client sends <code>0xef</code> as the first byte (<strong>important:</strong> only prior to the very first data packet), then the packet length is encoded with a single byte (<code>0x01-0x7e</code> = data length divided by 4; or <code>0x7f</code> followed by 3 bytes (little endian) divided by 4) followed by the data itself. In this case, server responses have the same structure (although the server does not send <code>0xef</code>as the first byte).</p> +<p>For example, for an abridged version of the transport the client sends <code>0xef</code> as the first byte (<strong>important:</strong> only prior to the very first data packet), then packet length is encoded by a single byte (<code>0x01-0x7e</code> = data length divided by 4; or <code>0x7f</code> followed by 3 bytes (little endian) divided by 4) followed by the data themselves. In this case, server responses have the same form (although the server does not send <code>0xef</code>as the first byte).</p> </blockquote> <p>Detailed documentation on creating authorization keys is available <a href="/mtproto/auth_key">here »</a>.</p> -<h4><a class="anchor" href="#dh-exchange-initiation" id="dh-exchange-initiation" name="dh-exchange-initiation"><i class="anchor-icon"></i></a>DH exchange initiation</h4> -<h5><a class="anchor" href="#1-client-sends-query-to-server" id="1-client-sends-query-to-server" name="1-client-sends-query-to-server"><i class="anchor-icon"></i></a>1) Client sends query to server</h5> -<!-- start req_pq_multi --> -<p>Sent payload (excluding transport headers/trailers):</p> -<pre><code>0000 | 00 00 00 00 00 00 00 00 84 8C 00 00 B1 AF 9C 64 -0010 | 14 00 00 00 F1 8E 7E BE B0 BB 83 C2 68 49 38 B7 -0020 | 6A C4 92 3A A5 45 C8 F0</code></pre> -<p>Payload (de)serialization:</p> +<h4><a class="anchor" href="#1-request-for-pq-authorization" id="1-request-for-pq-authorization" name="1-request-for-pq-authorization"><i class="anchor-icon"></i></a>1. Request for (p,q) Authorization</h4> <pre><code>req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;</code></pre> <table class="table"> <thead> @@ -72,48 +64,48 @@ <tr> <td>auth_key_id</td> <td>0, 8</td> -<td><code>0000000000000000</code></td> -<td>0 since the message is in plain text</td> +<td><code>0</code></td> +<td>Since message is in plain text</td> </tr> <tr> <td>message_id</td> <td>8, 8</td> -<td><code>848C0000B1AF9C64</code></td> -<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> +<td><code>51e57ac42770964a</code></td> +<td>Exact unixtime * 2^32</td> </tr> <tr> <td>message_length</td> <td>16, 4</td> -<td><code>14000000</code> (20 in decimal)</td> +<td><code>20</code></td> <td>Message body length</td> </tr> <tr> <td>%(req_pq_multi)</td> <td>20, 4</td> -<td><code>f18e7ebe</code></td> -<td><em>req_pq_multi</em> constructor number from TL schema</td> +<td><code>be7e8ef1</code></td> +<td>req_pq_multi constructor number from TL schema</td> </tr> <tr> <td>nonce</td> <td>24, 16</td> -<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> +<td><code>3E0549828CCA27E966B301A48FECE2FC</code></td> <td>Random number</td> </tr> </tbody> </table> -<!-- end req_pq_multi --> -<h5><a class="anchor" href="#2-server-sends-response-of-the-form" id="2-server-sends-response-of-the-form" name="2-server-sends-response-of-the-form"><i class="anchor-icon"></i></a>2) Server sends response of the form</h5> -<!-- start resPQ --> -<p>Received payload (excluding transport headers/trailers):</p> -<pre><code>0000 | 00 00 00 00 00 00 00 00 01 9C 04 77 B1 AF 9C 64 -0010 | 50 00 00 00 63 24 16 05 B0 BB 83 C2 68 49 38 B7 -0020 | 6A C4 92 3A A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD -0030 | AE 33 E6 EE 39 4B 47 42 08 2E 07 1E 8F 6E F5 45 -0040 | 63 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09 -0050 | 35 5F C3 0B 21 6B E8 6C 02 2B B4 C3 85 FD 64 DE -0060 | 85 1D 9D D0</code></pre> -<p>Payload (de)serialization:</p> -<pre><code>resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector<long> = ResPQ;</code></pre> +<p>The header is 20 bytes long, the message body is 20 bytes long, and the entire message is 40 bytes in length.</p> +<pre><code>0000 | 00 00 00 00 00 00 00 00 4A 96 70 27 C4 7A E5 51 +0010 | 14 00 00 00 f1 8e 7e be 3E 05 49 82 8C CA 27 E9 +0020 | 66 B3 01 A4 8F EC E2 FC</code></pre> +<h4><a class="anchor" href="#2-a-response-from-the-server-has-been-received-with-the-following-content" id="2-a-response-from-the-server-has-been-received-with-the-following-content" name="2-a-response-from-the-server-has-been-received-with-the-following-content"><i class="anchor-icon"></i></a>2. A response from the server has been received with the following content:</h4> +<pre><code>0000 | 00 00 00 00 00 00 00 00 01 C8 83 1E C9 7A E5 51 +0010 | 40 00 00 00 63 24 16 05 3E 05 49 82 8C CA 27 E9 +0020 | 66 B3 01 A4 8F EC E2 FC A5 CF 4D 33 F4 A1 1E A8 +0030 | 77 BA 4A A5 73 90 73 30 08 17 ED 48 94 1A 08 F9 +0040 | 81 00 00 00 15 C4 B5 1C 01 00 00 00 21 6B E8 6C +0050 | 02 2B B4 C3</code></pre> +<h5><a class="anchor" href="#response-decomposition-using-the-following-formula" id="response-decomposition-using-the-following-formula" name="response-decomposition-using-the-following-formula"><i class="anchor-icon"></i></a>Response decomposition using the following formula:</h5> +<pre><code>resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector long = ResPQ </code></pre> <table class="table"> <thead> <tr> @@ -127,107 +119,71 @@ <tr> <td>auth_key_id</td> <td>0, 8</td> -<td><code>0000000000000000</code></td> -<td>0 since the message is in plain text</td> +<td><code>0</code></td> +<td>Since message is in plain text</td> </tr> <tr> <td>message_id</td> <td>8, 8</td> -<td><code>019C0477B1AF9C64</code></td> -<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> +<td><code>51E57AC91E83C801</code></td> +<td>Server message ID</td> </tr> <tr> <td>message_length</td> <td>16, 4</td> -<td><code>50000000</code> (80 in decimal)</td> +<td><code>64</code></td> <td>Message body length</td> </tr> <tr> <td>%(resPQ)</td> <td>20, 4</td> -<td><code>63241605</code></td> -<td><em>resPQ</em> constructor number from TL schema</td> +<td><code>05162463</code></td> +<td>resPQ constructor number from TL schema</td> </tr> <tr> <td>nonce</td> <td>24, 16</td> -<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> +<td><code>3E0549828CCA27E966B301A48FECE2FC</code></td> <td>Value generated by client in Step 1</td> </tr> <tr> <td>server_nonce</td> <td>40, 16</td> -<td><code>592E37C5BF99B8DDAE33E6EE394B4742</code></td> +<td><code>A5CF4D33F4A11EA877BA4AA573907330</code></td> <td>Server-generated random number</td> </tr> <tr> <td>pq</td> <td>56, 12</td> -<td><code>082E071E8F6EF54563000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 3316653251972384099</td> +<td><code>17ED48941A08F981</code></td> <td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td> </tr> <tr> <td>%(Vector long)</td> <td>68, 4</td> -<td><code>15c4b51c</code></td> -<td><em>Vector t</em> constructor number from TL schema</td> +<td><code>1cb5c415</code></td> +<td><em>Vector long</em> constructor number from TL schema</td> </tr> <tr> <td>count</td> <td>72, 4</td> -<td><code>03000000</code></td> -<td>Number of elements in server_public_key_fingerprints</td> +<td><code>1</code></td> +<td>Number of elements in key fingerprint list</td> </tr> <tr> -<td>server_public_key_fingerprints[0]</td> +<td>fingerprints[]</td> <td>76, 8</td> -<td><code>A5B7F709355FC30B</code></td> -<td>64 lower-order bits of <code>SHA1(server_public_key)</code></td> -</tr> -<tr> -<td>server_public_key_fingerprints[1]</td> -<td>84, 8</td> -<td><code>216BE86C022BB4C3</code></td> -<td>64 lower-order bits of <code>SHA1(server_public_key)</code></td> -</tr> -<tr> -<td>server_public_key_fingerprints[2]</td> -<td>92, 8</td> -<td><code>85FD64DE851D9DD0</code></td> -<td>64 lower-order bits of <code>SHA1(server_public_key)</code></td> +<td><code>c3b42b026ce86b21</code></td> +<td>64 lower-order bits of SHA1 (server_public_key)</td> </tr> </tbody> </table> -<!-- end resPQ --> -<p>In our case, the client only has the following public keys, with the following fingerprints:</p> -<!-- start fingerprints --> -<ul> -<li><code>85FD64DE851D9DD0</code></li> -</ul> -<p>Let's choose the only matching key, the one with fingerprint equal to <code>85FD64DE851D9DD0</code>.</p> -<!-- end fingerprints --> -<h4><a class="anchor" href="#proof-of-work" id="proof-of-work" name="proof-of-work"><i class="anchor-icon"></i></a>Proof of work</h4> -<h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p--q" id="3-client-decomposes-pq-into-prime-factors-such-that-p--q" name="3-client-decomposes-pq-into-prime-factors-such-that-p--q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p < q.</h5> -<!-- start pq --> -<pre><code>pq = 3316653251972384099</code></pre> -<p>Decompose into 2 prime cofactors: <code>3316653251972384099 = 1704206131 * 1946157329</code></p> -<pre><code>p = 1704206131 -q = 1946157329</code></pre> -<!-- end pq --> -<h4><a class="anchor" href="#presenting-proof-of-work-server-authentication" id="presenting-proof-of-work-server-authentication" name="presenting-proof-of-work-server-authentication"><i class="anchor-icon"></i></a>Presenting proof of work; Server authentication</h4> -<h5><a class="anchor" href="#4-encrypted-data-payload-generation" id="4-encrypted-data-payload-generation" name="4-encrypted-data-payload-generation"><i class="anchor-icon"></i></a>4) <code>encrypted_data</code> payload generation</h5> -<p>First of all, generate an <code>encrypted_data</code> payload as follows:</p> -<!-- start p_q_inner_data_dc --> -<p>Generated payload (excluding transport headers/trailers):</p> -<pre><code>0000 | 95 5F F5 A9 08 2E 07 1E 8F 6E F5 45 63 00 00 00 -0010 | 04 65 94 1F 33 00 00 00 04 74 00 01 11 00 00 00 -0020 | B0 BB 83 C2 68 49 38 B7 6A C4 92 3A A5 45 C8 F0 -0030 | 59 2E 37 C5 BF 99 B8 DD AE 33 E6 EE 39 4B 47 42 -0040 | FA 05 D4 1E 4C C4 D7 94 58 F8 26 B2 33 4B 26 67 -0050 | 5C C6 64 8E 23 E7 62 6B 75 A1 B9 09 98 1A C9 55 -0060 | 02 00 00 00</code></pre> -<p>Payload (de)serialization:</p> -<pre><code>p_q_inner_data_dc#a9f55f95 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data;</code></pre> +<p>The <strong>server_public_key</strong> public key has been selected whose fingerprint corresponds to the only one received from the server: <code>c3b42b026ce86b21</code>.</p> +<h4><a class="anchor" href="#3-pq--17ed48941a08f981-decomposed-into-2-prime-cofactors" id="3-pq--17ed48941a08f981-decomposed-into-2-prime-cofactors" name="3-pq--17ed48941a08f981-decomposed-into-2-prime-cofactors"><i class="anchor-icon"></i></a>3. Pq = 17ED48941A08F981 decomposed into 2 prime cofactors:</h4> +<pre><code>p = 494C553B +q = 53911073</code></pre> +<h4><a class="anchor" href="#4-encrypted-data-generation" id="4-encrypted-data-generation" name="4-encrypted-data-generation"><i class="anchor-icon"></i></a>4. encrypted_data Generation</h4> +<pre><code>p_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data</code></pre> <table class="table"> <thead> <tr> @@ -239,94 +195,55 @@ q = 1946157329</code></pre> </thead> <tbody> <tr> -<td>%(p_q_inner_data_dc)</td> +<td>%(p_q_inner_data)</td> <td>0, 4</td> -<td><code>955ff5a9</code></td> -<td><em>p_q_inner_data_dc</em> constructor number from TL schema</td> +<td><code>83c95aec</code></td> +<td>p_q_inner_data constructor number from TL schema</td> </tr> <tr> <td>pq</td> <td>4, 12</td> -<td><code>082E071E8F6EF54563000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 3316653251972384099</td> +<td><code>17ED48941A08F981</code></td> <td>Single-byte prefix denoting length, 8-byte string, and three bytes of padding</td> </tr> <tr> <td>p</td> <td>16, 8</td> -<td><code>0465941F33000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1704206131</td> +<td><code>494C553B</code></td> <td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td> </tr> <tr> <td>q</td> <td>24, 8</td> -<td><code>0474000111000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1946157329</td> +<td><code>53911073</code></td> <td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td> </tr> <tr> <td>nonce</td> <td>32, 16</td> -<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> +<td><code>3E0549828CCA27E966B301A48FECE2FC</code></td> <td>Value generated by client in Step 1</td> </tr> <tr> <td>server_nonce</td> <td>48, 16</td> -<td><code>592E37C5BF99B8DDAE33E6EE394B4742</code></td> +<td><code>A5CF4D33F4A11EA877BA4AA573907330</code></td> <td>Value received from server in Step 2</td> </tr> <tr> <td>new_nonce</td> <td>64, 32</td> -<td><code>FA05D41E4CC4D79458F826B2334B2667</code> <code>5CC6648E23E7626B75A1B909981AC955</code></td> +<td><code>311C85DB234AA2640AFC4A76A735CF5B</code> <code>1F0FD68BD17FA181E1229AD867CC024D</code></td> <td>Client-generated random number</td> </tr> -<tr> -<td>dc</td> -<td>96, 4</td> -<td><code>02000000</code> (2 in decimal)</td> -<td>DC ID: <code>10000</code> (decimal) has to be added to the DC ID to connect to the test servers; it has to be made negative if the DC we're connecting to is a media (not CDN) DC.</td> -</tr> </tbody> </table> -<!-- end p_q_inner_data_dc --> -<p>The serialization of <em>P_Q_inner_data</em> produces <strong>data</strong>, which is used to generate <strong>encrypted_data</strong> as specified in <a href="/mtproto/auth_key">step 4.1</a>.<br> -These are the inputs to the algorithm specified in <a href="/mtproto/auth_key">step 4.1</a>:</p> -<!-- start p_q_inner_data_input --> -<pre><code>data = 955FF5A9082E071E8F6EF545630000000465941F330000000474000111000000B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B4742FA05D41E4CC4D79458F826B2334B26675CC6648E23E7626B75A1B909981AC95502000000 -random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D9118B8AB14EB6A100AA469AACCB3B9961D5E588C19A4E0C17F8C5CEDC003442FD0AECC129BFD6EEA4AD293FF753A0B194AB005F24E74FA78A98E10EAA2F16AD98</code></pre> -<!-- end p_q_inner_data_input --> -<p>And this is the output:</p> -<!-- start p_q_inner_data_output --> -<pre><code>encrypted_data = DF92287F32BBAE22049A7DF88007F9FBE0103D8DF533E4ED59C0A25B6D99FA0A9F2C83A8E45C28B2C7AB6D541B38C6254FDE09B773B38ECDB94B660D71415CDFD4B8BAD8B91DC60B837BF4205A781AB77885D8E0EF71E329D4B9356302C4D2BE16E34A6A939559BE65EC2F0EFE2CD561E9B058A13B5C8EEEB6907DF897AA7E48BE7F7DE1D13058476C8EDF60A79330D0A9178E3FA064EF069063BC37AAA3CC1B5E0E347290E5C1197A10C01986035E20C0B106074C857906131ACE5F75900037E16F66FC0D0D62383412CE7D7A9DCC45AFC3025AD9976268664F4162581175139A2F0910C69CDFBE9DA93CAC8C3CA67A4278E2CD2A67EF9D9FF5D7F866E24596</code></pre> -<!-- end p_q_inner_data_output --> -<p>The length of the final string is 256 bytes.</p> -<h5><a class="anchor" href="#5-send-req-dh-params-query-with-generated-encrypted-data" id="5-send-req-dh-params-query-with-generated-encrypted-data" name="5-send-req-dh-params-query-with-generated-encrypted-data"><i class="anchor-icon"></i></a>5) Send req_DH_params query with generated <code>encrypted_data</code></h5> -<!-- start req_DH_params --> -<p>Sent payload (excluding transport headers/trailers):</p> -<pre><code>0000 | 00 00 00 00 00 00 00 00 74 07 01 00 B1 AF 9C 64 -0010 | 40 01 00 00 BE E4 12 D7 B0 BB 83 C2 68 49 38 B7 -0020 | 6A C4 92 3A A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD -0030 | AE 33 E6 EE 39 4B 47 42 04 65 94 1F 33 00 00 00 -0040 | 04 74 00 01 11 00 00 00 85 FD 64 DE 85 1D 9D D0 -0050 | FE 00 01 00 DF 92 28 7F 32 BB AE 22 04 9A 7D F8 -0060 | 80 07 F9 FB E0 10 3D 8D F5 33 E4 ED 59 C0 A2 5B -0070 | 6D 99 FA 0A 9F 2C 83 A8 E4 5C 28 B2 C7 AB 6D 54 -0080 | 1B 38 C6 25 4F DE 09 B7 73 B3 8E CD B9 4B 66 0D -0090 | 71 41 5C DF D4 B8 BA D8 B9 1D C6 0B 83 7B F4 20 -00A0 | 5A 78 1A B7 78 85 D8 E0 EF 71 E3 29 D4 B9 35 63 -00B0 | 02 C4 D2 BE 16 E3 4A 6A 93 95 59 BE 65 EC 2F 0E -00C0 | FE 2C D5 61 E9 B0 58 A1 3B 5C 8E EE B6 90 7D F8 -00D0 | 97 AA 7E 48 BE 7F 7D E1 D1 30 58 47 6C 8E DF 60 -00E0 | A7 93 30 D0 A9 17 8E 3F A0 64 EF 06 90 63 BC 37 -00F0 | AA A3 CC 1B 5E 0E 34 72 90 E5 C1 19 7A 10 C0 19 -0100 | 86 03 5E 20 C0 B1 06 07 4C 85 79 06 13 1A CE 5F -0110 | 75 90 00 37 E1 6F 66 FC 0D 0D 62 38 34 12 CE 7D -0120 | 7A 9D CC 45 AF C3 02 5A D9 97 62 68 66 4F 41 62 -0130 | 58 11 75 13 9A 2F 09 10 C6 9C DF BE 9D A9 3C AC -0140 | 8C 3C A6 7A 42 78 E2 CD 2A 67 EF 9D 9F F5 D7 F8 -0150 | 66 E2 45 96</code></pre> -<p>Payload (de)serialization:</p> -<pre><code>req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;</code></pre> +<p>The serialization of <em>P_Q_inner_data</em> produces some string <strong>data</strong>. This is followed by <strong>encrypted_data</strong>:</p> +<pre><code>SHA1 (data) = DB761C27718A2305044F71F2AD951629D78B2449 +RSA (data_with_hash, server_public_key) = 7BB0100A523161904D9C69FA04BC60DECFC5DD74B99995C768EB60D8716E2109BAF2D4601DAB6B09610DC11067BB89021E09471FCFA52DBD0F23204AD8CA8B012BF40A112F44695AB6C266955386114EF5211E6372227ADBD34995D3E0E5FF02EC63A43F9926878962F7C570E6A6E78BF8366AF917A5272675C46064BE62E3E202EFA8B1ADFB1C32A898C2987BE27B5F31D57C9BB963ABCB734B16F652CEDB4293CBB7C878A3A3FFAC9DBEA9DF7C67BC9E9508E111C78FC46E057F5C65ADE381D91FEE430A6B576A99BDF8551FDB1BE2B57069B1A45730618F27427E8A04720B4971EF4A9215983D68F2830C3EAA6E40385562F970D38A05C9F1246DC33438E6</code></pre> +<p>The length of the final string was 256 bytes.</p> +<h5><a class="anchor" href="#request-to-start-diffie-hellman-key-exchange" id="request-to-start-diffie-hellman-key-exchange" name="request-to-start-diffie-hellman-key-exchange"><i class="anchor-icon"></i></a>Request to Start Diffie-Hellman Key Exchange</h5> +<pre><code>req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params</code></pre> <table class="table"> <thead> <tr> @@ -340,112 +257,132 @@ random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D91 <tr> <td>auth_key_id</td> <td>0, 8</td> -<td><code>0000000000000000</code></td> -<td>0 since the message is in plain text</td> +<td><code>0</code></td> +<td>Since message is in plain text</td> </tr> <tr> <td>message_id</td> <td>8, 8</td> -<td><code>74070100B1AF9C64</code></td> -<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> +<td><code>51e57ac917717a27</code></td> +<td>Exact unixtime * 2^32</td> </tr> <tr> <td>message_length</td> <td>16, 4</td> -<td><code>40010000</code> (320 in decimal)</td> +<td><code>320</code></td> <td>Message body length</td> </tr> <tr> <td>%(req_DH_params)</td> <td>20, 4</td> -<td><code>bee412d7</code></td> -<td><em>req_DH_params</em> constructor number from TL schema</td> +<td><code>d712e4be</code></td> +<td>req_DH_params constructor number from TL schema</td> </tr> <tr> <td>nonce</td> <td>24, 16</td> -<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> +<td><code>3E0549828CCA27E966B301A48FECE2FC</code></td> <td>Value generated by client in Step 1</td> </tr> <tr> <td>server_nonce</td> <td>40, 16</td> -<td><code>592E37C5BF99B8DDAE33E6EE394B4742</code></td> +<td><code>A5CF4D33F4A11EA877BA4AA573907330</code></td> <td>Value received from server in Step 2</td> </tr> <tr> <td>p</td> <td>56, 8</td> -<td><code>0465941F33000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1704206131</td> +<td><code>494C553B</code></td> <td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td> </tr> <tr> <td>q</td> <td>64, 8</td> -<td><code>0474000111000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1946157329</td> +<td><code>53911073</code></td> <td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td> </tr> <tr> <td>public_key_fingerprint</td> <td>72, 8</td> -<td><code>85FD64DE851D9DD0</code></td> -<td><code>fingerprint</code> of public key used</td> +<td><code>c3b42b026ce86b21</code></td> +<td>Fingerprint of public key used</td> </tr> <tr> <td>encrypted_data</td> <td>80, 260</td> -<td><code>FE000100DF92287F32BBAE22049A7DF8</code> <code>8007F9FBE0103D8DF533E4ED59C0A25B</code> <code>6D99FA0A9F2C83A8E45C28B2C7AB6D54</code> <code>1B38C6254FDE09B773B38ECDB94B660D</code> <code>71415CDFD4B8BAD8B91DC60B837BF420</code> <code>5A781AB77885D8E0EF71E329D4B93563</code> <code>02C4D2BE16E34A6A939559BE65EC2F0E</code> <code>FE2CD561E9B058A13B5C8EEEB6907DF8</code> <code>97AA7E48BE7F7DE1D13058476C8EDF60</code> <code>A79330D0A9178E3FA064EF069063BC37</code> <code>AAA3CC1B5E0E347290E5C1197A10C019</code> <code>86035E20C0B106074C857906131ACE5F</code> <code>75900037E16F66FC0D0D62383412CE7D</code> <code>7A9DCC45AFC3025AD9976268664F4162</code> <code>581175139A2F0910C69CDFBE9DA93CAC</code> <code>8C3CA67A4278E2CD2A67EF9D9FF5D7F8</code><br> <code>66E24596</code></td> -<td>Value generated above</td> +<td>See above</td> +<td>See <a href="#generation-of-encrypted-data">“Generation of encrypted_data"</a></td> </tr> </tbody> </table> -<!-- end req_DH_params --> -<h5><a class="anchor" href="#6-server-responds-with" id="6-server-responds-with" name="6-server-responds-with"><i class="anchor-icon"></i></a>6) Server responds with:</h5> -<!-- start server_DH_params_ok --> -<p>Received payload (excluding transport headers/trailers):</p> -<pre><code>0000 | 00 00 00 00 00 00 00 00 01 30 87 1E B2 AF 9C 64 -0010 | 78 02 00 00 5C 07 E8 D0 B0 BB 83 C2 68 49 38 B7 -0020 | 6A C4 92 3A A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD -0030 | AE 33 E6 EE 39 4B 47 42 FE 50 02 00 07 3F F0 CE -0040 | BA 1A 9E F8 80 F8 85 E4 D0 E9 C1 EF 93 F6 1A 18 -0050 | BD 1B B7 8D 7A 36 D3 BF 1B 76 6E 28 13 91 02 C4 -0060 | 85 BA 0D 47 D3 83 C8 E6 03 9D BB D3 78 BA A6 4D -0070 | C0 67 F1 60 43 96 DA A0 4D 72 1E 11 0D 23 08 F4 -0080 | 95 A5 34 DE 44 30 06 DE 91 76 B4 B8 D9 27 24 84 -0090 | 02 E1 6D 69 FC 8F 73 48 54 BA FB F8 06 00 4E 43 -00A0 | 26 9C A8 C8 72 91 D4 F8 F4 36 84 3A 0C B3 FD 63 -00B0 | 1F E4 D7 F4 1E 8F AC 2E 34 EF 84 0B DA C0 33 14 -00C0 | 24 8A 4A F6 91 AD AB 7A 0C 6B DC CA 3D 85 FD 49 -00D0 | E4 9A E6 E5 18 AF 6D DA 95 CF 03 4F 90 EB 1B 42 -00E0 | 50 CD F6 03 F5 81 21 BC 3C 48 89 E0 C6 73 0C 89 -00F0 | 77 3A 8D 77 C9 FC 7A F3 05 C9 F9 3B D8 35 10 FB -0100 | F1 B9 8E D7 08 49 61 5A D2 C9 49 7F 9C 8A 94 4C -0110 | B1 D3 A5 1A D1 01 44 B7 77 7A 4A 5E D9 59 FF E0 -0120 | 3B 87 3D 4C F0 10 B3 61 C6 2F 7B 42 3E EC 02 CA -0130 | CE 0D 28 0A 6E 34 1E A5 BD AE 28 EF BA 69 D0 50 -0140 | 58 10 56 35 6B 7B 6F 66 D9 A9 51 44 16 57 88 42 -0150 | 24 0B ED 86 33 38 1F 0C 4A B0 06 C5 4B 60 29 E5 -0160 | 8E AF A3 6F 87 2E E7 C9 5B 5D F5 91 C7 C2 68 6A -0170 | 3E 61 48 9F FB 06 F9 10 AC 03 C5 F4 56 B9 A3 C3 -0180 | 4A 5C CA CE 67 6E 87 5C F3 E7 67 91 C4 AD 88 C3 -0190 | 1F 9D 6F 43 EF 4E 9E F4 8E 0D BC 30 1E F2 9D 2E -01A0 | B3 80 30 70 5E 1A 0F 25 F2 00 7D 54 12 96 66 38 -01B0 | DC 51 14 37 1A 63 08 2C 81 46 2C 3B 70 0E A5 35 -01C0 | 6E 28 92 3F 50 87 AF 05 1C FD 81 59 B6 4B 2A DC -01D0 | 80 4E 66 CB 70 F6 AD 25 17 21 C6 B8 CA 2F 21 68 -01E0 | 73 14 32 C9 67 BC 8B AE AD 02 96 40 E8 0C 2D C2 -01F0 | 7A E0 3C FC 5F C1 17 39 65 F9 CD F8 C2 93 1B 6E -0200 | C5 D4 63 51 D7 E7 9D 33 AF BE 6C 58 66 3F 3E AD -0210 | A5 B2 A4 9D F6 CD E1 C9 90 78 61 08 11 65 11 DD -0220 | 9F C6 73 E0 55 9D 84 A5 51 36 C0 01 83 0F E6 2C -0230 | 49 5C 90 39 8E 96 05 49 4E 24 10 7C 02 67 BD A1 -0240 | 29 79 7B 7B 1A CF 86 1C 04 F0 7D 6B BA 8B 11 1F -0250 | 88 86 11 E5 63 1E FF 97 16 C4 06 A7 AE 8B E2 DD -0260 | E1 D8 73 FB 57 1C 82 08 8A BD 18 FE 05 1F 6E 4A -0270 | EE 9B 90 94 C6 3F AC 38 CA 68 B4 EA 46 F1 2C D7 -0280 | 09 DF DA C9 44 ED 46 AF 79 2F DB A2</code></pre> -<p>Payload (de)serialization:</p> -<pre><code>server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;</code></pre> +<pre><code>0000 | 00 00 00 00 00 00 00 00 27 7A 71 17 C9 7A E5 51 +0010 | 40 01 00 00 BE E4 12 D7 3E 05 49 82 8C CA 27 E9 +0020 | 66 B3 01 A4 8F EC E2 FC A5 CF 4D 33 F4 A1 1E A8 +0030 | 77 BA 4A A5 73 90 73 30 04 49 4C 55 3B 00 00 00 +0040 | 04 53 91 10 73 00 00 00 21 6B E8 6C 02 2B B4 C3 +0050 | FE 00 01 00 7B B0 10 0A 52 31 61 90 4D 9C 69 FA +0060 | 04 BC 60 DE CF C5 DD 74 B9 99 95 C7 68 EB 60 D8 +0070 | 71 6E 21 09 BA F2 D4 60 1D AB 6B 09 61 0D C1 10 +0080 | 67 BB 89 02 1E 09 47 1F CF A5 2D BD 0F 23 20 4A +0090 | D8 CA 8B 01 2B F4 0A 11 2F 44 69 5A B6 C2 66 95 +00A0 | 53 86 11 4E F5 21 1E 63 72 22 7A DB D3 49 95 D3 +00B0 | E0 E5 FF 02 EC 63 A4 3F 99 26 87 89 62 F7 C5 70 +00C0 | E6 A6 E7 8B F8 36 6A F9 17 A5 27 26 75 C4 60 64 +00D0 | BE 62 E3 E2 02 EF A8 B1 AD FB 1C 32 A8 98 C2 98 +00E0 | 7B E2 7B 5F 31 D5 7C 9B B9 63 AB CB 73 4B 16 F6 +00F0 | 52 CE DB 42 93 CB B7 C8 78 A3 A3 FF AC 9D BE A9 +0100 | DF 7C 67 BC 9E 95 08 E1 11 C7 8F C4 6E 05 7F 5C +0110 | 65 AD E3 81 D9 1F EE 43 0A 6B 57 6A 99 BD F8 55 +0120 | 1F DB 1B E2 B5 70 69 B1 A4 57 30 61 8F 27 42 7E +0130 | 8A 04 72 0B 49 71 EF 4A 92 15 98 3D 68 F2 83 0C +0140 | 3E AA 6E 40 38 55 62 F9 70 D3 8A 05 C9 F1 24 6D +0150 | C3 34 38 E6</code></pre> +<h4><a class="anchor" href="#5-a-response-from-the-server-has-been-received-with-the-following-content" id="5-a-response-from-the-server-has-been-received-with-the-following-content" name="5-a-response-from-the-server-has-been-received-with-the-following-content"><i class="anchor-icon"></i></a>5. A response from the server has been received with the following content:</h4> +<pre><code>0000 | 00 00 00 00 00 00 00 00 01 54 43 36 CB 7A E5 51 +0010 | 78 02 00 00 5C 07 E8 D0 3E 05 49 82 8C CA 27 E9 +0020 | 66 B3 01 A4 8F EC E2 FC A5 CF 4D 33 F4 A1 1E A8 +0030 | 77 BA 4A A5 73 90 73 30 FE 50 02 00 28 A9 2F E2 +0040 | 01 73 B3 47 A8 BB 32 4B 5F AB 26 67 C9 A8 BB CE +0050 | 64 68 D5 B5 09 A4 CB DD C1 86 24 0A C9 12 CF 70 +0060 | 06 AF 89 26 DE 60 6A 2E 74 C0 49 3C AA 57 74 1E +0070 | 6C 82 45 1F 54 D3 E0 68 F5 CC C4 9B 44 44 12 4B +0080 | 96 66 FF B4 05 AA B5 64 A3 D0 1E 67 F6 E9 12 86 +0090 | 7C 8D 20 D9 88 27 07 DC 33 0B 17 B4 E0 DD 57 CB +00A0 | 53 BF AA FA 9E F5 BE 76 AE 6C 1B 9B 6C 51 E2 D6 +00B0 | 50 2A 47 C8 83 09 5C 46 C8 1E 3B E2 5F 62 42 7B +00C0 | 58 54 88 BB 3B F2 39 21 3B F4 8E B8 FE 34 C9 A0 +00D0 | 26 CC 84 13 93 40 43 97 4D B0 35 56 63 30 38 39 +00E0 | 2C EC B5 1F 94 82 4E 14 0B 98 63 77 30 A4 BE 79 +00F0 | A8 F9 DA FA 39 BA E8 1E 10 95 84 9E A4 C8 34 67 +0100 | C9 2A 3A 17 D9 97 81 7C 8A 7A C6 1C 3F F4 14 DA +0110 | 37 B7 D6 6E 94 9C 0A EC 85 8F 04 82 24 21 0F CC +0120 | 61 F1 1C 3A 91 0B 43 1C CB D1 04 CC CC 8D C6 D2 +0130 | 9D 4A 5D 13 3B E6 39 A4 C3 2B BF F1 53 E6 3A CA +0140 | 3A C5 2F 2E 47 09 B8 AE 01 84 4B 14 2C 1E E8 9D +0150 | 07 5D 64 F6 9A 39 9F EB 04 E6 56 FE 36 75 A6 F8 +0160 | F4 12 07 8F 3D 0B 58 DA 15 31 1C 1A 9F 8E 53 B3 +0170 | CD 6B B5 57 2C 29 49 04 B7 26 D0 BE 33 7E 2E 21 +0180 | 97 7D A2 6D D6 E3 32 70 25 1C 2C A2 9D FC C7 02 +0190 | 27 F0 75 5F 84 CF DA 9A C4 B8 DD 5F 84 F1 D1 EB +01A0 | 36 BA 45 CD DC 70 44 4D 8C 21 3E 4B D8 F6 3B 8A +01B0 | B9 5A 2D 0B 41 80 DC 91 28 3D C0 63 AC FB 92 D6 +01C0 | A4 E4 07 CD E7 C8 C6 96 89 F7 7A 00 74 41 D4 A6 +01D0 | A8 38 4B 66 65 02 D9 B7 7F C6 8B 5B 43 CC 60 7E +01E0 | 60 A1 46 22 3E 11 0F CB 43 BC 3C 94 2E F9 81 93 +01F0 | 0C DC 4A 1D 31 0C 0B 64 D5 E5 5D 30 8D 86 32 51 +0200 | AB 90 50 2C 3E 46 CC 59 9E 88 6A 92 7C DA 96 3B +0210 | 9E B1 6C E6 26 03 B6 85 29 EE 98 F9 F5 20 64 19 +0220 | E0 3F B4 58 EC 4B D9 45 4A A8 F6 BA 77 75 73 CC +0230 | 54 B3 28 89 5B 1D F2 5E AD 9F B4 CD 51 98 EE 02 +0240 | 2B 2B 81 F3 88 D2 81 D5 E5 BC 58 01 07 CA 01 A5 +0250 | 06 65 C3 2B 55 27 15 F3 35 FD 76 26 4F AD 00 DD +0260 | D5 AE 45 B9 48 32 AC 79 CE 7C 51 1D 19 4B C4 2B +0270 | 70 EF A8 50 BB 15 C2 01 2C 52 15 CA BF E9 7C E6 +0280 | 6B 8D 87 34 D0 EE 75 9A 63 8A F0 13</code></pre> +<h5><a class="anchor" href="#response-decomposition-using-the-following-formula" id="response-decomposition-using-the-following-formula" name="response-decomposition-using-the-following-formula"><i class="anchor-icon"></i></a>Response decomposition using the following formula:</h5> +<pre><code>server_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params; +server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;</code></pre> <table class="table"> <thead> <tr> @@ -459,98 +396,53 @@ random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D91 <tr> <td>auth_key_id</td> <td>0, 8</td> -<td><code>0000000000000000</code></td> -<td>0 since the message is in plain text</td> +<td><code>0</code></td> +<td>Since message is in plain text</td> </tr> <tr> <td>message_id</td> <td>8, 8</td> -<td><code>0130871EB2AF9C64</code></td> -<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> +<td><code>51E57ACB36435401</code></td> +<td>Exact unixtime * 2^32</td> </tr> <tr> <td>message_length</td> <td>16, 4</td> -<td><code>78020000</code> (632 in decimal)</td> +<td><code>632</code></td> <td>Message body length</td> </tr> <tr> <td>%(server_DH_params_ok)</td> <td>20, 4</td> -<td><code>5c07e8d0</code></td> -<td><em>server_DH_params_ok</em> constructor number from TL schema</td> +<td><code>d0e8075c</code></td> +<td>server_DH_params_ok constructor number from TL schema</td> </tr> <tr> <td>nonce</td> <td>24, 16</td> -<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> +<td><code>3E0549828CCA27E966B301A48FECE2FC</code></td> <td>Value generated by client in Step 1</td> </tr> <tr> <td>server_nonce</td> <td>40, 16</td> -<td><code>592E37C5BF99B8DDAE33E6EE394B4742</code></td> +<td><code>A5CF4D33F4A11EA877BA4AA573907330</code></td> <td>Value received from server in Step 2</td> </tr> <tr> <td>encrypted_answer</td> <td>56, 596</td> -<td><code>FE500200073FF0CEBA1A9EF880F885E4</code> <code>D0E9C1EF93F61A18BD1BB78D7A36D3BF</code> <code>1B766E28139102C485BA0D47D383C8E6</code> <code>039DBBD378BAA64DC067F1604396DAA0</code> <code>4D721E110D2308F495A534DE443006DE</code> <code>9176B4B8D927248402E16D69FC8F7348</code> <code>54BAFBF806004E43269CA8C87291D4F8</code> <code>F436843A0CB3FD631FE4D7F41E8FAC2E</code> <code>34EF840BDAC03314248A4AF691ADAB7A</code> <code>0C6BDCCA3D85FD49E49AE6E518AF6DDA</code> <code>95CF034F90EB1B4250CDF603F58121BC</code> <code>3C4889E0C6730C89773A8D77C9FC7AF3</code> <code>05C9F93BD83510FBF1B98ED70849615A</code> <code>D2C9497F9C8A944CB1D3A51AD10144B7</code> <code>777A4A5ED959FFE03B873D4CF010B361</code> <code>C62F7B423EEC02CACE0D280A6E341EA5</code> <code>BDAE28EFBA69D050581056356B7B6F66</code> <code>D9A9514416578842240BED8633381F0C</code> <code>4AB006C54B6029E58EAFA36F872EE7C9</code> <code>5B5DF591C7C2686A3E61489FFB06F910</code> <code>AC03C5F456B9A3C34A5CCACE676E875C</code> <code>F3E76791C4AD88C31F9D6F43EF4E9EF4</code> <code>8E0DBC301EF29D2EB38030705E1A0F25</code> <code>F2007D5412966638DC5114371A63082C</code> <code>81462C3B700EA5356E28923F5087AF05</code> <code>1CFD8159B64B2ADC804E66CB70F6AD25</code> <code>1721C6B8CA2F2168731432C967BC8BAE</code> <code>AD029640E80C2DC27AE03CFC5FC11739</code> <code>65F9CDF8C2931B6EC5D46351D7E79D33</code> <code>AFBE6C58663F3EADA5B2A49DF6CDE1C9</code> <code>90786108116511DD9FC673E0559D84A5</code> <code>5136C001830FE62C495C90398E960549</code> <code>4E24107C0267BDA129797B7B1ACF861C</code> <code>04F07D6BBA8B111F888611E5631EFF97</code> <code>16C406A7AE8BE2DDE1D873FB571C8208</code> <code>8ABD18FE051F6E4AEE9B9094C63FAC38</code> <code>CA68B4EA46F12CD709DFDAC944ED46AF</code><br> <code>792FDBA2</code></td> <td>See below</td> +<td>See <a href="#conversion-of-encrypted-answer-into-answer">“Decomposition of encrypted_answer"</a></td> </tr> </tbody> </table> -<!-- end server_DH_params_ok --> -<p>Decrypt <code>encrypted_answer</code> using the reverse of the process specified in <a href="/mtproto/auth_key#6-server-responds-with">step 6</a>:</p> -<!-- start server_DH_inner_data_input --> -<pre><code>encrypted_answer = 073FF0CEBA1A9EF880F885E4D0E9C1EF93F61A18BD1BB78D7A36D3BF1B766E28139102C485BA0D47D383C8E6039DBBD378BAA64DC067F1604396DAA04D721E110D2308F495A534DE443006DE9176B4B8D927248402E16D69FC8F734854BAFBF806004E43269CA8C87291D4F8F436843A0CB3FD631FE4D7F41E8FAC2E34EF840BDAC03314248A4AF691ADAB7A0C6BDCCA3D85FD49E49AE6E518AF6DDA95CF034F90EB1B4250CDF603F58121BC3C4889E0C6730C89773A8D77C9FC7AF305C9F93BD83510FBF1B98ED70849615AD2C9497F9C8A944CB1D3A51AD10144B7777A4A5ED959FFE03B873D4CF010B361C62F7B423EEC02CACE0D280A6E341EA5BDAE28EFBA69D050581056356B7B6F66D9A9514416578842240BED8633381F0C4AB006C54B6029E58EAFA36F872EE7C95B5DF591C7C2686A3E61489FFB06F910AC03C5F456B9A3C34A5CCACE676E875CF3E76791C4AD88C31F9D6F43EF4E9EF48E0DBC301EF29D2EB38030705E1A0F25F2007D5412966638DC5114371A63082C81462C3B700EA5356E28923F5087AF051CFD8159B64B2ADC804E66CB70F6AD251721C6B8CA2F2168731432C967BC8BAEAD029640E80C2DC27AE03CFC5FC1173965F9CDF8C2931B6EC5D46351D7E79D33AFBE6C58663F3EADA5B2A49DF6CDE1C990786108116511DD9FC673E0559D84A55136C001830FE62C495C90398E9605494E24107C0267BDA129797B7B1ACF861C04F07D6BBA8B111F888611E5631EFF9716C406A7AE8BE2DDE1D873FB571C82088ABD18FE051F6E4AEE9B9094C63FAC38CA68B4EA46F12CD709DFDAC944ED46AF792FDBA2 -tmp_aes_key = 3826079A7BBD2CC9B9AE0E9D1BEEDA1A663CE630DC446D259DE256A1C953E8FA -tmp_aes_iv = 7A6748BA29AAC95EF75BD4588351617832FD34568EF1C4018F04F871FA05D41E</code></pre> -<!-- end server_DH_inner_data_input --> -<p>Yielding:</p> -<!-- start server_DH_inner_data_output --> -<pre><code>answer_with_hash = 3C9D681E6DB06E8B9F3D3CA74BC92D7E67D227D0BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001002FDAB5904B04F687AFF2E819845CF3BE57A147004CFFEF1C5DEA2574EB87C7A1462EAF356CBAD7B11BC1AAF4C64924555834B4E0FECB94118F21958824D8E0EB78FD33BA711806508E1EFA3BDB4520DBD4459CA6BAD3A8CD59874AE8295DBD0B6EC31C2A381406FCFBCA4031EDB433CDCF43551BEDAC54CBF8209542C22BC0D564FC8585945869AF496994DEE5E9B1E59C96020713B4B3AE90ED7DC68FD1DB5B81C2411E7C0E70893BC1A5804563D424AE95A453419AFFEB3B8A8AF7C9995041DDBB3117F105397B250C2FF1F565926000CC06E175B9A7078ABFA6383D0771822291D83BC82DCD16E991B4ACF7F9C17814F6715D3517F4E66401863418F16AABB2AF9C641C1005E08D6EEDB1 -answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001002FDAB5904B04F687AFF2E819845CF3BE57A147004CFFEF1C5DEA2574EB87C7A1462EAF356CBAD7B11BC1AAF4C64924555834B4E0FECB94118F21958824D8E0EB78FD33BA711806508E1EFA3BDB4520DBD4459CA6BAD3A8CD59874AE8295DBD0B6EC31C2A381406FCFBCA4031EDB433CDCF43551BEDAC54CBF8209542C22BC0D564FC8585945869AF496994DEE5E9B1E59C96020713B4B3AE90ED7DC68FD1DB5B81C2411E7C0E70893BC1A5804563D424AE95A453419AFFEB3B8A8AF7C9995041DDBB3117F105397B250C2FF1F565926000CC06E175B9A7078ABFA6383D0771822291D83BC82DCD16E991B4ACF7F9C17814F6715D3517F4E66401863418F16AABB2AF9C641C1005E08D6EEDB1</code></pre> -<!-- end server_DH_inner_data_output --> -<!-- start server_DH_inner_data --> -<p>Generated payload (excluding transport headers/trailers):</p> -<pre><code>0000 | BA 0D 89 B5 B0 BB 83 C2 68 49 38 B7 6A C4 92 3A -0010 | A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD AE 33 E6 EE -0020 | 39 4B 47 42 03 00 00 00 FE 00 01 00 C7 1C AE B9 -0030 | C6 B1 C9 04 8E 6C 52 2F 70 F1 3F 73 98 0D 40 23 -0040 | 8E 3E 21 C1 49 34 D0 37 56 3D 93 0F 48 19 8A 0A -0050 | A7 C1 40 58 22 94 93 D2 25 30 F4 DB FA 33 6F 6E -0060 | 0A C9 25 13 95 43 AE D4 4C CE 7C 37 20 FD 51 F6 -0070 | 94 58 70 5A C6 8C D4 FE 6B 6B 13 AB DC 97 46 51 -0080 | 29 69 32 84 54 F1 8F AF 8C 59 5F 64 24 77 FE 96 -0090 | BB 2A 94 1D 5B CD 1D 4A C8 CC 49 88 07 08 FA 9B -00A0 | 37 8E 3C 4F 3A 90 60 BE E6 7C F9 A4 A4 A6 95 81 -00B0 | 10 51 90 7E 16 27 53 B5 6B 0F 6B 41 0D BA 74 D8 -00C0 | A8 4B 2A 14 B3 14 4E 0E F1 28 47 54 FD 17 ED 95 -00D0 | 0D 59 65 B4 B9 DD 46 58 2D B1 17 8D 16 9C 6B C4 -00E0 | 65 B0 D6 FF 9C A3 92 8F EF 5B 9A E4 E4 18 FC 15 -00F0 | E8 3E BE A0 F8 7F A9 FF 5E ED 70 05 0D ED 28 49 -0100 | F4 7B F9 59 D9 56 85 0C E9 29 85 1F 0D 81 15 F6 -0110 | 35 B1 05 EE 2E 4E 15 D0 4B 24 54 BF 6F 4F AD F0 -0120 | 34 B1 04 03 11 9C D8 E3 B9 2F CC 5B FE 00 01 00 -0130 | 2F DA B5 90 4B 04 F6 87 AF F2 E8 19 84 5C F3 BE -0140 | 57 A1 47 00 4C FF EF 1C 5D EA 25 74 EB 87 C7 A1 -0150 | 46 2E AF 35 6C BA D7 B1 1B C1 AA F4 C6 49 24 55 -0160 | 58 34 B4 E0 FE CB 94 11 8F 21 95 88 24 D8 E0 EB -0170 | 78 FD 33 BA 71 18 06 50 8E 1E FA 3B DB 45 20 DB -0180 | D4 45 9C A6 BA D3 A8 CD 59 87 4A E8 29 5D BD 0B -0190 | 6E C3 1C 2A 38 14 06 FC FB CA 40 31 ED B4 33 CD -01A0 | CF 43 55 1B ED AC 54 CB F8 20 95 42 C2 2B C0 D5 -01B0 | 64 FC 85 85 94 58 69 AF 49 69 94 DE E5 E9 B1 E5 -01C0 | 9C 96 02 07 13 B4 B3 AE 90 ED 7D C6 8F D1 DB 5B -01D0 | 81 C2 41 1E 7C 0E 70 89 3B C1 A5 80 45 63 D4 24 -01E0 | AE 95 A4 53 41 9A FF EB 3B 8A 8A F7 C9 99 50 41 -01F0 | DD BB 31 17 F1 05 39 7B 25 0C 2F F1 F5 65 92 60 -0200 | 00 CC 06 E1 75 B9 A7 07 8A BF A6 38 3D 07 71 82 -0210 | 22 91 D8 3B C8 2D CD 16 E9 91 B4 AC F7 F9 C1 78 -0220 | 14 F6 71 5D 35 17 F4 E6 64 01 86 34 18 F1 6A AB -0230 | B2 AF 9C 64</code></pre> -<p>Payload (de)serialization:</p> +<h5><a class="anchor" href="#conversion-of-encrypted-answer-into-answer" id="conversion-of-encrypted-answer-into-answer" name="conversion-of-encrypted-answer-into-answer"><i class="anchor-icon"></i></a>Conversion of encrypted_answer into <strong>answer</strong>:</h5> +<pre><code>encrypted_answer = 28A92FE20173B347A8BB324B5FAB2667C9A8BBCE6468D5B509A4CBDDC186240AC912CF7006AF8926DE606A2E74C0493CAA57741E6C82451F54D3E068F5CCC49B4444124B9666FFB405AAB564A3D01E67F6E912867C8D20D9882707DC330B17B4E0DD57CB53BFAAFA9EF5BE76AE6C1B9B6C51E2D6502A47C883095C46C81E3BE25F62427B585488BB3BF239213BF48EB8FE34C9A026CC8413934043974DB03556633038392CECB51F94824E140B98637730A4BE79A8F9DAFA39BAE81E1095849EA4C83467C92A3A17D997817C8A7AC61C3FF414DA37B7D66E949C0AEC858F048224210FCC61F11C3A910B431CCBD104CCCC8DC6D29D4A5D133BE639A4C32BBFF153E63ACA3AC52F2E4709B8AE01844B142C1EE89D075D64F69A399FEB04E656FE3675A6F8F412078F3D0B58DA15311C1A9F8E53B3CD6BB5572C294904B726D0BE337E2E21977DA26DD6E33270251C2CA29DFCC70227F0755F84CFDA9AC4B8DD5F84F1D1EB36BA45CDDC70444D8C213E4BD8F63B8AB95A2D0B4180DC91283DC063ACFB92D6A4E407CDE7C8C69689F77A007441D4A6A8384B666502D9B77FC68B5B43CC607E60A146223E110FCB43BC3C942EF981930CDC4A1D310C0B64D5E55D308D863251AB90502C3E46CC599E886A927CDA963B9EB16CE62603B68529EE98F9F5206419E03FB458EC4BD9454AA8F6BA777573CC54B328895B1DF25EAD9FB4CD5198EE022B2B81F388D281D5E5BC580107CA01A50665C32B552715F335FD76264FAD00DDD5AE45B94832AC79CE7C511D194BC42B70EFA850BB15C2012C5215CABFE97CE66B8D8734D0EE759A638AF013 +tmp_aes_key = F011280887C7BB01DF0FC4E17830E0B91FBB8BE4B2267CB985AE25F33B527253 +tmp_aes_iv = 3212D579EE35452ED23E0D0C92841AA7D31B2E9BDEF2151E80D15860311C85DB +answer = BA0D89B53E0549828CCA27E966B301A48FECE2FCA5CF4D33F4A11EA877BA4AA57390733002000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100262AABA621CC4DF587DC94CF8252258C0B9337DFB47545A49CDD5C9B8EAE7236C6CADC40B24E88590F1CC2CC762EBF1CF11DCC0B393CAAD6CEE4EE5848001C73ACBB1D127E4CB93072AA3D1C8151B6FB6AA6124B7CD782EAF981BDCFCE9D7A00E423BD9D194E8AF78EF6501F415522E44522281C79D906DDB79C72E9C63D83FB2A940FF779DFB5F2FD786FB4AD71C9F08CF48758E534E9815F634F1E3A80A5E1C2AF210C5AB762755AD4B2126DFA61A77FA9DA967D65DFD0AFB5CDF26C4D4E1A88B180F4E0D0B45BA1484F95CB2712B50BF3F5968D9D55C99C0FB9FB67BFF56D7D4481B634514FBA3488C4CDA2FC0659990E8E868B28632875A9AA703BCDCE8FCB7AE551</code></pre> +<h5><a class="anchor" href="#server-dh-inner-data-decomposition-using-the-following-formula" id="server-dh-inner-data-decomposition-using-the-following-formula" name="server-dh-inner-data-decomposition-using-the-following-formula"><i class="anchor-icon"></i></a>Server_DH_inner_data decomposition using the following formula:</h5> <pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre> <table class="table"> <thead> @@ -565,81 +457,49 @@ answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474 <tr> <td>%(server_DH_inner_data)</td> <td>0, 4</td> -<td><code>ba0d89b5</code></td> -<td><em>server_DH_inner_data</em> constructor number from TL schema</td> +<td><code>b5890dba</code></td> +<td>server_DH_inner_data constructor number from TL schema</td> </tr> <tr> <td>nonce</td> <td>4, 16</td> -<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> +<td><code>3E0549828CCA27E966B301A48FECE2FC</code></td> <td>Value generated by client in Step 1</td> </tr> <tr> <td>server_nonce</td> <td>20, 16</td> -<td><code>592E37C5BF99B8DDAE33E6EE394B4742</code></td> +<td><code>A5CF4D33F4A11EA877BA4AA573907330</code></td> <td>Value received from server in Step 2</td> </tr> <tr> <td>g</td> <td>36, 4</td> -<td><code>03000000</code> (3 in decimal)</td> +<td><code>2</code></td> <td>Value received from server in Step 2</td> </tr> <tr> <td>dh_prime</td> <td>40, 260</td> -<td><code>FE000100C71CAEB9C6B1C9048E6C522F</code> <code>70F13F73980D40238E3E21C14934D037</code> <code>563D930F48198A0AA7C14058229493D2</code> <code>2530F4DBFA336F6E0AC925139543AED4</code> <code>4CCE7C3720FD51F69458705AC68CD4FE</code> <code>6B6B13ABDC9746512969328454F18FAF</code> <code>8C595F642477FE96BB2A941D5BCD1D4A</code> <code>C8CC49880708FA9B378E3C4F3A9060BE</code> <code>E67CF9A4A4A695811051907E162753B5</code> <code>6B0F6B410DBA74D8A84B2A14B3144E0E</code> <code>F1284754FD17ED950D5965B4B9DD4658</code> <code>2DB1178D169C6BC465B0D6FF9CA3928F</code> <code>EF5B9AE4E418FC15E83EBEA0F87FA9FF</code> <code>5EED70050DED2849F47BF959D956850C</code> <code>E929851F0D8115F635B105EE2E4E15D0</code> <code>4B2454BF6F4FADF034B10403119CD8E3</code><br> <code>B92FCC5B</code></td> -<td>2048-bit prime, in big-endian byte order, to be checked as specified in the auth key docs</td> +<td><code>C71CAEB9C6B1C9048E6C522F70F13F73</code> <code>980D40238E3E21C14934D037563D930F</code> <code>48198A0AA7C14058229493D22530F4DB</code> <code>FA336F6E0AC925139543AED44CCE7C37</code> <code>20FD51F69458705AC68CD4FE6B6B13AB</code> <code>DC9746512969328454F18FAF8C595F64</code> <code>2477FE96BB2A941D5BCD1D4AC8CC4988</code> <code>0708FA9B378E3C4F3A9060BEE67CF9A4</code> <code>A4A695811051907E162753B56B0F6B41</code> <code>0DBA74D8A84B2A14B3144E0EF1284754</code> <code>FD17ED950D5965B4B9DD46582DB1178D</code> <code>169C6BC465B0D6FF9CA3928FEF5B9AE4</code> <code>E418FC15E83EBEA0F87FA9FF5EED7005</code> <code>0DED2849F47BF959D956850CE929851F</code> <code>0D8115F635B105EE2E4E15D04B2454BF</code> <code>6F4FADF034B10403119CD8E3B92FCC5B</code></td> </tr> <tr> <td>g_a</td> <td>300, 260</td> -<td><code>FE0001002FDAB5904B04F687AFF2E819</code> <code>845CF3BE57A147004CFFEF1C5DEA2574</code> <code>EB87C7A1462EAF356CBAD7B11BC1AAF4</code> <code>C64924555834B4E0FECB94118F219588</code> <code>24D8E0EB78FD33BA711806508E1EFA3B</code> <code>DB4520DBD4459CA6BAD3A8CD59874AE8</code> <code>295DBD0B6EC31C2A381406FCFBCA4031</code> <code>EDB433CDCF43551BEDAC54CBF8209542</code> <code>C22BC0D564FC8585945869AF496994DE</code> <code>E5E9B1E59C96020713B4B3AE90ED7DC6</code> <code>8FD1DB5B81C2411E7C0E70893BC1A580</code> <code>4563D424AE95A453419AFFEB3B8A8AF7</code> <code>C9995041DDBB3117F105397B250C2FF1</code> <code>F565926000CC06E175B9A7078ABFA638</code> <code>3D0771822291D83BC82DCD16E991B4AC</code> <code>F7F9C17814F6715D3517F4E664018634</code><br> <code>18F16AAB</code></td> -<td><code>g_a</code> diffie-hellman parameter</td> +<td><code>262AABA621CC4DF587DC94CF8252258C</code> <code>0B9337DFB47545A49CDD5C9B8EAE7236</code> <code>C6CADC40B24E88590F1CC2CC762EBF1C</code> <code>F11DCC0B393CAAD6CEE4EE5848001C73</code> <code>ACBB1D127E4CB93072AA3D1C8151B6FB</code> <code>6AA6124B7CD782EAF981BDCFCE9D7A00</code> <code>E423BD9D194E8AF78EF6501F415522E4</code> <code>4522281C79D906DDB79C72E9C63D83FB</code> <code>2A940FF779DFB5F2FD786FB4AD71C9F0</code> <code>8CF48758E534E9815F634F1E3A80A5E1</code> <code>C2AF210C5AB762755AD4B2126DFA61A7</code> <code>7FA9DA967D65DFD0AFB5CDF26C4D4E1A</code> <code>88B180F4E0D0B45BA1484F95CB2712B5</code> <code>0BF3F5968D9D55C99C0FB9FB67BFF56D</code> <code>7D4481B634514FBA3488C4CDA2FC0659</code> <code>990E8E868B28632875A9AA703BCDCE8F</code></td> </tr> <tr> <td>server_time</td> <td>560, 4</td> -<td><code>B2AF9C64</code> (1687990194 in decimal)</td> +<td><code>1373993675</code></td> <td>Server time</td> </tr> </tbody> </table> -<!-- end server_DH_inner_data --> -<h5><a class="anchor" href="#7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message" id="7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message" name="7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message"><i class="anchor-icon"></i></a>7) Client computes random 2048-bit number <em>b</em> (using a sufficient amount of entropy) and sends the server a message</h5> -<p>First, generate a secure random 2048-bit number b:</p> -<!-- start b --> -<pre><code>b = 29F2FD3102D844146B82E7C115C554A80961BC260BCA739BB670787AF0A72A512BA2E47AD58D0C478415251E4D0F7A737C2BF06A364C6E995ED596C88F4685F412B60205ECB9FA3ECA18A5B7B2DBEF3F26614806067E2F5831BB9CFF38278A25BB79A8F081A9E72E92CF74DE524DFBC07B6F5F77DF5F1EFF385E0B943282DF43A220AF62387F662982CCEDB59302EAD733438089FE871856F3C6E9221198094EA76E20868AEC4A7D7C809223CB28627DF3A05961B5148BE043CC64ECA1BFCC427F476E8A6769CDD7F5B774311BC166DB8FEC80E7C2BB9DF3B391D5D441B6BB35F0828BB9A22C9151FC63F1F3C04517C127A0BB98A2850867D7074E8D0C2FC576</code></pre> -<!-- end b --> -<p>Then compute <code>g_b = pow(g, b) mod dh_prime</code></p> -<!-- start g_b --> -<pre><code>g_b = 69A19DF1CA7E2F7EB2D1C4FB9BA2856EF2AA19510669FF991757F7A3A10AA176A81CBD993DC7BD794C4E169056601BABFFE5C1A8DC6BCB705BB24BDB5E17280D26DAF0A9A801558CB87A11E30D6E8DD29CC039D014EA819CD0F8148CBA1BDB21331FFCB6063ED8FB66A6E90A02A80B68CDE53CB45D1266E8C19617FDD5AFD824001FD16BF666A1946B54B45C751CDD535B3718C6BE7A2EBAD4B35F5CA61D128B5B10ED4223C08D7294FCE18C8D30B5CFC8D73A80469150F7180F5F76F4FEAA0156EFA7665BB37F87B5F9EEAA654550555C05F91342608BB76F1E394EA6C51CE64589540E8729F9F5AE1B33108E8D35233ABFEE824AA2B940C5F04335CA59E0C4</code></pre> -<!-- end g_b --> -<h6>7.1) generation of encrypted_data</h6> -<!-- start client_DH_inner_data --> -<p>Generated payload (excluding transport headers/trailers):</p> -<pre><code>0000 | 54 B6 43 66 B0 BB 83 C2 68 49 38 B7 6A C4 92 3A -0010 | A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD AE 33 E6 EE -0020 | 39 4B 47 42 00 00 00 00 00 00 00 00 FE 00 01 00 -0030 | 69 A1 9D F1 CA 7E 2F 7E B2 D1 C4 FB 9B A2 85 6E -0040 | F2 AA 19 51 06 69 FF 99 17 57 F7 A3 A1 0A A1 76 -0050 | A8 1C BD 99 3D C7 BD 79 4C 4E 16 90 56 60 1B AB -0060 | FF E5 C1 A8 DC 6B CB 70 5B B2 4B DB 5E 17 28 0D -0070 | 26 DA F0 A9 A8 01 55 8C B8 7A 11 E3 0D 6E 8D D2 -0080 | 9C C0 39 D0 14 EA 81 9C D0 F8 14 8C BA 1B DB 21 -0090 | 33 1F FC B6 06 3E D8 FB 66 A6 E9 0A 02 A8 0B 68 -00A0 | CD E5 3C B4 5D 12 66 E8 C1 96 17 FD D5 AF D8 24 -00B0 | 00 1F D1 6B F6 66 A1 94 6B 54 B4 5C 75 1C DD 53 -00C0 | 5B 37 18 C6 BE 7A 2E BA D4 B3 5F 5C A6 1D 12 8B -00D0 | 5B 10 ED 42 23 C0 8D 72 94 FC E1 8C 8D 30 B5 CF -00E0 | C8 D7 3A 80 46 91 50 F7 18 0F 5F 76 F4 FE AA 01 -00F0 | 56 EF A7 66 5B B3 7F 87 B5 F9 EE AA 65 45 50 55 -0100 | 5C 05 F9 13 42 60 8B B7 6F 1E 39 4E A6 C5 1C E6 -0110 | 45 89 54 0E 87 29 F9 F5 AE 1B 33 10 8E 8D 35 23 -0120 | 3A BF EE 82 4A A2 B9 40 C5 F0 43 35 CA 59 E0 C4</code></pre> -<p>Payload (de)serialization:</p> -<pre><code>client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;</code></pre> +<h4><a class="anchor" href="#6-random-number-b-is-computed" id="6-random-number-b-is-computed" name="6-random-number-b-is-computed"><i class="anchor-icon"></i></a>6. Random number b is computed:</h4> +<pre><code>b = 6F620AFA575C9233EB4C014110A7BCAF49464F798A18A0981FEA1E05E8DA67D9681E0FD6DF0EDF0272AE3492451A84502F2EFC0DA18741A5FB80BD82296919A70FAA6D07CBBBCA2037EA7D3E327B61D585ED3373EE0553A91CBD29B01FA9A89D479CA53D57BDE3A76FBD922A923A0A38B922C1D0701F53FF52D7EA9217080163A64901E766EB6A0F20BC391B64B9D1DD2CD13A7D0C946A3A7DF8CEC9E2236446F646C42CFE2B60A2A8D776E56C8D7519B08B88ED0970E10D12A8C9E355D765F2B7BBB7B4CA9360083435523CB0D57D2B106FD14F94B4EEE79D8AC131CA56AD389C84FE279716F8124A543337FB9EA3D988EC5FA63D90A4BA3970E7A39E5C0DE5</code></pre> +<h5><a class="anchor" href="#generation-of-encrypted-data" id="generation-of-encrypted-data" name="generation-of-encrypted-data"><i class="anchor-icon"></i></a>Generation of encrypted_data</h5> +<pre><code>client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data</code></pre> <table class="table"> <thead> <tr> @@ -653,80 +513,40 @@ answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474 <tr> <td>%(client_DH_inner_data)</td> <td>0, 4</td> -<td><code>54b64366</code></td> -<td><em>client_DH_inner_data</em> constructor number from TL schema</td> +<td><code>6643b654</code></td> +<td>client_DH_inner_data constructor number from TL schema</td> </tr> <tr> <td>nonce</td> <td>4, 16</td> -<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> +<td><code>3E0549828CCA27E966B301A48FECE2FC</code></td> <td>Value generated by client in Step 1</td> </tr> <tr> <td>server_nonce</td> <td>20, 16</td> -<td><code>592E37C5BF99B8DDAE33E6EE394B4742</code></td> +<td><code>A5CF4D33F4A11EA877BA4AA573907330</code></td> <td>Value received from server in Step 2</td> </tr> <tr> -<td>g_b</td> -<td>36, 260</td> -<td><code>FE00010069A19DF1CA7E2F7EB2D1C4FB</code> <code>9BA2856EF2AA19510669FF991757F7A3</code> <code>A10AA176A81CBD993DC7BD794C4E1690</code> <code>56601BABFFE5C1A8DC6BCB705BB24BDB</code> <code>5E17280D26DAF0A9A801558CB87A11E3</code> <code>0D6E8DD29CC039D014EA819CD0F8148C</code> <code>BA1BDB21331FFCB6063ED8FB66A6E90A</code> <code>02A80B68CDE53CB45D1266E8C19617FD</code> <code>D5AFD824001FD16BF666A1946B54B45C</code> <code>751CDD535B3718C6BE7A2EBAD4B35F5C</code> <code>A61D128B5B10ED4223C08D7294FCE18C</code> <code>8D30B5CFC8D73A80469150F7180F5F76</code> <code>F4FEAA0156EFA7665BB37F87B5F9EEAA</code> <code>654550555C05F91342608BB76F1E394E</code> <code>A6C51CE64589540E8729F9F5AE1B3310</code> <code>8E8D35233ABFEE824AA2B940C5F04335</code><br> <code>CA59E0C4</code></td> -<td>Single-byte prefix denoting length, a 256-byte (2048-bit) string, and zero bytes of padding</td> +<td>retry_id</td> +<td>36, 8</td> +<td><code>0</code></td> +<td>First attempt</td> </tr> <tr> -<td>retry_id</td> -<td>296, 8</td> -<td><code>0000000000000000</code></td> -<td>Equal to zero at the time of the first attempt; otherwise, it is equal to <code>auth_key_aux_hash</code> from the previous failed attempt (see Item 7).</td> +<td>g_b</td> +<td>44, 260</td> +<td><code>73700E7BFC7AEEC828EB8E0DCC04D09A</code> <code>0DD56A1B4B35F72F0B55FCE7DB7EBB72</code> <code>D7C33C5D4AA59E1C74D09B01AE536B31</code> <code>8CFED436AFDB15FE9EB4C70D7F0CB14E</code> <code>46DBBDE9053A64304361EB358A9BB32E</code> <code>9D5C2843FE87248B89C3F066A7D5876D</code> <code>61657ACC52B0D81CD683B2A0FA93E8AD</code> <code>AB20377877F3BC3369BBF57B10F5B589</code> <code>E65A9C27490F30A0C70FFCFD3453F5B3</code> <code>79C1B9727A573CFFDCA8D23C721B135B</code> <code>92E529B1CDD2F7ABD4F34DAC4BE1EEAF</code> <code>60993DDE8ED45890E4F47C26F2C0B2E0</code> <code>37BB502739C8824F2A99E2B1E7E41658</code> <code>3417CC79A8807A4BDAC6A5E9805D4F61</code> <code>86C37D66F6988C9F9C752896F3D34D25</code> <code>529263FAF2670A09B2A59CE35264511F</code></td> +<td><code>g^b mod dh_prime</code></td> </tr> </tbody> </table> -<!-- end client_DH_inner_data --> -<p>The serialization of <em>Client_DH_Inner_Data</em> produces a string <strong>data</strong>. This is used to generate <strong>encrypted_data</strong> as specified in <a href="#7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message">step 6</a>, using the following inputs:</p> -<!-- start client_DH_inner_data_input --> -<pre><code>data = 54B64366B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B47420000000000000000FE00010069A19DF1CA7E2F7EB2D1C4FB9BA2856EF2AA19510669FF991757F7A3A10AA176A81CBD993DC7BD794C4E169056601BABFFE5C1A8DC6BCB705BB24BDB5E17280D26DAF0A9A801558CB87A11E30D6E8DD29CC039D014EA819CD0F8148CBA1BDB21331FFCB6063ED8FB66A6E90A02A80B68CDE53CB45D1266E8C19617FDD5AFD824001FD16BF666A1946B54B45C751CDD535B3718C6BE7A2EBAD4B35F5CA61D128B5B10ED4223C08D7294FCE18C8D30B5CFC8D73A80469150F7180F5F76F4FEAA0156EFA7665BB37F87B5F9EEAA654550555C05F91342608BB76F1E394EA6C51CE64589540E8729F9F5AE1B33108E8D35233ABFEE824AA2B940C5F04335CA59E0C4 -padding = 4670CB59FFB7033A86C62AA9 -tmp_aes_key = 3826079A7BBD2CC9B9AE0E9D1BEEDA1A663CE630DC446D259DE256A1C953E8FA -tmp_aes_iv = 7A6748BA29AAC95EF75BD4588351617832FD34568EF1C4018F04F871FA05D41E</code></pre> -<!-- end client_DH_inner_data_input --> -<p>Process:</p> -<pre><code>data_with_hash := SHA1(data) + data + padding (0-15 random bytes such that total length is divisible by 16) -encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);</code></pre> -<p>Output:</p> -<!-- start client_DH_inner_data_output --> -<pre><code>encrypted_data = B157BF3596956D48DF20A9E10AB507971128D20530E7E3B6087FB1BA74DBE774DE8C5A1AC9D01F70868ED3681FC694F30CE358FC74B854DB48143196F4555CB22721DB87E83D14286CBFB54F4C18F51C9EB719C5924B4E546D6B073C68BA93198FB7A91FB4538E88F6DA2DCCF3734F7EA0112595DEDD6E69C38A5F70E1507069C26E847FB39EEF4BE96863A898FB521117DA5289CAD8F26F3D912D3314A3D4E54D81202AB36ED3625704730BCB495D3464433CB2CC51D1A355AD788C04084CFF69AEAA9AC6282785192BE1C7C1E4AC14E91358056E1A4BC2B0D5E9840F19F70257AD7975DAC3338C5B393835296E51D4845C07962A58F88EE2E2E67C46B1F44CBCA4624D6BD8CC3BA6B59B635CAFF706893E6368404F0475975F652D4C7C69C4E8FA88A9023BB89895823132B3408C0326A4FE9EE68ADEBC56768F0329C9DB79108F080FCEE326135F10E4F89E4C9EF5</code></pre> -<!-- end client_DH_inner_data_output --> -<p>The length of the final string is 336 bytes.</p> -<h6>7.2) set_client_DH_params query</h6> -<!-- start set_client_DH_params --> -<p>Sent payload (excluding transport headers/trailers):</p> -<pre><code>0000 | 00 00 00 00 00 00 00 00 BC D6 09 00 B2 AF 9C 64 -0010 | 78 01 00 00 1F 5F 04 F5 B0 BB 83 C2 68 49 38 B7 -0020 | 6A C4 92 3A A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD -0030 | AE 33 E6 EE 39 4B 47 42 FE 50 01 00 B1 57 BF 35 -0040 | 96 95 6D 48 DF 20 A9 E1 0A B5 07 97 11 28 D2 05 -0050 | 30 E7 E3 B6 08 7F B1 BA 74 DB E7 74 DE 8C 5A 1A -0060 | C9 D0 1F 70 86 8E D3 68 1F C6 94 F3 0C E3 58 FC -0070 | 74 B8 54 DB 48 14 31 96 F4 55 5C B2 27 21 DB 87 -0080 | E8 3D 14 28 6C BF B5 4F 4C 18 F5 1C 9E B7 19 C5 -0090 | 92 4B 4E 54 6D 6B 07 3C 68 BA 93 19 8F B7 A9 1F -00A0 | B4 53 8E 88 F6 DA 2D CC F3 73 4F 7E A0 11 25 95 -00B0 | DE DD 6E 69 C3 8A 5F 70 E1 50 70 69 C2 6E 84 7F -00C0 | B3 9E EF 4B E9 68 63 A8 98 FB 52 11 17 DA 52 89 -00D0 | CA D8 F2 6F 3D 91 2D 33 14 A3 D4 E5 4D 81 20 2A -00E0 | B3 6E D3 62 57 04 73 0B CB 49 5D 34 64 43 3C B2 -00F0 | CC 51 D1 A3 55 AD 78 8C 04 08 4C FF 69 AE AA 9A -0100 | C6 28 27 85 19 2B E1 C7 C1 E4 AC 14 E9 13 58 05 -0110 | 6E 1A 4B C2 B0 D5 E9 84 0F 19 F7 02 57 AD 79 75 -0120 | DA C3 33 8C 5B 39 38 35 29 6E 51 D4 84 5C 07 96 -0130 | 2A 58 F8 8E E2 E2 E6 7C 46 B1 F4 4C BC A4 62 4D -0140 | 6B D8 CC 3B A6 B5 9B 63 5C AF F7 06 89 3E 63 68 -0150 | 40 4F 04 75 97 5F 65 2D 4C 7C 69 C4 E8 FA 88 A9 -0160 | 02 3B B8 98 95 82 31 32 B3 40 8C 03 26 A4 FE 9E -0170 | E6 8A DE BC 56 76 8F 03 29 C9 DB 79 10 8F 08 0F -0180 | CE E3 26 13 5F 10 E4 F8 9E 4C 9E F5</code></pre> -<p>Payload (de)serialization:</p> +<p>The serialization of <em>Client_DH_Inner_Data</em> produces some string <strong>data</strong>. This is followed by <strong>encrypted_data</strong>:</p> +<pre><code>data_with_hash := SHA1(data) + data + (0-15 random bytes); such that the length be divisible by 16; +AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv) = 928A4957D0463B525C1CC48AABAA030A256BE5C746792C84CA4C5A0DF60AC799048D98A38A8480EDCF082214DFC79DCB9EE34E206513E2B3BC1504CFE6C9ADA46BF9A03CA74F192EAF8C278454ADABC795A566615462D31817382984039505F71CB33A41E2527A4B1AC05107872FED8E3ABCEE1518AE965B0ED3AED7F67479155BDA8E4C286B64CDF123EC748CF289B1DB02D1907B562DF462D8582BA6F0A3022DC2D3504D69D1BA48B677E3A830BFAFD67584C8AA24E1344A8904E305F9587C92EF964F0083F50F61EAB4A393EAA33C9270294AEDC7732891D4EA1599F52311D74469D2112F4EDF3F342E93C8E87E812DC3989BAECFE6740A46077524C75093F5A5405736DE8937BB6E42C9A0DCF22CA53227D462BCCC2CFE94B6FE86AB7FBFA395021F66661AF7C0024CA2986CA03F3476905407D1EA9C010B763258DB1AA2CC7826D91334EFC1FDC665B67FE45ED0</code></pre> +<p>The length of the final string was 336 bytes.</p> +<h5><a class="anchor" href="#request" id="request" name="request"><i class="anchor-icon"></i></a>Request</h5> <pre><code>set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;</code></pre> <table class="table"> <thead> @@ -741,64 +561,86 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);< <tr> <td>auth_key_id</td> <td>0, 8</td> -<td><code>0000000000000000</code></td> -<td>0 since the message is in plain text</td> +<td><code>0</code></td> +<td>Since message is in plain text</td> </tr> <tr> <td>message_id</td> <td>8, 8</td> -<td><code>BCD60900B2AF9C64</code></td> -<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> +<td><code>51e57acd2aa32c6d</code></td> +<td>Exact unixtime * 2^32</td> </tr> <tr> <td>message_length</td> <td>16, 4</td> -<td><code>78010000</code> (376 in decimal)</td> +<td><code>376</code></td> <td>Message body length</td> </tr> <tr> <td>%(set_client_DH_params)</td> <td>20, 4</td> -<td><code>1f5f04f5</code></td> -<td><em>set_client_DH_params</em> constructor number from TL schema</td> +<td><code>f5045f1f</code></td> +<td>set_client_DH_params constructor number from TL schema</td> </tr> <tr> <td>nonce</td> <td>24, 16</td> -<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> +<td><code>3E0549828CCA27E966B301A48FECE2FC</code></td> <td>Value generated by client in Step 1</td> </tr> <tr> <td>server_nonce</td> <td>40, 16</td> -<td><code>592E37C5BF99B8DDAE33E6EE394B4742</code></td> +<td><code>A5CF4D33F4A11EA877BA4AA573907330</code></td> <td>Value received from server in Step 2</td> </tr> <tr> <td>encrypted_data</td> <td>56, 340</td> -<td><code>FE500100B157BF3596956D48DF20A9E1</code> <code>0AB507971128D20530E7E3B6087FB1BA</code> <code>74DBE774DE8C5A1AC9D01F70868ED368</code> <code>1FC694F30CE358FC74B854DB48143196</code> <code>F4555CB22721DB87E83D14286CBFB54F</code> <code>4C18F51C9EB719C5924B4E546D6B073C</code> <code>68BA93198FB7A91FB4538E88F6DA2DCC</code> <code>F3734F7EA0112595DEDD6E69C38A5F70</code> <code>E1507069C26E847FB39EEF4BE96863A8</code> <code>98FB521117DA5289CAD8F26F3D912D33</code> <code>14A3D4E54D81202AB36ED3625704730B</code> <code>CB495D3464433CB2CC51D1A355AD788C</code> <code>04084CFF69AEAA9AC6282785192BE1C7</code> <code>C1E4AC14E91358056E1A4BC2B0D5E984</code> <code>0F19F70257AD7975DAC3338C5B393835</code> <code>296E51D4845C07962A58F88EE2E2E67C</code> <code>46B1F44CBCA4624D6BD8CC3BA6B59B63</code> <code>5CAFF706893E6368404F0475975F652D</code> <code>4C7C69C4E8FA88A9023BB89895823132</code> <code>B3408C0326A4FE9EE68ADEBC56768F03</code> <code>29C9DB79108F080FCEE326135F10E4F8</code><br> <code>9E4C9EF5</code></td> -<td>Encrypted client_DH_inner_data generated previously, serialized as a TL byte string</td> +<td>See above</td> +<td>See <a href="#generation-of-encrypted-data">“Generation of encrypted_data"</a></td> </tr> </tbody> </table> -<!-- end set_client_DH_params --> -<h5><a class="anchor" href="#8-auth-key-generation" id="8-auth-key-generation" name="8-auth-key-generation"><i class="anchor-icon"></i></a>8) Auth key generation</h5> -<p>The client computes the auth_key using formula <code>g_a^b mod dh_prime</code>:</p> -<!-- start auth_key --> -<pre><code>auth_key = 4B2FB207D87D159C14CFBC094533E4305721FD3F8CF1F4C2E218481DAD5BDE4BD687064C86A2F9B15DDF2EB43F6558C7EF91B99FADF614711AEDC6BBAE02F10B97EC40B81837695E58F11F2FAC48E949AF2DBC35E3A8476FF2C8C1CA85835634BEA918657C9801AD8876E8319C02ADF9209EAF5A3D429560D98816943C3019971B67372E146106CD27FB110A589DA8890F43348AF77143AFFCB08BEBEF89BD14BBFECC6AFE2B028C4BEC26ADC3D6786DABFF738CDAEBFE2D15806977DB496736716CD0B64938F1AEC6911FB56B70CC86BFB458048E970CD28E2F3844B7082493C1D46C0EA0AA798068C4160DA2C2D7562A6160255C6A1D7C3C47B7B8DD1C6D55</code></pre> -<!-- end auth_key --> -<h5><a class="anchor" href="#9-final-server-reply" id="9-final-server-reply" name="9-final-server-reply"><i class="anchor-icon"></i></a>9) Final server reply</h5> -<p>The server verifies and confirms that auth_key_hash is unique: since it's unique, it replies with the following:</p> -<!-- start dh_gen_ok --> -<p>Received payload (excluding transport headers/trailers):</p> -<pre><code>0000 | 00 00 00 00 00 00 00 00 01 60 9B 67 B2 AF 9C 64 -0010 | 34 00 00 00 34 F7 CB 3B B0 BB 83 C2 68 49 38 B7 -0020 | 6A C4 92 3A A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD -0030 | AE 33 E6 EE 39 4B 47 42 6A F1 5D D5 EA 4A 58 6A -0040 | 27 E0 A1 DC 7E 26 D2 C4</code></pre> -<p>Payload (de)serialization:</p> -<pre><code>dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;</code></pre> +<pre><code>0000 | 00 00 00 00 00 00 00 00 6D 2C A3 2A CD 7A E5 51 +0010 | 78 01 00 00 1F 5F 04 F5 3E 05 49 82 8C CA 27 E9 +0020 | 66 B3 01 A4 8F EC E2 FC A5 CF 4D 33 F4 A1 1E A8 +0030 | 77 BA 4A A5 73 90 73 30 FE 50 01 00 92 8A 49 57 +0040 | D0 46 3B 52 5C 1C C4 8A AB AA 03 0A 25 6B E5 C7 +0050 | 46 79 2C 84 CA 4C 5A 0D F6 0A C7 99 04 8D 98 A3 +0060 | 8A 84 80 ED CF 08 22 14 DF C7 9D CB 9E E3 4E 20 +0070 | 65 13 E2 B3 BC 15 04 CF E6 C9 AD A4 6B F9 A0 3C +0080 | A7 4F 19 2E AF 8C 27 84 54 AD AB C7 95 A5 66 61 +0090 | 54 62 D3 18 17 38 29 84 03 95 05 F7 1C B3 3A 41 +00A0 | E2 52 7A 4B 1A C0 51 07 87 2F ED 8E 3A BC EE 15 +00B0 | 18 AE 96 5B 0E D3 AE D7 F6 74 79 15 5B DA 8E 4C +00C0 | 28 6B 64 CD F1 23 EC 74 8C F2 89 B1 DB 02 D1 90 +00D0 | 7B 56 2D F4 62 D8 58 2B A6 F0 A3 02 2D C2 D3 50 +00E0 | 4D 69 D1 BA 48 B6 77 E3 A8 30 BF AF D6 75 84 C8 +00F0 | AA 24 E1 34 4A 89 04 E3 05 F9 58 7C 92 EF 96 4F +0100 | 00 83 F5 0F 61 EA B4 A3 93 EA A3 3C 92 70 29 4A +0110 | ED C7 73 28 91 D4 EA 15 99 F5 23 11 D7 44 69 D2 +0120 | 11 2F 4E DF 3F 34 2E 93 C8 E8 7E 81 2D C3 98 9B +0130 | AE CF E6 74 0A 46 07 75 24 C7 50 93 F5 A5 40 57 +0140 | 36 DE 89 37 BB 6E 42 C9 A0 DC F2 2C A5 32 27 D4 +0150 | 62 BC CC 2C FE 94 B6 FE 86 AB 7F BF A3 95 02 1F +0160 | 66 66 1A F7 C0 02 4C A2 98 6C A0 3F 34 76 90 54 +0170 | 07 D1 EA 9C 01 0B 76 32 58 DB 1A A2 CC 78 26 D9 +0180 | 13 34 EF C1 FD C6 65 B6 7F E4 5E D0</code></pre> +<h4><a class="anchor" href="#7-computing-auth-key-using-formula-gab-mod-dh-prime" id="7-computing-auth-key-using-formula-gab-mod-dh-prime" name="7-computing-auth-key-using-formula-gab-mod-dh-prime"><i class="anchor-icon"></i></a>7. Computing auth_key using formula <code>g^{ab} mod dh_prime</code>:</h4> +<pre><code>auth_key = AB96E207C631300986F30EF97DF55E179E63C112675F0CE502EE76D74BBEE6CBD1E95772818881E9F2FF54BD52C258787474F6A7BEA61EABE49D1D01D55F64FC07BC31685716EC8FB46FEACF9502E42CFD6B9F45A08E90AA5C2B5933AC767CBE1CD50D8E64F89727CA4A1A5D32C0DB80A9FCDBDDD4F8D5A1E774198F1A4299F927C484FEEC395F29647E43C3243986F93609E23538C21871DF50E00070B3B6A8FA9BC15628E8B43FF977409A61CEEC5A21CF7DFB5A4CC28F5257BC30CD8F2FB92FBF21E28924065F50E0BBD5E11A420300E2C136B80E9826C6C5609B5371B7850AA628323B6422F3A94F6DFDE4C3DC1EA60F7E11EE63122B3F39CBD1A8430157</code></pre> +<h4><a class="anchor" href="#8-the-server-verifies-that-auth-key-hash-is-unique" id="8-the-server-verifies-that-auth-key-hash-is-unique" name="8-the-server-verifies-that-auth-key-hash-is-unique"><i class="anchor-icon"></i></a>8. The server verifies that auth_key_hash is unique.</h4> +<p>The key is unique.</p> +<h4><a class="anchor" href="#9-a-response-from-the-server-has-been-received-with-the-following-content" id="9-a-response-from-the-server-has-been-received-with-the-following-content" name="9-a-response-from-the-server-has-been-received-with-the-following-content"><i class="anchor-icon"></i></a>9. A response from the server has been received with the following content:</h4> +<pre><code>0000 | 00 00 00 00 00 00 00 00 01 30 AA C5 CE 7A E5 51 +0010 | 34 00 00 00 34 F7 CB 3B 3E 05 49 82 8C CA 27 E9 +0020 | 66 B3 01 A4 8F EC E2 FC A5 CF 4D 33 F4 A1 1E A8 +0030 | 77 BA 4A A5 73 90 73 30 CC EB C0 21 72 66 E1 ED +0040 | EC 7F B0 A0 EE D6 C2 20</code></pre> +<p>Set_client_DH_params_answer decomposition using the following formula:</p> +<pre><code>dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer; +dh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer; +dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;</code></pre> <table class="table"> <thead> <tr> @@ -810,50 +652,30 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);< </thead> <tbody> <tr> -<td>auth_key_id</td> -<td>0, 8</td> -<td><code>0000000000000000</code></td> -<td>0 since the message is in plain text</td> -</tr> -<tr> -<td>message_id</td> -<td>8, 8</td> -<td><code>01609B67B2AF9C64</code></td> -<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> -</tr> -<tr> -<td>message_length</td> -<td>16, 4</td> -<td><code>34000000</code> (52 in decimal)</td> -<td>Message body length</td> -</tr> -<tr> <td>%(dh_gen_ok)</td> -<td>20, 4</td> -<td><code>34f7cb3b</code></td> -<td><em>dh_gen_ok</em> constructor number from TL schema</td> +<td>0, 4</td> +<td><code>3bcbf734</code></td> +<td>dh_gen_ok constructor number from TL schema</td> </tr> <tr> <td>nonce</td> -<td>24, 16</td> -<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> +<td>4, 16</td> +<td><code>3E0549828CCA27E966B301A48FECE2FC</code></td> <td>Value generated by client in Step 1</td> </tr> <tr> <td>server_nonce</td> -<td>40, 16</td> -<td><code>592E37C5BF99B8DDAE33E6EE394B4742</code></td> +<td>20, 16</td> +<td><code>A5CF4D33F4A11EA877BA4AA573907330</code></td> <td>Value received from server in Step 2</td> </tr> <tr> <td>new_nonce_hash1</td> -<td>56, 16</td> -<td><code>6AF15DD5EA4A586A27E0A1DC7E26D2C4</code></td> -<td>The 128 lower-order bits of SHA1 of the byte string derived from the <code>new_nonce</code> string by adding a single byte with the value of 1, 2, or 3, and followed by another 8 bytes with <code>auth_key_aux_hash</code>. Different values are required to prevent an intruder from changing server response dh_gen_ok into dh_gen_retry.</td> +<td>36, 16</td> +<td><code>CCEBC0217266E1EDEC7FB0A0EED6C220</code></td> </tr> </tbody> -</table> -<!-- end dh_gen_ok --></div> +</table></div> </div> diff --git a/data/web/corefork.telegram.org/type/MessageEntity.html b/data/web/corefork.telegram.org/type/MessageEntity.html index 6862b85b34..eaf03047d4 100644 --- a/data/web/corefork.telegram.org/type/MessageEntity.html +++ b/data/web/corefork.telegram.org/type/MessageEntity.html @@ -127,7 +127,7 @@ </tr> <tr> <td><a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a></td> -<td>Message entity representing a <a href="https://google.com">text url</a>: for in-text urls like <a href="https://google.com">https://google.com</a> use <a href="/constructor/messageEntityUrl">messageEntityUrl</a>.<br><br>Note that an additional confirmation popup with the full URL must be displayed to the user before opening this link, unless the domain satisfies the conditions specified in the <a href="/api/config#whitelisted-domains">domain whitelist documentation »</a>.</td> +<td>Message entity representing a <a href="https://google.com">text url</a>: for in-text urls like <a href="https://google.com">https://google.com</a> use <a href="/constructor/messageEntityUrl">messageEntityUrl</a>.<br><br>Note that an additional confirmation popup with the full URL must be displayed to the user before opening this link, unless the domain is one of the whitelisted domains specified in the <a href="/api/config#whitelisted-domains"><code>whitelisted_domains</code> client configuration parameter »</a>.</td> </tr> <tr> <td><a href="/constructor/messageEntityMentionName">messageEntityMentionName</a></td>