mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2025-01-11 12:41:37 +01:00
Update content of files
This commit is contained in:
parent
ca447f9af6
commit
50ab869498
78 changed files with 693 additions and 693 deletions
|
@ -224,7 +224,7 @@ This allows the server to filter messages based on a text query, and even on the
|
|||
<h4><a class="anchor" href="#native-antispam-system" id="native-antispam-system" name="native-antispam-system"><i class="anchor-icon"></i></a><a href="/api/antispam">Native antispam system</a></h4>
|
||||
<p>Admins of supergroups with a certain number of members can choose to unleash the full proactive power of Telegram's own antispam algorithms – turning on the new Aggressive mode for the automated spam filters.</p>
|
||||
<h4><a class="anchor" href="#collectibles" id="collectibles" name="collectibles"><i class="anchor-icon"></i></a><a href="/api/fragment">Collectibles</a></h4>
|
||||
<p>Telegram users can make it easy for others to contact them or find their public groups and channels via <a href="https://telegram.org/faq#usernames-and-t-me">usernames</a>: clients can also assign multiple <a href="https://fragment.com">Fragment »</a> <strong>collectible usernames</strong> to accounts, supergroups and channels they own; <a href="https://fragment.com">Fragment »</a> also allows purchasing phone number collectibles that can be used to register Telegram accounts. </p>
|
||||
<p>Telegram users can make it easy for others to contact them or find their public groups and channels via <a href="https://telegram.org/faq#usernames-and-t-me">usernames</a>: clients can also assign multiple <a href="https://fragment.com">Fragment »</a> <strong>collectible usernames</strong> to accounts, supergroups and channels they own; <a href="https://fragment.com">Fragment »</a> also allows purchasing phone number collectibles that can be used to register Telegram accounts. </p>
|
||||
<h4><a class="anchor" href="#telegram-premium" id="telegram-premium" name="telegram-premium"><i class="anchor-icon"></i></a><a href="/api/premium">Telegram Premium</a></h4>
|
||||
<p>Telegram Premium is an optional subscription service that unlocks additional exclusive client-side and API-side features, while helping support the development of the app. It is a part of Telegram’s <strong>sustainable monetization</strong> – driven by our users, rather than advertisers or shareholders. This way, Telegram can remain independent and prioritize its users first. </p>
|
||||
<h4><a class="anchor" href="#telegram-business" id="telegram-business" name="telegram-business"><i class="anchor-icon"></i></a><a href="/api/business">Telegram Business</a></h4>
|
||||
|
|
|
@ -224,7 +224,7 @@ This allows the server to filter messages based on a text query, and even on the
|
|||
<h4><a class="anchor" href="#native-antispam-system" id="native-antispam-system" name="native-antispam-system"><i class="anchor-icon"></i></a><a href="/api/antispam">Native antispam system</a></h4>
|
||||
<p>Admins of supergroups with a certain number of members can choose to unleash the full proactive power of Telegram's own antispam algorithms – turning on the new Aggressive mode for the automated spam filters.</p>
|
||||
<h4><a class="anchor" href="#collectibles" id="collectibles" name="collectibles"><i class="anchor-icon"></i></a><a href="/api/fragment">Collectibles</a></h4>
|
||||
<p>Telegram users can make it easy for others to contact them or find their public groups and channels via <a href="https://telegram.org/faq#usernames-and-t-me">usernames</a>: clients can also assign multiple <a href="https://fragment.com">Fragment »</a> <strong>collectible usernames</strong> to accounts, supergroups and channels they own; <a href="https://fragment.com">Fragment »</a> also allows purchasing phone number collectibles that can be used to register Telegram accounts. </p>
|
||||
<p>Telegram users can make it easy for others to contact them or find their public groups and channels via <a href="https://telegram.org/faq#usernames-and-t-me">usernames</a>: clients can also assign multiple <a href="https://fragment.com">Fragment »</a> <strong>collectible usernames</strong> to accounts, supergroups and channels they own; <a href="https://fragment.com">Fragment »</a> also allows purchasing phone number collectibles that can be used to register Telegram accounts. </p>
|
||||
<h4><a class="anchor" href="#telegram-premium" id="telegram-premium" name="telegram-premium"><i class="anchor-icon"></i></a><a href="/api/premium">Telegram Premium</a></h4>
|
||||
<p>Telegram Premium is an optional subscription service that unlocks additional exclusive client-side and API-side features, while helping support the development of the app. It is a part of Telegram’s <strong>sustainable monetization</strong> – driven by our users, rather than advertisers or shareholders. This way, Telegram can remain independent and prioritize its users first. </p>
|
||||
<h4><a class="anchor" href="#telegram-business" id="telegram-business" name="telegram-business"><i class="anchor-icon"></i></a><a href="/api/business">Telegram Business</a></h4>
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
<ul>
|
||||
<li>Report the chat for spam using <a href="/method/account.reportPeer">account.reportPeer</a> and <a href="/constructor/inputReportReasonSpam">inputReportReasonSpam</a>.<br>
|
||||
If the other user has an emoji status, then the bar should also show a notice, indicating that the emoji status is shown next to the user's name because they have purchased <a href="/api/premium">Telegram Premium</a> (i.e. this is useful to avoid issues if the user uses an emoji status similar to a verified checkmark).<br>
|
||||
Additionally, if the chat was automatically <a href="/api/folders#peer-folders">archived »</a> (according to <a href="/constructor/peerSettings">peerSettings</a>.<code>autoarchived</code>), an extra button can be shown to unarchive the chat <a href="/api/folders#peer-folders">as specified here »</a> instead of reporting it.</li>
|
||||
Additionally, if the chat was automatically <a href="/api/folders#peer-folders">archived »</a> (according to <a href="/constructor/peerSettings">peerSettings</a>.<code>autoarchived</code>), an extra button can be shown to unarchive the chat <a href="/api/folders#peer-folders">as specified here »</a> instead of reporting it.</li>
|
||||
<li>Add the other user of the chat to the contact list using <a href="/method/contacts.addContact">contacts.addContact</a>.<br>
|
||||
Optionally, the <a href="/constructor/peerSettings">peerSettings</a>.<code>need_contacts_exception</code> flag may also be set: if so, the <code>add_phone_privacy_exception</code> flag <strong>must</strong> be set if the user clicks on the add contact button, invoking <a href="/method/contacts.addContact">contacts.addContact</a>. </li>
|
||||
<li>Block the other user of the chat from writing to us using <a href="/method/contacts.block">contacts.block</a> (without setting the <code>my_stories_from</code> flag). </li>
|
||||
|
@ -93,7 +93,7 @@ Optionally, the <a href="/constructor/peerSettings">peerSettings</a>.<code>need_
|
|||
<p>This action bar, associated to a private or secret chat, offers the user a button to report the chat for spam using <a href="/method/account.reportPeer">account.reportPeer</a> and <a href="/constructor/inputReportReasonSpam">inputReportReasonSpam</a>. </p>
|
||||
<p>If the other user has an emoji status, then the bar should also show a notice, indicating that the emoji status is shown next to the user's name because they have purchased <a href="/api/premium">Telegram Premium</a> (i.e. this is useful to avoid issues if the user uses an emoji status similar to a verified checkmark). </p>
|
||||
<p><strong>Condition</strong>: the <a href="/constructor/peerSettings">peerSettings</a>.<code>report_spam</code> flag must be set, and the <a href="/constructor/peerSettings">peerSettings</a>.<code>add_contact</code>, <a href="/constructor/peerSettings">peerSettings</a>.<code>block_contact</code> flags must <strong>not</strong> be set.</p>
|
||||
<p>Additionally, if the chat was automatically <a href="/api/folders#peer-folders">archived »</a> (according to <a href="/constructor/peerSettings">peerSettings</a>.<code>autoarchived</code>), an extra button can be shown to unarchive the chat <a href="/api/folders#peer-folders">as specified here »</a> instead of reporting it.</p>
|
||||
<p>Additionally, if the chat was automatically <a href="/api/folders#peer-folders">archived »</a> (according to <a href="/constructor/peerSettings">peerSettings</a>.<code>autoarchived</code>), an extra button can be shown to unarchive the chat <a href="/api/folders#peer-folders">as specified here »</a> instead of reporting it.</p>
|
||||
<h3><a class="anchor" href="#add-contact" id="add-contact" name="add-contact"><i class="anchor-icon"></i></a>Add contact</h3>
|
||||
<pre><code>---functions---
|
||||
|
||||
|
@ -129,7 +129,7 @@ Optionally, the <a href="/constructor/peerSettings">peerSettings</a>.<code>need_
|
|||
<p>This bar indicates that the associated group was created recently, and it offers a bar button to invite new members using <a href="/method/messages.addChatUser">messages.addChatUser</a> or <a href="/method/channels.inviteToChannel">channels.inviteToChannel</a>, depending on whether the associated peer is a <a href="/api/channel">group or a supergroup</a>.</p>
|
||||
<p><strong>Condition</strong>: the <a href="/constructor/peerSettings">peerSettings</a>.<code>invite_members</code> flag must be set.</p>
|
||||
<h3><a class="anchor" href="#an-admin-from-a-recent-join-request-is-contacting-you" id="an-admin-from-a-recent-join-request-is-contacting-you" name="an-admin-from-a-recent-join-request-is-contacting-you"><i class="anchor-icon"></i></a>An admin from a recent join request is contacting you</h3>
|
||||
<p>This bar indicates that the associated private or secret chat is a chat with an administrator of a <a href="/api/channel">group or channel</a> to which the user sent a <a href="/api/invites#join-requests">join request, see here for more info on join requests »</a>. </p>
|
||||
<p>This bar indicates that the associated private or secret chat is a chat with an administrator of a <a href="/api/channel">group or channel</a> to which the user sent a <a href="/api/invites#join-requests">join request, see here for more info on join requests »</a>. </p>
|
||||
<p><strong>Condition</strong>: the <code>request_chat_title</code> and <code>request_chat_date</code> fields of <a href="/constructor/peerSettings">peerSettings</a> must both be set; optionally <code>request_chat_broadcast</code> may also be set:</p>
|
||||
<ul>
|
||||
<li><code>request_chat_title</code> - Contains the group/channel's title.</li>
|
||||
|
@ -137,21 +137,21 @@ Optionally, the <a href="/constructor/peerSettings">peerSettings</a>.<code>need_
|
|||
<li><code>request_chat_broadcast</code> - This flag is set if the join request is related to a channel (otherwise, the join request is related to a group).</li>
|
||||
</ul>
|
||||
<h3><a class="anchor" href="#manage-a-connected-business-bot" id="manage-a-connected-business-bot" name="manage-a-connected-business-bot"><i class="anchor-icon"></i></a>Manage a connected business bot</h3>
|
||||
<p>This bar indicates that the associated private (non-secret) chat <em>with another user</em> is currently being managed by a <a href="/api/business#connected-bots">business bot connected to our current account »</a>. </p>
|
||||
<p>This bar indicates that the associated private (non-secret) chat <em>with another user</em> is currently being managed by a <a href="/api/business#connected-bots">business bot connected to our current account »</a>. </p>
|
||||
<p><strong>Condition</strong>: the <code>business_bot_id</code> and <code>business_bot_manage_url</code> fields of <a href="/constructor/peerSettings">peerSettings</a> must both be set; optionally, <code>business_bot_paused</code> and/or <code>business_bot_can_reply</code> may also be set:</p>
|
||||
<ul>
|
||||
<li><code>business_bot_id</code> - Contains the ID of the <a href="/api/business#connected-bots">business bot »</a> managing this chat, used to display info about the bot in the action bar. </li>
|
||||
<li><code>business_bot_manage_url</code> - Contains a <a href="/api/links">deep link »</a>, used to open a management menu in the business bot. </li>
|
||||
<li><code>business_bot_paused</code> - Whether the business bot was paused in this chat using <a href="/method/account.toggleConnectedBotPaused">account.toggleConnectedBotPaused »</a>. </li>
|
||||
<li><code>business_bot_id</code> - Contains the ID of the <a href="/api/business#connected-bots">business bot »</a> managing this chat, used to display info about the bot in the action bar. </li>
|
||||
<li><code>business_bot_manage_url</code> - Contains a <a href="/api/links">deep link »</a>, used to open a management menu in the business bot. </li>
|
||||
<li><code>business_bot_paused</code> - Whether the business bot was paused in this chat using <a href="/method/account.toggleConnectedBotPaused">account.toggleConnectedBotPaused »</a>. </li>
|
||||
<li><code>business_bot_can_reply</code> - Whether the business bot can reply to messages in this chat, as specified by the settings during <a href="/api/business#connected-bots">initial configuration</a>. </li>
|
||||
</ul>
|
||||
<p>The main action button of the action bar should be a Pause/Resume button that invokes <a href="/method/account.toggleConnectedBotPaused">account.toggleConnectedBotPaused »</a>. </p>
|
||||
<p>The main action button of the action bar should be a Pause/Resume button that invokes <a href="/method/account.toggleConnectedBotPaused">account.toggleConnectedBotPaused »</a>. </p>
|
||||
<p>The action bar dropdown menu should contain:</p>
|
||||
<ul>
|
||||
<li>A button to manage the bot, by opening the deep link in <code>business_bot_manage_url</code></li>
|
||||
<li>A button to disconnect the bot from this chat, which when pressed should invoke <a href="/method/account.toggleConnectedBotPaused">account.disablePeerConnectedBot »</a> to permanently disconnect the bot from this peer (this will also hide the action bar, unsetting the <code>business_bot_manage_url</code> and <code>business_bot_id</code> fields). </li>
|
||||
<li>A button to disconnect the bot from this chat, which when pressed should invoke <a href="/method/account.toggleConnectedBotPaused">account.disablePeerConnectedBot »</a> to permanently disconnect the bot from this peer (this will also hide the action bar, unsetting the <code>business_bot_manage_url</code> and <code>business_bot_id</code> fields). </li>
|
||||
</ul>
|
||||
<p>See <a href="/api/business#connected-bots">here »</a> for more info on business bots.</p></div>
|
||||
<p>See <a href="/api/business#connected-bots">here »</a> for more info on business bots.</p></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -58,8 +58,8 @@ The returned stickerset will contain a set of animated stickers, one for each of
|
|||
<p>Clients should substitute messages containing only one instance of one of the allowed emojis with the respective animated sticker.<br>
|
||||
Also, when receiving messages containing only one instance of a <a href="/api/custom-emoji">custom emoji</a>, instead of displaying a message bubble with a single small custom emoji inside, the scaled-up custom emoji should be displayed directly, like with normal stickers. </p>
|
||||
<p>Animated emojis should loop only once when first sent or received, or when clicked.<br>
|
||||
For <a href="#emoji-reactions">supported emojis</a>, clients on both sides of private chats with users are supposed to show a reaction animation when any of the two users clicks on the animated emoji: <a href="#emoji-reactions">click here for more info »</a>.</p>
|
||||
<p>For special <a href="/api/dice">dice emojis</a> like <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="🎯" />, or <img class="emoji" src="//telegram.org/img/emoji/40/F09F8F80.png" width="20" height="20" alt="🏀" />, clients are supposed to behave differently both when sending and receiving such emojis: <a href="/api/dice">click here for more info »</a>.</p>
|
||||
For <a href="#emoji-reactions">supported emojis</a>, clients on both sides of private chats with users are supposed to show a reaction animation when any of the two users clicks on the animated emoji: <a href="#emoji-reactions">click here for more info »</a>.</p>
|
||||
<p>For special <a href="/api/dice">dice emojis</a> like <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="🎯" />, or <img class="emoji" src="//telegram.org/img/emoji/40/F09F8F80.png" width="20" height="20" alt="🏀" />, clients are supposed to behave differently both when sending and receiving such emojis: <a href="/api/dice">click here for more info »</a>.</p>
|
||||
<h3><a class="anchor" href="#emojis-with-sounds" id="emojis-with-sounds" name="emojis-with-sounds"><i class="anchor-icon"></i></a>Emojis with sounds</h3>
|
||||
<p>Certain animated emojis should play sound when clicked, as specified by <a href="/api/config#client-configuration">server-side configuration</a>. </p>
|
||||
<p>The returned JSON object will contain the following map, with a list of file IDs to download:</p>
|
||||
|
@ -98,7 +98,7 @@ For <a href="#emoji-reactions">supported emojis</a>, clients on both sides of pr
|
|||
<a href='/method/messages.getStickerSet'>messages.getStickerSet</a>#c8a0ec74 stickerset:<a href='/type/InputStickerSet'>InputStickerSet</a> hash:<a href='/type/int'>int</a> = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;
|
||||
|
||||
<a href='/method/messages.setTyping'>messages.setTyping</a>#58943ee2 flags:<a href='/type/%23'>#</a> peer:<a href='/type/InputPeer'>InputPeer</a> top_msg_id:flags.0?<a href='/type/int'>int</a> action:<a href='/type/SendMessageAction'>SendMessageAction</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>Not to be confused with <a href="/api/reactions">message reactions »</a>. </p>
|
||||
<p>Not to be confused with <a href="/api/reactions">message reactions »</a>. </p>
|
||||
<p>On startup, clients should fetch the animated reaction emoji stickerset by calling the <a href="/method/messages.getStickerSet">messages.getStickerSet</a> method, providing <a href="/constructor/inputStickerSetAnimatedEmojiAnimations">inputStickerSetAnimatedEmojiAnimations</a> to the <code>stickerset</code> field.<br>
|
||||
The returned stickerset will contain a set of animated emoji reactions, <em>one or more</em> for each of the supported emojis.<br>
|
||||
If a set of reactions for the <img class="emoji" src="//telegram.org/img/emoji/40/E29DA4.png" width="20" height="20" alt="❤" /> emoji is returned, the same reactions should also be assigned to the <img class="emoji" src="//telegram.org/img/emoji/40/F09FA7A1.png" width="20" height="20" alt="🧡" />, <img class="emoji" src="//telegram.org/img/emoji/40/F09F929B.png" width="20" height="20" alt="💛" />, <img class="emoji" src="//telegram.org/img/emoji/40/F09F929A.png" width="20" height="20" alt="💚" />, <img class="emoji" src="//telegram.org/img/emoji/40/F09F9299.png" width="20" height="20" alt="💙" />, <img class="emoji" src="//telegram.org/img/emoji/40/F09F929C.png" width="20" height="20" alt="💜" />, <img class="emoji" src="//telegram.org/img/emoji/40/F09F96A4.png" width="20" height="20" alt="🖤" />, <img class="emoji" src="//telegram.org/img/emoji/40/F09FA48D.png" width="20" height="20" alt="🤍" /> and <img class="emoji" src="//telegram.org/img/emoji/40/F09FA48E.png" width="20" height="20" alt="🤎" /> emojis. </p>
|
||||
|
|
|
@ -45,12 +45,12 @@
|
|||
<div id="dev_page_content"><!-- scroll_nav -->
|
||||
|
||||
<p>Authorization is associated with a client's encryption key identifier: <strong>auth_key_id</strong>. No additional parameters need to be passed into methods following authorization. </p>
|
||||
<p>To log in as a <a href="/bots">bot</a>, follow <a href="/api/bots">these instructions »</a>.</p>
|
||||
<p>An alternative <a href="/api/qr-login">QR code-based login flow is also available »</a>.</p>
|
||||
<p>To log in as a <a href="/bots">bot</a>, follow <a href="/api/bots">these instructions »</a>.</p>
|
||||
<p>An alternative <a href="/api/qr-login">QR code-based login flow is also available »</a>.</p>
|
||||
<h3><a class="anchor" href="#sending-a-verification-code" id="sending-a-verification-code" name="sending-a-verification-code"><i class="anchor-icon"></i></a>Sending a verification code</h3>
|
||||
<p>Example implementations: <a href="https://github.com/DrKLO/Telegram/blob/master/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java">telegram for android</a>, <a href="https://github.com/tdlib/td/tree/master/td/telegram/SendCodeHelper.cpp">tdlib</a>.</p>
|
||||
<p>To show a nicely formatted and validated phone number field, the <a href="/constructor/help.countriesList">help.countriesList</a> constructor can be obtained using the <a href="/method/help.getCountriesList">help.getCountriesList</a> method.<br>
|
||||
The <a href="/constructor/help.countriesList">help.countriesList</a> config and other configuration values are then used as described <a href="/api/config#country-information-and-login-phone-patterns">here »</a>. </p>
|
||||
The <a href="/constructor/help.countriesList">help.countriesList</a> config and other configuration values are then used as described <a href="/api/config#country-information-and-login-phone-patterns">here »</a>. </p>
|
||||
<p>Then, a text message containing an authorization code is sent to the user's phone using <a href="/method/auth.sendCode">auth.sendCode</a>.<br>
|
||||
However, this is not always the case, if future auth tokens are used: </p>
|
||||
<h4><a class="anchor" href="#future-auth-tokens" id="future-auth-tokens" name="future-auth-tokens"><i class="anchor-icon"></i></a>Future auth tokens</h4>
|
||||
|
@ -126,7 +126,7 @@ Currently, only official apps can make use of Firebase SMS authentication: this
|
|||
Third-party apps may log in using any of the other code delivery methods (Telegram codes, Fragment codes, email codes, future auth tokens, <a href="/api/qr-login">QR codes</a>).</p>
|
||||
<ul>
|
||||
<li><a href="/constructor/auth.sentCodeTypeSetUpEmailRequired">auth.sentCodeTypeSetUpEmailRequired</a>: if the user logins often enough, Telegram will ask the user to verify an email that will be used to send the login code.<br>
|
||||
See <a href="#email-verification">here »</a> for more info on the verification process.</li>
|
||||
See <a href="#email-verification">here »</a> for more info on the verification process.</li>
|
||||
<li><a href="/constructor/auth.sentCodeTypeEmailCode">auth.sentCodeTypeEmailCode</a>: the code was sent to the configured login email.</li>
|
||||
<li><a href="/constructor/auth.sentCodeTypeFragmentSms">auth.sentCodeTypeFragmentSms</a>: the code was sent via <a href="https://fragment.com">fragment.com</a>: open the specified <code>url</code> to log into the <a href="https://fragment.com">Fragment</a> platform with your wallet and view the code. </li>
|
||||
<li><a href="/constructor/auth.sentCodeTypeApp">auth.sentCodeTypeApp</a>: the code was sent as a Telegram service notification to all other logged-in sessions.</li>
|
||||
|
@ -153,7 +153,7 @@ The <code>beginning</code> flag, if set, contains the first word of the secret p
|
|||
In this case, the phone code will then be the phone number itself, just make sure that the phone number matches the specified pattern (see <a href="/constructor/auth.sentCodeTypeFlashCall">auth.sentCodeTypeFlashCall</a>).</li>
|
||||
<li><a href="/constructor/auth.sentCodeTypeMissedCall">auth.sentCodeTypeMissedCall</a>: the code will be sent via a flash phone call, that will be closed immediately.<br>
|
||||
The last digits of the phone number that calls are the code that must be entered manually by the user.</li>
|
||||
<li><a href="#future-auth-tokens">Future auth tokens »</a></li>
|
||||
<li><a href="#future-auth-tokens">Future auth tokens »</a></li>
|
||||
</ul>
|
||||
<p>If the message takes too long (<code>timeout</code> seconds) to arrive at the phone, the <a href="/method/auth.resendCode">auth.resendCode</a> method may be invoked to resend a code of type <code>next_type</code>.
|
||||
If the same happens again, you can use <a href="/method/auth.resendCode">auth.resendCode</a> with the <code>next_type</code> returned by the previous call to <a href="/method/auth.resendCode">auth.resendCode</a>.
|
||||
|
@ -183,7 +183,7 @@ To cancel the verification code use <a href="/method/auth.cancelCode">auth.cance
|
|||
In this case, clients should ask the user to verify an email address that will be used to receive the login code as follows: </p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>If the <code>google_signin_allowed</code> or <code>apple_signin_allowed</code> flags are set, users can directly verify their email with Google/Apple ID as specified <a href="https://developers.google.com/identity/sign-in/android/sign-in">here (Google ID) »</a> and <a href="https://developer.apple.com/documentation/sign_in_with_apple">here (Apple ID) »</a>.<br>
|
||||
<p>If the <code>google_signin_allowed</code> or <code>apple_signin_allowed</code> flags are set, users can directly verify their email with Google/Apple ID as specified <a href="https://developers.google.com/identity/sign-in/android/sign-in">here (Google ID) »</a> and <a href="https://developer.apple.com/documentation/sign_in_with_apple">here (Apple ID) »</a>.<br>
|
||||
After obtaining the ID token, call <a href="/method/account.verifyEmail">account.verifyEmail</a>, providing the following parameters:</p>
|
||||
<ul>
|
||||
<li><code>purpose</code> - A <a href="/constructor/emailVerifyPurposeLoginSetup">emailVerifyPurposeLoginSetup</a> constructor</li>
|
||||
|
@ -192,7 +192,7 @@ After obtaining the ID token, call <a href="/method/account.verifyEmail">account
|
|||
<li><code>verification</code> - <a href="/constructor/emailVerificationGoogle">emailVerificationGoogle</a> or <a href="/constructor/emailVerificationApple">emailVerificationApple</a></li>
|
||||
<li><code>verification.token</code> - The ID token returned by the Google ID API.</li>
|
||||
</ul>
|
||||
<p>On success, the <a href="/method/account.verifyEmail">account.verifyEmail</a> method will return a <a href="/constructor/account.emailVerifiedLogin">account.emailVerifiedLogin</a> constructor with an <a href="/constructor/auth.sentCode">auth.sentCode</a> constructor that should be handled <a href="#code-types">as usual »</a>. </p>
|
||||
<p>On success, the <a href="/method/account.verifyEmail">account.verifyEmail</a> method will return a <a href="/constructor/account.emailVerifiedLogin">account.emailVerifiedLogin</a> constructor with an <a href="/constructor/auth.sentCode">auth.sentCode</a> constructor that should be handled <a href="#code-types">as usual »</a>. </p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Otherwise, ask the user to enter an email address and then call <a href="/method/account.sendVerifyEmailCode">account.sendVerifyEmailCode</a>, providing the following parameters:</p>
|
||||
|
@ -210,7 +210,7 @@ After obtaining the ID token, call <a href="/method/account.verifyEmail">account
|
|||
<li><code>verification</code> - <a href="/constructor/emailVerificationCode">emailVerificationCode</a></li>
|
||||
<li><code>verification.code</code> - The verification code received by the user.</li>
|
||||
</ul>
|
||||
<p>On success, the <a href="/method/account.verifyEmail">account.verifyEmail</a> method will return a <a href="/constructor/account.emailVerifiedLogin">account.emailVerifiedLogin</a> constructor with an <a href="/constructor/auth.sentCode">auth.sentCode</a> constructor that should be handled <a href="#code-types">as usual »</a>. </p>
|
||||
<p>On success, the <a href="/method/account.verifyEmail">account.verifyEmail</a> method will return a <a href="/constructor/account.emailVerifiedLogin">account.emailVerifiedLogin</a> constructor with an <a href="/constructor/auth.sentCode">auth.sentCode</a> constructor that should be handled <a href="#code-types">as usual »</a>. </p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>If the user cannot access their email address, an email reset may be requested using <a href="/method/auth.resetLoginEmail">auth.resetLoginEmail</a>. </p>
|
||||
|
@ -240,14 +240,14 @@ In this case, instructions for <a href="/api/srp">SRP 2FA authentication</a> mus
|
|||
If the <code>unconfirmed</code> flag is set, clients should display a notification, asking the user if they recognize the session. </p>
|
||||
<p>If the user clicks on the Yes button, invoke <a href="/method/account.changeAuthorizationSettings">account.changeAuthorizationSettings</a> with the new session's <code>hash</code> and the <code>confirmed</code> flag set, confirming the specified session. </p>
|
||||
<p>If the user clicks on the No button, invoke <a href="/method/account.resetAuthorization">account.resetAuthorization</a> with the new session's <code>hash</code>, logging out the specified session. </p>
|
||||
<p>If no action is taken by the user, the session will be autoconfirmed <code>authorization_autoconfirm_period</code> seconds after login (see the associated <a href="/api/config#authorization-autoconfirm-period">client configuration parameter »</a>). </p>
|
||||
<p>If no action is taken by the user, the session will be autoconfirmed <code>authorization_autoconfirm_period</code> seconds after login (see the associated <a href="/api/config#authorization-autoconfirm-period">client configuration parameter »</a>). </p>
|
||||
<h3><a class="anchor" href="#invalidating-login-codes" id="invalidating-login-codes" name="invalidating-login-codes"><i class="anchor-icon"></i></a>Invalidating login codes</h3>
|
||||
<p>Telegram's servers will automatically invalidate login codes if they are sent by the user to another Telegram chat, either by forwarding them or by sending them inside of a message: however, clients should also manually and immediately invalidate login codes if the user attempts to screenshot or forward a message sent by the login notification service user (ID <code>777000</code>) containing login codes. </p>
|
||||
<p>If an incoming message that is:</p>
|
||||
<ul>
|
||||
<li>Sent by the login notification service user (ID <code>777000</code>)</li>
|
||||
<li>AND is a text message (not a media)</li>
|
||||
<li>AND contains one or more login codes, defined as a sequence of 5 to 7 decimal digits, optionally interleaved with or followed by any number of <code>-</code> characters (<a href="https://github.com/tdlib/td/blob/07c1d53a6d3cb1fad58d2822e55eef6d57363581/td/telegram/MessagesManager.cpp#L6513">example implementation »</a>)</li>
|
||||
<li>AND contains one or more login codes, defined as a sequence of 5 to 7 decimal digits, optionally interleaved with or followed by any number of <code>-</code> characters (<a href="https://github.com/tdlib/td/blob/07c1d53a6d3cb1fad58d2822e55eef6d57363581/td/telegram/MessagesManager.cpp#L6513">example implementation »</a>)</li>
|
||||
</ul>
|
||||
<p>Is either:</p>
|
||||
<ul>
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
<p>Peers in the story blocklist won't be able view your <a href="/api/stories">stories</a>.<br>
|
||||
Peers in the main blocklist won't be able to write messages to you, view your status, photo and stories. </p>
|
||||
<p>Adding or removing a peer from a blocklist will emit an <a href="/constructor/updatePeerBlocked">updatePeerBlocked</a> to all currenly logged-in sessions (the peer we blocked/unblocked <em>won't</em> receive any update). </p>
|
||||
<p>Use <a href="/method/contacts.getBlocked">contacts.getBlocked</a> to fetch the list of blocked peers; as usual, the <code>my_stories_from</code> flag can be used to fetch the story blocklist or the main blocklist, and the <code>offset</code>/<code>limit</code> parameters are used for <a href="/api/offsets">pagination »</a>. </p>
|
||||
<p>Use <a href="/method/contacts.getBlocked">contacts.getBlocked</a> to fetch the list of blocked peers; as usual, the <code>my_stories_from</code> flag can be used to fetch the story blocklist or the main blocklist, and the <code>offset</code>/<code>limit</code> parameters are used for <a href="/api/offsets">pagination »</a>. </p>
|
||||
<p><a href="/method/contacts.setBlocked">contacts.setBlocked</a> may also be used to completely replace the contents of an entire blocklist in bulk: just pass the blocklist type in <code>my_stories_from</code>, the full list of IDs to block in <code>id</code> and the length of the list passed to <code>id</code> in <code>limit</code>: the server will completely replace the specified blocklist.</p></div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
<p>Working with bots, using the MTProto API.</p>
|
||||
<p>See <a href="/bots">here</a> for more info about bots. </p>
|
||||
<p>Please note that you can also use the simplified <a href="/bots/api">HTTP Bot API</a> to use bots, see <a href="/bots">here for more info »</a>.</p>
|
||||
<p>Please note that you can also use the simplified <a href="/bots/api">HTTP Bot API</a> to use bots, see <a href="/bots">here for more info »</a>.</p>
|
||||
<h3><a class="anchor" href="#login" id="login" name="login"><i class="anchor-icon"></i></a>Login</h3>
|
||||
<pre><code>---functions---
|
||||
|
||||
|
@ -55,25 +55,25 @@
|
|||
You must still provide your <a href="/api/obtaining_api_id#obtaining-api-id">API ID</a>, as per user logins. </p>
|
||||
<p>After successful authorization, you will be able to use <a href="/methods">most MTProto API methods</a>, just as any normal user.<br>
|
||||
Methods that can be called by bots will have a <strong>Bots can use this method</strong> notice. </p>
|
||||
<h3><a class="anchor" href="#edit-bot-information-" id="edit-bot-information-" name="edit-bot-information-"><i class="anchor-icon"></i></a><a href="/api/bots/info">Edit bot information »</a></h3>
|
||||
<h3><a class="anchor" href="#edit-bot-information-" id="edit-bot-information-" name="edit-bot-information-"><i class="anchor-icon"></i></a><a href="/api/bots/info">Edit bot information »</a></h3>
|
||||
<p>Users can edit and localize the profile picture, name, about text and description of bots they own; the same can be done by the bots themselves. </p>
|
||||
<h3><a class="anchor" href="#commands-" id="commands-" name="commands-"><i class="anchor-icon"></i></a><a href="/api/bots/commands">Commands »</a></h3>
|
||||
<h3><a class="anchor" href="#commands-" id="commands-" name="commands-"><i class="anchor-icon"></i></a><a href="/api/bots/commands">Commands »</a></h3>
|
||||
<p><a href="/bots">Bots</a> offer a set of commands that can be used by users in private, or in a chat. </p>
|
||||
<h3><a class="anchor" href="#buttons-" id="buttons-" name="buttons-"><i class="anchor-icon"></i></a><a href="/api/bots/buttons">Buttons »</a></h3>
|
||||
<h3><a class="anchor" href="#buttons-" id="buttons-" name="buttons-"><i class="anchor-icon"></i></a><a href="/api/bots/buttons">Buttons »</a></h3>
|
||||
<p>Users can interact with your bot via <strong>buttons</strong> or even <strong>inline buttons</strong>, straight from inline <strong>messages</strong> in <strong>any</strong> chat. </p>
|
||||
<h3><a class="anchor" href="#menu-button-" id="menu-button-" name="menu-button-"><i class="anchor-icon"></i></a><a href="/api/bots/menu">Menu button »</a></h3>
|
||||
<h3><a class="anchor" href="#menu-button-" id="menu-button-" name="menu-button-"><i class="anchor-icon"></i></a><a href="/api/bots/menu">Menu button »</a></h3>
|
||||
<p>Bots can choose the behavior of the menu button shown next to the text input field. </p>
|
||||
<h3><a class="anchor" href="#suggested-bot-admin-rights-" id="suggested-bot-admin-rights-" name="suggested-bot-admin-rights-"><i class="anchor-icon"></i></a><a href="/api/rights#suggested-bot-rights">Suggested bot admin rights »</a></h3>
|
||||
<h3><a class="anchor" href="#suggested-bot-admin-rights-" id="suggested-bot-admin-rights-" name="suggested-bot-admin-rights-"><i class="anchor-icon"></i></a><a href="/api/rights#suggested-bot-rights">Suggested bot admin rights »</a></h3>
|
||||
<p>Bots can suggest a set of admin rights when being added to groups and channels.</p>
|
||||
<h3><a class="anchor" href="#inline-queries-" id="inline-queries-" name="inline-queries-"><i class="anchor-icon"></i></a><a href="/api/bots/inline">Inline queries »</a></h3>
|
||||
<h3><a class="anchor" href="#inline-queries-" id="inline-queries-" name="inline-queries-"><i class="anchor-icon"></i></a><a href="/api/bots/inline">Inline queries »</a></h3>
|
||||
<p>Users can interact with your bot via <strong>inline queries</strong>, straight from the <strong>text input field</strong> in <strong>any</strong> chat. </p>
|
||||
<h3><a class="anchor" href="#games-" id="games-" name="games-"><i class="anchor-icon"></i></a><a href="/api/bots/games">Games »</a></h3>
|
||||
<h3><a class="anchor" href="#games-" id="games-" name="games-"><i class="anchor-icon"></i></a><a href="/api/bots/games">Games »</a></h3>
|
||||
<p>Bots can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats; how to work with games in the MTProto API.</p>
|
||||
<h3><a class="anchor" href="#web-apps-" id="web-apps-" name="web-apps-"><i class="anchor-icon"></i></a><a href="/api/bots/webapps">Web apps »</a></h3>
|
||||
<h3><a class="anchor" href="#web-apps-" id="web-apps-" name="web-apps-"><i class="anchor-icon"></i></a><a href="/api/bots/webapps">Web apps »</a></h3>
|
||||
<p>Bots can offer users interactive <a href="/bots/webapps">HTML5 web apps</a> to completely replace <strong>any website</strong>. </p>
|
||||
<h3><a class="anchor" href="#attachment-menu-" id="attachment-menu-" name="attachment-menu-"><i class="anchor-icon"></i></a><a href="/api/bots/attach">Attachment menu »</a></h3>
|
||||
<h3><a class="anchor" href="#attachment-menu-" id="attachment-menu-" name="attachment-menu-"><i class="anchor-icon"></i></a><a href="/api/bots/attach">Attachment menu »</a></h3>
|
||||
<p>Bots can install attachment menu entries, offering conveniently accessible, versatile web apps.</p>
|
||||
<h3><a class="anchor" href="#business-bots-" id="business-bots-" name="business-bots-"><i class="anchor-icon"></i></a><a href="/api/business#connected-bots">Business bots »</a></h3>
|
||||
<h3><a class="anchor" href="#business-bots-" id="business-bots-" name="business-bots-"><i class="anchor-icon"></i></a><a href="/api/business#connected-bots">Business bots »</a></h3>
|
||||
<p>Business users can connect Telegram bots that will process and answer messages <strong>on their behalf</strong>. This allows businesses to <strong>seamlessly integrate</strong> any existing tools and workflows, or add <strong>AI assistants</strong> that manage their chats. </p>
|
||||
<h3><a class="anchor" href="#bot-api-dialog-ids" id="bot-api-dialog-ids" name="bot-api-dialog-ids"><i class="anchor-icon"></i></a><a href="/api/bots/ids">Bot API dialog IDs</a></h3>
|
||||
<p>How to convert MTProto peer IDs to bot API dialog IDs and vice versa.</p></div>
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<div id="dev_page_content"><!-- scroll_nav -->
|
||||
|
||||
<p><a href="/bots">Bots</a> offer a set of <a href="/bots/features#commands">commands</a> that can be used by users in private, or in a chat. </p>
|
||||
<p>For a simplified description using the HTTP bot API, see <a href="/bots/features#commands">here »</a>. </p>
|
||||
<p>For a simplified description using the HTTP bot API, see <a href="/bots/features#commands">here »</a>. </p>
|
||||
<h3><a class="anchor" href="#getting-commands" id="getting-commands" name="getting-commands"><i class="anchor-icon"></i></a>Getting commands</h3>
|
||||
<pre><code><a href='/constructor/botCommand'>botCommand</a>#c27ac8c7 command:<a href='/type/string'>string</a> description:<a href='/type/string'>string</a> = <a href='/type/BotCommand'>BotCommand</a>;
|
||||
|
||||
|
|
|
@ -61,13 +61,13 @@
|
|||
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#7852834e flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> invert_media:flags.16?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> media:<a href='/type/InputMedia'>InputMedia</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a><<a href='/type/MessageEntity'>MessageEntity</a>> schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> quick_reply_shortcut:flags.17?<a href='/type/InputQuickReplyShortcut'>InputQuickReplyShortcut</a> effect:flags.18?<a href='/type/long'>long</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||
<p>Bots can directly send a game using <a href="/method/messages.sendMedia">messages.sendMedia</a>, providing:</p>
|
||||
<ul>
|
||||
<li>The game's short name obtained from <a href="https://t.me/botfather">@BotFather</a> or from a <a href="/api/links#game-links">game link »</a> to <code>inputGameShortName.short_name</code></li>
|
||||
<li>The game's short name obtained from <a href="https://t.me/botfather">@BotFather</a> or from a <a href="/api/links#game-links">game link »</a> to <code>inputGameShortName.short_name</code></li>
|
||||
<li>The current bot's info to <code>inputGameShortName.bot_id</code></li>
|
||||
</ul>
|
||||
<p>The sent message will contain a <a href="/constructor/messageMediaGame">messageMediaGame</a> with a <a href="/constructor/game">game</a>, that can then be used by users to forward the game using sendMedia with <a href="/constructor/inputGameID">inputGameID</a>.</p>
|
||||
<h3><a class="anchor" href="#starting-a-game" id="starting-a-game" name="starting-a-game"><i class="anchor-icon"></i></a>Starting a game</h3>
|
||||
<p>Games are started clicking on the button, which triggers an callback query that returns the game URL, for more info <a href="/api/bots/buttons#callback-queries">see here »</a>.<br>
|
||||
The game should then be opened in a WebView or in native UI (specified by the <code>native_ui</code> flag), exposing the <a href="/api/web-events">appropriate HTML5 APIs</a> in order to receive various JS game events directly from the code of the game, as described <a href="/api/web-events">here »</a>. </p>
|
||||
<p>Games are started clicking on the button, which triggers an callback query that returns the game URL, for more info <a href="/api/bots/buttons#callback-queries">see here »</a>.<br>
|
||||
The game should then be opened in a WebView or in native UI (specified by the <code>native_ui</code> flag), exposing the <a href="/api/web-events">appropriate HTML5 APIs</a> in order to receive various JS game events directly from the code of the game, as described <a href="/api/web-events">here »</a>. </p>
|
||||
<h3><a class="anchor" href="#setting-highscores" id="setting-highscores" name="setting-highscores"><i class="anchor-icon"></i></a>Setting highscores</h3>
|
||||
<pre><code>---functions---
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
<p>Users can interact with your bot via <a href="/bots/features#inline-requests"><strong>inline queries</strong></a>, straight from the <strong>text input field</strong> in <strong>any</strong> chat.<br>
|
||||
This article describes the full inline bot flow, using the MTProto API. </p>
|
||||
<p>For a simplified description using the HTTP bot API, see <a href="/bots/features#inline-requests">here »</a>. </p>
|
||||
<p>For a simplified description using the HTTP bot API, see <a href="/bots/features#inline-requests">here »</a>. </p>
|
||||
<h3><a class="anchor" href="#1-making-an-inline-query" id="1-making-an-inline-query" name="1-making-an-inline-query"><i class="anchor-icon"></i></a>1. Making an inline query</h3>
|
||||
<pre><code><a href='/constructor/messages.botResults'>messages.botResults</a>#e021f2f6 flags:<a href='/type/%23'>#</a> gallery:flags.0?<a href='/constructor/true'>true</a> query_id:<a href='/type/long'>long</a> next_offset:flags.1?<a href='/type/string'>string</a> switch_pm:flags.2?<a href='/type/InlineBotSwitchPM'>InlineBotSwitchPM</a> switch_webview:flags.3?<a href='/type/InlineBotWebView'>InlineBotWebView</a> results:<a href='/type/Vector%20t'>Vector</a><<a href='/type/BotInlineResult'>BotInlineResult</a>> cache_time:<a href='/type/int'>int</a> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/messages.BotResults'>messages.BotResults</a>;
|
||||
|
||||
|
@ -86,7 +86,7 @@ This article describes the full inline bot flow, using the MTProto API. </p>
|
|||
|
||||
<a href='/method/messages.setInlineBotResults'>messages.setInlineBotResults</a>#bb12a419 flags:<a href='/type/%23'>#</a> gallery:flags.0?<a href='/constructor/true'>true</a> private:flags.1?<a href='/constructor/true'>true</a> query_id:<a href='/type/long'>long</a> results:<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputBotInlineResult'>InputBotInlineResult</a>> cache_time:<a href='/type/int'>int</a> next_offset:flags.2?<a href='/type/string'>string</a> switch_pm:flags.3?<a href='/type/InlineBotSwitchPM'>InlineBotSwitchPM</a> switch_webview:flags.4?<a href='/type/InlineBotWebView'>InlineBotWebView</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>Bots can answer to incoming <a href="/constructor/updateBotInlineQuery">updateBotInlineQuery</a> updates using <a href="/method/messages.setInlineBotResults">messages.setInlineBotResults</a>.<br>
|
||||
Just like its <a href="/bots/api#answerinlinequery">bot API counterpart</a>, the method can be used to send a set of inline results to the user; see the <a href="/method/messages.setInlineBotResults">constructor page for more info on the MTProto method parameters »</a>.</p>
|
||||
Just like its <a href="/bots/api#answerinlinequery">bot API counterpart</a>, the method can be used to send a set of inline results to the user; see the <a href="/method/messages.setInlineBotResults">constructor page for more info on the MTProto method parameters »</a>.</p>
|
||||
<p>In general, the method accepts a vector of <a href="/type/InputBotInlineResult">InputBotInlineResult</a> constructors, that when <a href="#3-sending-the-inline-query-result">chosen</a>, generates a message with optionally attached media, and even inline buttons.</p>
|
||||
<h3><a class="anchor" href="#3-sending-the-inline-query-result" id="3-sending-the-inline-query-result" name="3-sending-the-inline-query-result"><i class="anchor-icon"></i></a>3. Sending the inline query result</h3>
|
||||
<pre><code><a href='/constructor/botInlineMessageMediaAuto'>botInlineMessageMediaAuto</a>#764cf810 flags:<a href='/type/%23'>#</a> invert_media:flags.3?<a href='/constructor/true'>true</a> message:<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a><<a href='/type/MessageEntity'>MessageEntity</a>> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> = <a href='/type/BotInlineMessage'>BotInlineMessage</a>;
|
||||
|
|
|
@ -137,8 +137,8 @@ The timezone ID is contained <a href="/constructor/timezone">timezone</a>.<code>
|
|||
<li><code>geo_point</code> - Optional, contains a set of geographical coordinates.</li>
|
||||
</ul>
|
||||
<p>To remove business location information invoke the method without setting any of the parameters. </p>
|
||||
<p>If a <code>geo_point</code> is set, the business' location will also be advertised to geographically close users using the nearby users feature, <a href="/api/nearby/#fetching-nearby-users-and-geogroups">as described here »</a>. </p>
|
||||
<p>Note that even if just the <code>address</code> is set (with or without a <code>geo_point</code>), the current geolocation of the user may not be changed using <a href="/method/contacts.getLocated">contacts.getLocated</a> method (i.e. for the <a href="/api/nearby#advertising-our-current-location">nearby users feature</a>): it will return a <code>BUSINESS_ADDRESS_ACTIVE</code> error, indicating that the location may only be changed (or removed) using <a href="/method/account.updateBusinessLocation">account.updateBusinessLocation »</a>. </p>
|
||||
<p>If a <code>geo_point</code> is set, the business' location will also be advertised to geographically close users using the nearby users feature, <a href="/api/nearby/#fetching-nearby-users-and-geogroups">as described here »</a>. </p>
|
||||
<p>Note that even if just the <code>address</code> is set (with or without a <code>geo_point</code>), the current geolocation of the user may not be changed using <a href="/method/contacts.getLocated">contacts.getLocated</a> method (i.e. for the <a href="/api/nearby#advertising-our-current-location">nearby users feature</a>): it will return a <code>BUSINESS_ADDRESS_ACTIVE</code> error, indicating that the location may only be changed (or removed) using <a href="/method/account.updateBusinessLocation">account.updateBusinessLocation »</a>. </p>
|
||||
<p>Changing the location will emit an <a href="/constructor/updateUser">updateUser</a>. </p>
|
||||
<h3><a class="anchor" href="#quick-reply-shortcuts" id="quick-reply-shortcuts" name="quick-reply-shortcuts"><i class="anchor-icon"></i></a>Quick reply shortcuts</h3>
|
||||
<p>Telegram Business allows you to create <strong>quick replies</strong>.<br>
|
||||
|
@ -269,8 +269,8 @@ This will also emit an <a href="/constructor/updateDeleteQuickReply">updateDelet
|
|||
<a href='/method/account.updateBusinessGreetingMessage'>account.updateBusinessGreetingMessage</a>#66cdafc4 flags:<a href='/type/%23'>#</a> message:flags.0?<a href='/type/InputBusinessGreetingMessage'>InputBusinessGreetingMessage</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>Telegram Business allows to configure a set of greeting messages, automatically sent to new users writing to us in private for the first time, or after a certain inactivity period. </p>
|
||||
<p>Use <a href="/method/account.updateBusinessGreetingMessage">account.updateBusinessGreetingMessage</a> to set a (list of) greeting messages in <code>message</code>; to disable greetings, call the method without populating the <code>message</code> field. </p>
|
||||
<p>If populated, the <code>message</code> field must contain a <a href="/constructor/inputBusinessGreetingMessage">inputBusinessGreetingMessage</a>, see <a href="/constructor/inputBusinessGreetingMessage">the constructor page »</a> for a description of its contents and the length limits for the intro title and description. </p>
|
||||
<p>The currently configured business greeting can be fetched by the current user through <a href="/constructor/userFull">userFull</a>.<code>business_greeting_message</code>, represented by a <a href="/constructor/businessGreetingMessage">businessGreetingMessage constructor »</a>, equivalent to the input counterpart. </p>
|
||||
<p>If populated, the <code>message</code> field must contain a <a href="/constructor/inputBusinessGreetingMessage">inputBusinessGreetingMessage</a>, see <a href="/constructor/inputBusinessGreetingMessage">the constructor page »</a> for a description of its contents and the length limits for the intro title and description. </p>
|
||||
<p>The currently configured business greeting can be fetched by the current user through <a href="/constructor/userFull">userFull</a>.<code>business_greeting_message</code>, represented by a <a href="/constructor/businessGreetingMessage">businessGreetingMessage constructor »</a>, equivalent to the input counterpart. </p>
|
||||
<h3><a class="anchor" href="#away-messages" id="away-messages" name="away-messages"><i class="anchor-icon"></i></a>Away messages</h3>
|
||||
<pre><code><a href='/constructor/inputBusinessRecipients'>inputBusinessRecipients</a>#6f8b32aa flags:<a href='/type/%23'>#</a> existing_chats:flags.0?<a href='/constructor/true'>true</a> new_chats:flags.1?<a href='/constructor/true'>true</a> contacts:flags.2?<a href='/constructor/true'>true</a> non_contacts:flags.3?<a href='/constructor/true'>true</a> exclude_selected:flags.5?<a href='/constructor/true'>true</a> users:flags.4?<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputUser'>InputUser</a>> = <a href='/type/InputBusinessRecipients'>InputBusinessRecipients</a>;
|
||||
|
||||
|
@ -291,8 +291,8 @@ This will also emit an <a href="/constructor/updateDeleteQuickReply">updateDelet
|
|||
<a href='/method/account.updateBusinessAwayMessage'>account.updateBusinessAwayMessage</a>#a26a7fa5 flags:<a href='/type/%23'>#</a> message:flags.0?<a href='/type/InputBusinessAwayMessage'>InputBusinessAwayMessage</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>Telegram Business allows to configure a set of "away" messages, automatically sent to users writing to us when we're offline, during closing hours, while we're on vacation, or in some other custom time period when we cannot immediately answer to the user. </p>
|
||||
<p>Use <a href="/method/account.updateBusinessAwayMessage">account.updateBusinessAwayMessage</a> to set a (list of) away messages in <code>message</code>; to disable greetings, call the method without populating the <code>message</code> field. </p>
|
||||
<p>If populated, the <code>message</code> field must contain a <a href="/constructor/inputBusinessAwayMessage">inputBusinessAwayMessage</a>, see <a href="/constructor/inputBusinessAwayMessage">the constructor page »</a> for a description of its contents. </p>
|
||||
<p>The currently configured business away message can be fetched by the current user through <a href="/constructor/userFull">userFull</a>.<code>business_away_message</code>, represented by a <a href="/constructor/businessAwayMessage">businessAwayMessage constructor »</a>, equivalent to the input counterpart. </p>
|
||||
<p>If populated, the <code>message</code> field must contain a <a href="/constructor/inputBusinessAwayMessage">inputBusinessAwayMessage</a>, see <a href="/constructor/inputBusinessAwayMessage">the constructor page »</a> for a description of its contents. </p>
|
||||
<p>The currently configured business away message can be fetched by the current user through <a href="/constructor/userFull">userFull</a>.<code>business_away_message</code>, represented by a <a href="/constructor/businessAwayMessage">businessAwayMessage constructor »</a>, equivalent to the input counterpart. </p>
|
||||
<h3><a class="anchor" href="#business-introduction" id="business-introduction" name="business-introduction"><i class="anchor-icon"></i></a>Business introduction</h3>
|
||||
<pre><code><a href='/constructor/inputBusinessIntro'>inputBusinessIntro</a>#09c469cd flags:<a href='/type/%23'>#</a> title:<a href='/type/string'>string</a> description:<a href='/type/string'>string</a> sticker:flags.0?<a href='/type/InputDocument'>InputDocument</a> = <a href='/type/InputBusinessIntro'>InputBusinessIntro</a>;
|
||||
|
||||
|
@ -303,10 +303,10 @@ This will also emit an <a href="/constructor/updateDeleteQuickReply">updateDelet
|
|||
---functions---
|
||||
|
||||
<a href='/method/account.updateBusinessIntro'>account.updateBusinessIntro</a>#a614d034 flags:<a href='/type/%23'>#</a> intro:flags.0?<a href='/type/InputBusinessIntro'>InputBusinessIntro</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>Telegram Business allows to configure the message and sticker of the <a href="/api/profile#introduction">profile introduction »</a>, shown to new users that don't have a private chat with us. </p>
|
||||
<p>Use <a href="/method/account.updateBusinessIntro">account.updateBusinessIntro</a> to set a custom business introduction; invoke the same method without setting the <code>intro</code> flag to remove the custom business introduction, defaulting to a randomly-chosen introduction message and sticker (see <a href="/api/profile">here »</a> for more info on default profile introductions). </p>
|
||||
<p>Telegram Business allows to configure the message and sticker of the <a href="/api/profile#introduction">profile introduction »</a>, shown to new users that don't have a private chat with us. </p>
|
||||
<p>Use <a href="/method/account.updateBusinessIntro">account.updateBusinessIntro</a> to set a custom business introduction; invoke the same method without setting the <code>intro</code> flag to remove the custom business introduction, defaulting to a randomly-chosen introduction message and sticker (see <a href="/api/profile">here »</a> for more info on default profile introductions). </p>
|
||||
<p>Changing the business introduction will emit an <a href="/constructor/updateUser">updateUser</a>, and the business introduction will be contained in <a href="/constructor/userFull">userFull</a>.<code>intro</code>. </p>
|
||||
<p>Note that the greeting sticker selection UI should offer a list of categories to quickly filter results by a (list of) emojis, or by some other criteria, see <a href="/api/emoji-categories">here »</a> for more info. </p>
|
||||
<p>Note that the greeting sticker selection UI should offer a list of categories to quickly filter results by a (list of) emojis, or by some other criteria, see <a href="/api/emoji-categories">here »</a> for more info. </p>
|
||||
<h3><a class="anchor" href="#business-chat-links" id="business-chat-links" name="business-chat-links"><i class="anchor-icon"></i></a>Business chat links</h3>
|
||||
<pre><code><a href='/constructor/inputBusinessChatLink'>inputBusinessChatLink</a>#11679fa7 flags:<a href='/type/%23'>#</a> message:<a href='/type/string'>string</a> entities:flags.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/MessageEntity'>MessageEntity</a>> title:flags.1?<a href='/type/string'>string</a> = <a href='/type/InputBusinessChatLink'>InputBusinessChatLink</a>;
|
||||
|
||||
|
@ -324,7 +324,7 @@ This will also emit an <a href="/constructor/updateDeleteQuickReply">updateDelet
|
|||
<a href='/method/account.deleteBusinessChatLink'>account.deleteBusinessChatLink</a>#60073674 slug:<a href='/type/string'>string</a> = <a href='/type/Bool'>Bool</a>;
|
||||
|
||||
<a href='/method/account.resolveBusinessChatLink'>account.resolveBusinessChatLink</a>#5492e5ee slug:<a href='/type/string'>string</a> = <a href='/type/account.ResolvedBusinessChatLinks'>account.ResolvedBusinessChatLinks</a>;</code></pre>
|
||||
<p><a href="/api/links#business-chat-links">Business chat deep links</a> allow business owners to share pre-made links to their Telegram business account, optionally filling out the message input field with a pre-prepared message (with support for <a href="/api/entities">styled text entities »</a>). </p>
|
||||
<p><a href="/api/links#business-chat-links">Business chat deep links</a> allow business owners to share pre-made links to their Telegram business account, optionally filling out the message input field with a pre-prepared message (with support for <a href="/api/entities">styled text entities »</a>). </p>
|
||||
<p>There is no additional limit (apart from the usual <a href="/constructor/config">message_length_max</a>) on the prepared message length (because the message text is <em>not</em> present in the URL's query string, rather it's fetched from the server using the link slug); each created business chat deep link also has a view counter. </p>
|
||||
<p>Use <a href="/method/account.createBusinessChatLink">account.createBusinessChatLink</a> to create a business chat link, specifying in <a href="/constructor/inputBusinessChatLink">inputBusinessChatLink</a> the message to pre-fill when users open the link, as well as a human-readable name for the link in <code>title</code>, useful when managing created links.<br>
|
||||
The created <a href="/api/links#business-chat-links">deep link</a> is returned in the <code>link</code> field, and may be shared directly or as a QR code. </p>
|
||||
|
@ -332,7 +332,7 @@ The created <a href="/api/links#business-chat-links">deep link</a> is returned i
|
|||
<p>Use <a href="/method/account.editBusinessChatLink">account.editBusinessChatLink</a> to edit the information of a business chat link. </p>
|
||||
<p>Use <a href="/method/account.deleteBusinessChatLink">account.deleteBusinessChatLink</a> to delete a business chat link. </p>
|
||||
<p>Use <a href="/method/account.resolveBusinessChatLink">account.resolveBusinessChatLink</a> to open a business chat link, obtaining the peer to contact and (if set) the message to pre-fill, also increasing the link's view counter. </p>
|
||||
<p>The last three methods listed above take a business chat link slug, which should be extracted from a business chat link as specified <a href="/api/links#business-chat-links">here »</a>. </p>
|
||||
<p>The last three methods listed above take a business chat link slug, which should be extracted from a business chat link as specified <a href="/api/links#business-chat-links">here »</a>. </p>
|
||||
<p>All listed methods except <a href="/method/account.resolveBusinessChatLink">account.resolveBusinessChatLink</a> require a Telegram Business subscription (currently included in <a href="/api/premium">Telegram Premium</a> subscriptions).</p>
|
||||
<p>An account may create a maximum of <a href="/api/config#business-chat-links-limit">business_chat_links_limit</a> business chat links: attempts to exceed this limit will emit a <code>CHATLINKS_TOO_MUCH</code> RPC error, prompting the user to delete older links. </p>
|
||||
<h3><a class="anchor" href="#connected-bots" id="connected-bots" name="connected-bots"><i class="anchor-icon"></i></a>Connected bots</h3>
|
||||
|
@ -366,20 +366,20 @@ invokeWithBusinessConnection#dd289f8e {X:Type} connection_id:string query:!X = X
|
|||
<p>Business users can connect Telegram bots that will process and answer messages <strong>on their behalf</strong>. This allows businesses to <strong>seamlessly integrate</strong> any existing tools and workflows, or add <strong>AI assistants</strong> that manage their chats. </p>
|
||||
<p>Currently just one business bot may be connected to a user account.<br>
|
||||
Bots which may be connected to user accounts have the <a href="/constructor/user">user</a>.<code>bot_business</code> flag set; trying to connect a non-business bot will emit a <code>BOT_BUSINESS_MISSING</code> error. </p>
|
||||
<p>Use <a href="/method/account.updateConnectedBot">account.updateConnectedBot »</a> to connect a business bot to the current account, or to change the connection settings.<br>
|
||||
Use <a href="/method/account.updateConnectedBot">account.updateConnectedBot »</a> with the <code>deleted</code> flag set to disconnect a business bot from the current account.<br>
|
||||
Use <a href="/method/account.getConnectedBots">account.getConnectedBots »</a> list all currently connected business bots. </p>
|
||||
<p>Use <a href="/method/account.toggleConnectedBotPaused">account.toggleConnectedBotPaused »</a> to pause or unpause a specific chat, temporarily disconnecting it from all business bots (equivalent to temporarily specifying it in <code>recipients.exclude_users</code> during initial configuration with <a href="/method/account.updateConnectedBot">account.updateConnectedBot »</a>).<br>
|
||||
Use <a href="/method/account.toggleConnectedBotPaused">account.disablePeerConnectedBot »</a> to permanently disconnect a specific chat from all business bots (equivalent to specifying it in <code>recipients.exclude_users</code> during initial configuration with <a href="/method/account.updateConnectedBot">account.updateConnectedBot »</a>); to reconnect of a chat disconnected using this method the user must reconnect the entire bot by invoking <a href="/method/account.updateConnectedBot">account.updateConnectedBot »</a>. </p>
|
||||
<p>Use <a href="/method/account.updateConnectedBot">account.updateConnectedBot »</a> to connect a business bot to the current account, or to change the connection settings.<br>
|
||||
Use <a href="/method/account.updateConnectedBot">account.updateConnectedBot »</a> with the <code>deleted</code> flag set to disconnect a business bot from the current account.<br>
|
||||
Use <a href="/method/account.getConnectedBots">account.getConnectedBots »</a> list all currently connected business bots. </p>
|
||||
<p>Use <a href="/method/account.toggleConnectedBotPaused">account.toggleConnectedBotPaused »</a> to pause or unpause a specific chat, temporarily disconnecting it from all business bots (equivalent to temporarily specifying it in <code>recipients.exclude_users</code> during initial configuration with <a href="/method/account.updateConnectedBot">account.updateConnectedBot »</a>).<br>
|
||||
Use <a href="/method/account.toggleConnectedBotPaused">account.disablePeerConnectedBot »</a> to permanently disconnect a specific chat from all business bots (equivalent to specifying it in <code>recipients.exclude_users</code> during initial configuration with <a href="/method/account.updateConnectedBot">account.updateConnectedBot »</a>); to reconnect of a chat disconnected using this method the user must reconnect the entire bot by invoking <a href="/method/account.updateConnectedBot">account.updateConnectedBot »</a>. </p>
|
||||
<p>Note that invoking the above two methods will also add the peer to the <code>recipients.exclude_users</code> field of the related <a href="/constructor/connectedBot">connectedBot</a> (or to <code>recipients.users</code>, if the inversion <code>recipients.exclude_selected</code> flag is set). </p>
|
||||
<p>The above two methods should be invoked when pressing the appropriate buttons in the <a href="/api/action-bar#manage-a-connected-business-bot">action bar, see here »</a> for more info on the business bot action bar that should be displayed on all peers currently managed by the bot, according to the <a href="/api/action-bar#manage-a-connected-business-bot">action bar flags »</a>. </p>
|
||||
<p>The above two methods should be invoked when pressing the appropriate buttons in the <a href="/api/action-bar#manage-a-connected-business-bot">action bar, see here »</a> for more info on the business bot action bar that should be displayed on all peers currently managed by the bot, according to the <a href="/api/action-bar#manage-a-connected-business-bot">action bar flags »</a>. </p>
|
||||
<p>Connecting or disconnecting a business bot or changing the connection settings will emit an <a href="/constructor/updateBotBusinessConnect">updateBotBusinessConnect</a> update to the bot, with the new settings and a <code>connection_id</code> that will be used by the bot to handle updates from and send messages as the user. </p>
|
||||
<p>According to the specified settings, the bot will start receiving <a href="/constructor/updateBotNewBusinessMessage">updateBotNewBusinessMessage</a>, <a href="/constructor/updateBotEditBusinessMessage">updateBotEditBusinessMessage</a>, <a href="/constructor/updateBotDeleteBusinessMessage">updateBotDeleteBusinessMessage</a> updates containing messages sent to the connected user via the business connection. </p>
|
||||
<p>Bots may invoke <a href="/method/account.getBotBusinessConnection">account.getBotBusinessConnection</a> to re-fetch the <a href="/constructor/updateBotBusinessConnect">updateBotBusinessConnect</a> constructor associated with a specific <code>connection_id</code>.<br>
|
||||
This is needed for example for freshly logged in bots that are receiving some <a href="/constructor/updateBotNewBusinessMessage">updateBotNewBusinessMessage</a>, etc. updates because some users have already connected to the bot before it could login.<br>
|
||||
In this case, the bot is receiving messages from the business connection, but it hasn't cached the associated <a href="/constructor/updateBotBusinessConnect">updateBotBusinessConnect</a> with info about the connection (can it reply to messages? etc.) yet, and cannot receive the old ones because they were sent when the bot wasn't logged into the session yet.<br>
|
||||
This method can be used to fetch info about a not-yet-cached business connection, and should not be invoked if the info is already cached or to fetch changes, as eventual changes will automatically be sent as new <a href="/constructor/updateBotBusinessConnect">updateBotBusinessConnect</a> updates to the bot, using the usual <a href="/api/updates">update delivery methods »</a>.</p>
|
||||
<p>If the <code>can_reply</code> flag was set when connecting the bot, the bot will also be able to invoke the following methods on behalf of the user to interact with messages received via the business connection, by wrapping the query in a <a href="/method/invokeWithBusinessConnection">invokeWithBusinessConnection »</a>, passing the connection ID: </p>
|
||||
This method can be used to fetch info about a not-yet-cached business connection, and should not be invoked if the info is already cached or to fetch changes, as eventual changes will automatically be sent as new <a href="/constructor/updateBotBusinessConnect">updateBotBusinessConnect</a> updates to the bot, using the usual <a href="/api/updates">update delivery methods »</a>.</p>
|
||||
<p>If the <code>can_reply</code> flag was set when connecting the bot, the bot will also be able to invoke the following methods on behalf of the user to interact with messages received via the business connection, by wrapping the query in a <a href="/method/invokeWithBusinessConnection">invokeWithBusinessConnection »</a>, passing the connection ID: </p>
|
||||
<ul>
|
||||
<li><a href="/method/messages.sendMessage">messages.sendMessage</a></li>
|
||||
<li><a href="/method/messages.editMessage">messages.editMessage</a></li>
|
||||
|
@ -389,9 +389,9 @@ This method can be used to fetch info about a not-yet-cached business connection
|
|||
<li><a href="/method/messages.updatePinnedMessage">messages.updatePinnedMessage</a></li>
|
||||
</ul>
|
||||
<p>Make sure to always send queries wrapped in an <code>invokeWithBusinessConnection</code> to the datacenter ID, specified in the <code>dc_id</code> field of the <a href="/constructor/botBusinessConnection">botBusinessConnection</a> that is being used. </p>
|
||||
<p><a href="/method/messages.uploadMedia">messages.uploadMedia</a> may also be used in business connections, <em>not</em> by wrapping it in <a href="/method/invokeWithBusinessConnection">invokeWithBusinessConnection »</a>, but rather by specifying the business connection ID in the <code>business_connection_id</code> parameter.</p>
|
||||
<p><a href="/method/messages.uploadMedia">messages.uploadMedia</a> may also be used in business connections, <em>not</em> by wrapping it in <a href="/method/invokeWithBusinessConnection">invokeWithBusinessConnection »</a>, but rather by specifying the business connection ID in the <code>business_connection_id</code> parameter.</p>
|
||||
<p><a href="/constructor/message">Message</a>s sent by business bots on behalf of the user using this method will have the <code>via_business_connection</code> flag set, indicating that the message was sent by the business bot indicated in <a href="/constructor/message">message</a>.<code>via_bot_id</code>. </p>
|
||||
<p><a href="/constructor/message">Message</a>s sent by business bots on behalf of the user may also contain <a href="/api/bots/buttons">inline keyboards</a>, including <a href="/api/bots/buttons#answering-a-callback-query">callback buttons</a>, which when pressed will emit an <a href="/constructor/updateBusinessBotCallbackQuery">updateBusinessBotCallbackQuery</a> which should be handled as specified <a href="/api/bots/buttons#answering-a-callback-query">here »</a> (<em>without</em> wrapping the query in an <code>invokeWithBusinessConnection</code>).</p>
|
||||
<p><a href="/constructor/message">Message</a>s sent by business bots on behalf of the user may also contain <a href="/api/bots/buttons">inline keyboards</a>, including <a href="/api/bots/buttons#answering-a-callback-query">callback buttons</a>, which when pressed will emit an <a href="/constructor/updateBusinessBotCallbackQuery">updateBusinessBotCallbackQuery</a> which should be handled as specified <a href="/api/bots/buttons#answering-a-callback-query">here »</a> (<em>without</em> wrapping the query in an <code>invokeWithBusinessConnection</code>).</p>
|
||||
<h3><a class="anchor" href="#re-enable-ads" id="re-enable-ads" name="re-enable-ads"><i class="anchor-icon"></i></a>Re-enable ads</h3>
|
||||
<pre><code><a href='/constructor/userFull'>userFull</a>#cc997720 flags:<a href='/type/%23'>#</a> blocked:flags.0?<a href='/constructor/true'>true</a> phone_calls_available:flags.4?<a href='/constructor/true'>true</a> phone_calls_private:flags.5?<a href='/constructor/true'>true</a> can_pin_message:flags.7?<a href='/constructor/true'>true</a> has_scheduled:flags.12?<a href='/constructor/true'>true</a> video_calls_available:flags.13?<a href='/constructor/true'>true</a> voice_messages_forbidden:flags.20?<a href='/constructor/true'>true</a> translations_disabled:flags.23?<a href='/constructor/true'>true</a> stories_pinned_available:flags.26?<a href='/constructor/true'>true</a> blocked_my_stories_from:flags.27?<a href='/constructor/true'>true</a> wallpaper_overridden:flags.28?<a href='/constructor/true'>true</a> contact_require_premium:flags.29?<a href='/constructor/true'>true</a> read_dates_private:flags.30?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> sponsored_enabled:flags2.7?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:flags.1?<a href='/type/string'>string</a> settings:<a href='/type/PeerSettings'>PeerSettings</a> personal_photo:flags.21?<a href='/type/Photo'>Photo</a> profile_photo:flags.2?<a href='/type/Photo'>Photo</a> fallback_photo:flags.22?<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> bot_info:flags.3?<a href='/type/BotInfo'>BotInfo</a> pinned_msg_id:flags.6?<a href='/type/int'>int</a> common_chats_count:<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> ttl_period:flags.14?<a href='/type/int'>int</a> theme_emoticon:flags.15?<a href='/type/string'>string</a> private_forward_name:flags.16?<a href='/type/string'>string</a> bot_group_admin_rights:flags.17?<a href='/type/ChatAdminRights'>ChatAdminRights</a> bot_broadcast_admin_rights:flags.18?<a href='/type/ChatAdminRights'>ChatAdminRights</a> premium_gifts:flags.19?<a href='/type/Vector%20t'>Vector</a><<a href='/type/PremiumGiftOption'>PremiumGiftOption</a>> wallpaper:flags.24?<a href='/type/WallPaper'>WallPaper</a> stories:flags.25?<a href='/type/PeerStories'>PeerStories</a> business_work_hours:flags2.0?<a href='/type/BusinessWorkHours'>BusinessWorkHours</a> business_location:flags2.1?<a href='/type/BusinessLocation'>BusinessLocation</a> business_greeting_message:flags2.2?<a href='/type/BusinessGreetingMessage'>BusinessGreetingMessage</a> business_away_message:flags2.3?<a href='/type/BusinessAwayMessage'>BusinessAwayMessage</a> business_intro:flags2.4?<a href='/type/BusinessIntro'>BusinessIntro</a> birthday:flags2.5?<a href='/type/Birthday'>Birthday</a> personal_channel_id:flags2.6?<a href='/type/long'>long</a> personal_channel_message:flags2.6?<a href='/type/int'>int</a> = <a href='/type/UserFull'>UserFull</a>;
|
||||
|
||||
|
@ -399,11 +399,11 @@ This method can be used to fetch info about a not-yet-cached business connection
|
|||
|
||||
<a href='/method/account.toggleSponsoredMessages'>account.toggleSponsoredMessages</a>#b9d9a38d enabled:<a href='/type/Bool'>Bool</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>Since Telegram Business is currently included with the <a href="/api/premium">Telegram Premium</a> subscription, and Telegram Premium subscribers do not see <a href="/api/sponsored-messages">sponsored messages in channels</a>. </p>
|
||||
<p>This may be problematic for business owners that may want to launch and view their own Telegram ads via the <a href="https://ads.telegram.org">Telegram ad platform »</a>. </p>
|
||||
<p>This may be problematic for business owners that may want to launch and view their own Telegram ads via the <a href="https://ads.telegram.org">Telegram ad platform »</a>. </p>
|
||||
<p>For this reason, the Telegram Business settings page should contain a toggle to re-enable Telegram ads for the current account, which should trigger a call to <a href="/method/account.toggleSponsoredMessages">account.toggleSponsoredMessages</a>. </p>
|
||||
<p>The current value of the toggle will be stored in <a href="/constructor/userFull">userFull</a>.<code>sponsored_enabled</code>. </p>
|
||||
<h3><a class="anchor" href="#folder-tags" id="folder-tags" name="folder-tags"><i class="anchor-icon"></i></a>Folder tags</h3>
|
||||
<p>Telegram Business users can use <a href="/api/folders#folder-tags">folder tags, see here »</a> for more info. </p>
|
||||
<p>Telegram Business users can use <a href="/api/folders#folder-tags">folder tags, see here »</a> for more info. </p>
|
||||
<h3><a class="anchor" href="#business-features-promo-page" id="business-features-promo-page" name="business-features-promo-page"><i class="anchor-icon"></i></a>Business features promo page</h3>
|
||||
<p>Telegram Business offers a set of additional features and raised limits: clients should be aware of the current subscription status to accordingly modify client behavior. </p>
|
||||
<pre><code>---functions---
|
||||
|
|
|
@ -52,17 +52,17 @@ Technically, they are represented by <a href="/constructor/channel">channel</a>
|
|||
<p><a href="https://telegram.org/tour/groups">Supergroups</a> are a powerful tool for building communities and can support up to 200,000 members each.<br>
|
||||
Technically, supergroups are actually channels: they are represented by <a href="/constructor/channel">channel</a> constructors, with the <code>megagroup</code> flag set to true. </p>
|
||||
<p>Channels can be created using the <a href="/method/channels.createChannel">channels.createChannel</a> method, by setting the <code>megagroup</code> flag.<br>
|
||||
Supergroups can also be assigned a <code>geo_point</code> to become <a href="/api/nearby">geochats »</a>. </p>
|
||||
Supergroups can also be assigned a <code>geo_point</code> to become <a href="/api/nearby">geochats »</a>. </p>
|
||||
<h4><a class="anchor" href="#forums" id="forums" name="forums"><i class="anchor-icon"></i></a>Forums</h4>
|
||||
<p>Supergroups can be converted into <a href="/api/forum">forums</a>, splitting conversion into distinct <a href="/api/forum#forum-topics">forum topics</a>, see the <a href="/api/forum">forum documentation for more info »</a>. </p>
|
||||
<p>Supergroups can be converted into <a href="/api/forum">forums</a>, splitting conversion into distinct <a href="/api/forum#forum-topics">forum topics</a>, see the <a href="/api/forum">forum documentation for more info »</a>. </p>
|
||||
<h3><a class="anchor" href="#gigagroups" id="gigagroups" name="gigagroups"><i class="anchor-icon"></i></a>Gigagroups</h3>
|
||||
<p>Gigagroups are something between a channel and a supergroup.<br>
|
||||
An admin, <a href="/api/config#channel-suggestions">when prompted by the API using suggestions »</a>, can convert a megagroup into a gigagroup using <a href="/method/channels.convertToGigagroup">channels.convertToGigagroup</a> (one way only).<br>
|
||||
An admin, <a href="/api/config#channel-suggestions">when prompted by the API using suggestions »</a>, can convert a megagroup into a gigagroup using <a href="/method/channels.convertToGigagroup">channels.convertToGigagroup</a> (one way only).<br>
|
||||
After that, only admins will be able to write in the group (like when <a href="#rights"><code>send_messages</code> rights are disabled for all group participants by default</a>), but the participant limit is removed and the group can become much bigger than a supergroup (e.g. >200,000 currently).<br>
|
||||
Also, one can't invite people into gigagroups and participants of voice chats in gigagroups are muted by default. </p>
|
||||
<h3><a class="anchor" href="#basic-groups" id="basic-groups" name="basic-groups"><i class="anchor-icon"></i></a>Basic groups</h3>
|
||||
<p>In previous versions of telegram, only basic groups (represented by <a href="/constructor/chat">chat</a> constructors) could be created using <a href="/method/messages.createChat">messages.createChat</a>: these groups have fewer features, and can only have 200 members at max.<br>
|
||||
Messages from all basic groups are stored in the <a href="/api/updates#message-related-event-sequences">user's message box »</a>: this means that all basic groups and all private chats share the same, single message ID and <a href="/api/updates">PTS</a> sequence. </p>
|
||||
Messages from all basic groups are stored in the <a href="/api/updates#message-related-event-sequences">user's message box »</a>: this means that all basic groups and all private chats share the same, single message ID and <a href="/api/updates">PTS</a> sequence. </p>
|
||||
<h4><a class="anchor" href="#migration" id="migration" name="migration"><i class="anchor-icon"></i></a>Migration</h4>
|
||||
<p>To upgrade a basic group to a supergroup, <a href="/method/messages.migrateChat">messages.migrateChat</a> can be used. </p>
|
||||
<p>Clients should automatically migrate basic groups to supergroups if an admin tries to execute an action that is only supported by supergroups. </p>
|
||||
|
@ -77,21 +77,21 @@ Messages from all basic groups are stored in the <a href="/api/updates#message-r
|
|||
<p>When working with migrated groups clients need to handle loading of the message history (as well as search results et cetera) from both the basic group and the new supergroup. This is done by merging the two messages lists (requested with different <a href="/type/Peer">Peer</a> values) client side.</p>
|
||||
<h3><a class="anchor" href="#invite-links-and-join-requests" id="invite-links-and-join-requests" name="invite-links-and-join-requests"><i class="anchor-icon"></i></a>Invite links and join requests</h3>
|
||||
<p>Channels, basic groups and supergroups may have a public username or a private invite link: private invite links may be further enhanced with per-user join requests.</p>
|
||||
<p>For more info on how to work with public usernames, invite links and join requests, see <a href="/api/invites">here »</a>.</p>
|
||||
<p>For more info on how to work with public usernames, invite links and join requests, see <a href="/api/invites">here »</a>.</p>
|
||||
<h3><a class="anchor" href="#rights" id="rights" name="rights"><i class="anchor-icon"></i></a>Rights</h3>
|
||||
<p>Channels, basic groups and supergroups allow setting <a href="https://telegram.org/blog/permissions-groups-undo">granular permissions</a> both for admins and specific users; channels, supergroups and basic groups also allow setting global granular permissions for users.</p>
|
||||
<p>For more info on how to set and modify rights, see <a href="/api/rights">here »</a>.</p>
|
||||
<p>For more info on how to set and modify rights, see <a href="/api/rights">here »</a>.</p>
|
||||
<h3><a class="anchor" href="#pinned-messages" id="pinned-messages" name="pinned-messages"><i class="anchor-icon"></i></a>Pinned messages</h3>
|
||||
<p>Telegram allows pinning multiple messages on top in a chat, group, supergroup or channel. </p>
|
||||
<p>See <a href="/api/pin">here »</a> for more info on pinning and unpinning messages. </p>
|
||||
<p>See <a href="/api/pin">here »</a> for more info on pinning and unpinning messages. </p>
|
||||
<h3><a class="anchor" href="#discussion" id="discussion" name="discussion"><i class="anchor-icon"></i></a>Discussion</h3>
|
||||
<p>Groups can be associated to a channel as a <a href="https://telegram.org/blog/privacy-discussions-web-bots">discussion group</a>, to allow users to discuss about posts. </p>
|
||||
<p>For more info on how to set a discussion group in channel, see <a href="/api/discussion">here »</a></p>
|
||||
<p>For more info on how to set a discussion group in channel, see <a href="/api/discussion">here »</a></p>
|
||||
<h3><a class="anchor" href="#recent-actions" id="recent-actions" name="recent-actions"><i class="anchor-icon"></i></a>Recent actions</h3>
|
||||
<p>Both supergroups and channels offer a so-called <a href="https://telegram.org/blog/admin-revolution">admin log</a>, a log of recent relevant supergroup and channel actions, like the modification of group/channel settings or information on behalf of an admin, user kicks and bans, and more.</p>
|
||||
<p>See <a href="/api/recent-actions">here »</a> for more info.</p>
|
||||
<p>See <a href="/api/recent-actions">here »</a> for more info.</p>
|
||||
<h3><a class="anchor" href="#global-search" id="global-search" name="global-search"><i class="anchor-icon"></i></a>Global search</h3>
|
||||
<p>The <a href="/api/search#global-search">search view »</a> has a separate Channel tab for channel-related global searches, see <a href="/api/search#global-search">here »</a> for more info.</p></div>
|
||||
<p>The <a href="/api/search#global-search">search view »</a> has a separate Channel tab for channel-related global searches, see <a href="/api/search#global-search">here »</a> for more info.</p></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -72,17 +72,17 @@
|
|||
<a href='/method/account.updateColor'>account.updateColor</a>#7cefa15d flags:<a href='/type/%23'>#</a> for_profile:flags.1?<a href='/constructor/true'>true</a> color:flags.2?<a href='/type/int'>int</a> background_emoji_id:flags.0?<a href='/type/long'>long</a> = <a href='/type/Bool'>Bool</a>;
|
||||
|
||||
<a href='/method/channels.updateColor'>channels.updateColor</a>#d8aa3671 flags:<a href='/type/%23'>#</a> for_profile:flags.1?<a href='/constructor/true'>true</a> channel:<a href='/type/InputChannel'>InputChannel</a> color:flags.2?<a href='/type/int'>int</a> background_emoji_id:flags.0?<a href='/type/long'>long</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||
<p>A <a href="/constructor/peerColor">peerColor</a> constructor contains a color palette ID (<code>id</code>) and a <a href="/api/custom-emoji">custom emoji sticker »</a> (<code>background_emoji</code>) to be re-colored using the colors in the palette and spread out throughout the palette, generating a background that can be used in the profile page of a user, and in other places throughout the UI, namely in in webpage preview message frames and message accent colors when quoting or replying to messages sent by a channel or user that enabled a custom message accents. </p>
|
||||
<p>A <a href="/constructor/peerColor">peerColor</a> constructor contains a color palette ID (<code>id</code>) and a <a href="/api/custom-emoji">custom emoji sticker »</a> (<code>background_emoji</code>) to be re-colored using the colors in the palette and spread out throughout the palette, generating a background that can be used in the profile page of a user, and in other places throughout the UI, namely in in webpage preview message frames and message accent colors when quoting or replying to messages sent by a channel or user that enabled a custom message accents. </p>
|
||||
<p>The color palettes is identified by an <code>id</code> (not by an RGB24 color); use <a href="/method/help.getPeerProfileColors">help.getPeerProfileColors</a> to obtain all color palettes (represented by <a href="/constructor/help.peerColorOption">help.peerColorOption</a> constructors) that can be used in the background of a profile page, and use <a href="/method/help.getPeerColors">help.getPeerColors</a> to obtain all color palettes that can be used in message accents. </p>
|
||||
<p>A color palette is represented by a <a href="/constructor/help.peerColorOption">help.peerColorOption</a> constructor: the palette ID is contained in <code>color_id</code>; the palette for light mode is contained in the <code>colors</code> field, the palette for dark mode is contained in the <code>dark_colors</code> field.<br>
|
||||
If the <code>hidden</code> flag is set it should not be displayed as an option to the user when choosing a palette to use in the profile page or in message accents. </p>
|
||||
<p>The actual colors that should be used are contained either in a <a href="/constructor/help.peerColorSet">help.peerColorSet</a> (returned by <a href="/method/help.getPeerColors">help.getPeerColors</a>, containing a palette for message accents) or in a <a href="/constructor/help.peerColorProfileSet">help.peerColorProfileSet</a> (returned by <a href="/method/help.getPeerColors">help.getPeerColors</a> containing a palette for profile pages), see the relative constructor pages for more info. </p>
|
||||
<p>Use <a href="/method/account.getDefaultBackgroundEmojis">account.getDefaultBackgroundEmojis</a> to obtain a list of IDs of <a href="/api/custom-emoji">custom emojis</a> that can be used in a palette background. </p>
|
||||
<p>All custom emojis in <a href="/api/custom-emoji">custom emoji stickersets »</a> with <code>text_color</code> flag set can also be used for the same purpose. </p>
|
||||
<p>All custom emojis in <a href="/api/custom-emoji">custom emoji stickersets »</a> with <code>text_color</code> flag set can also be used for the same purpose. </p>
|
||||
<p>Use <a href="/method/account.updateColor">account.updateColor</a> to update the color palette of the current account's message accents and/or profile page; note that the current account must be subscribed to <a href="/api/premium">Telegram Premium</a> in order to call the method.<br>
|
||||
Use <a href="/method/channels.updateColor">channels.updateColor</a> to update the color palette of a channel/supergroup's profile page accents, or a channel's message accent.</p>
|
||||
<p>Note that channels/supergroups can use a message accent palette or profile palette only after reaching at least the <a href="/api/boost">boost level</a> specified in the <code>channel_min_level</code>/<code>group_min_level</code> field of the <a href="/constructor/help.peerColorOption">help.peerColorOption</a> constructor for the chosen palette. </p>
|
||||
<p>Additionally, to change <strong>profile</strong> palettes, channels/supergroups must <strong>also</strong> reach at least the <a href="/api/boost">boost level</a> specified in the <a href="/api/config#channel-profile-bg-icon-level-min"><code>channel_profile_bg_icon_level_min</code> »</a>/<a href="/api/config#group-profile-bg-icon-level-min"><code>group_profile_bg_icon_level_min</code> »</a> config parameters. </p>
|
||||
<p>Additionally, to change <strong>profile</strong> palettes, channels/supergroups must <strong>also</strong> reach at least the <a href="/api/boost">boost level</a> specified in the <a href="/api/config#channel-profile-bg-icon-level-min"><code>channel_profile_bg_icon_level_min</code> »</a>/<a href="/api/config#group-profile-bg-icon-level-min"><code>group_profile_bg_icon_level_min</code> »</a> config parameters. </p>
|
||||
<p>The chosen message accent palette will be visible to other users in the <a href="/constructor/channel">channel</a>.<code>color</code> and <a href="/constructor/user">user</a>.<code>color</code> fields; changing it will emit an <a href="/constructor/updateChannel">updateChannel</a>/<a href="/constructor/updateUser">updateUser</a> update. </p>
|
||||
<p>The chosen profile palettes will be visible in the <a href="/constructor/user">user</a>.<code>profile_color</code> and <a href="/constructor/channel">channel</a>.<code>profile_color</code> fields; changing it will emit an <a href="/constructor/updateUser">updateUser</a> update/<a href="/constructor/updateChannel">updateChannel</a> update.</p>
|
||||
<p>If no palette is specified for a peer, a random color from red, orange, violet, green, cyan, blue, pink (eventually tweaked according to the client's theme) must be chosen locally as message accent palette once for every met peer.</p></div>
|
||||
|
|
|
@ -384,7 +384,7 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
|
|||
}</code></pre>
|
||||
<p>The fields included in the resulting JSON object are: </p>
|
||||
<h4><a class="anchor" href="#weather-search-username" id="weather-search-username" name="weather-search-username"><i class="anchor-icon"></i></a><code>weather_search_username</code></h4>
|
||||
<p>Contains the username of the bot used to query the current weather, to use in <a href="/api/stories#weather">weather media areas as specified here »</a>. (string)</p>
|
||||
<p>Contains the username of the bot used to query the current weather, to use in <a href="/api/stories#weather">weather media areas as specified here »</a>. (string)</p>
|
||||
<h4><a class="anchor" href="#story-weather-preload" id="story-weather-preload" name="story-weather-preload"><i class="anchor-icon"></i></a><code>story_weather_preload</code></h4>
|
||||
<p>If set and true, clients should preload the current weather on startup (as opposed to only when creating a <a href="/api/stories#weather">weather media area</a>) by querying the bot specified in <a href="#weather-search-username">weather_search_username</a>. (boolean)</p>
|
||||
<h4><a class="anchor" href="#emojies-animated-zoom" id="emojies-animated-zoom" name="emojies-animated-zoom"><i class="anchor-icon"></i></a><code>emojies_animated_zoom</code></h4>
|
||||
|
@ -404,7 +404,7 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
|
|||
<h4><a class="anchor" href="#gif-search-emojies" id="gif-search-emojies" name="gif-search-emojies"><i class="anchor-icon"></i></a><code>gif_search_emojies</code></h4>
|
||||
<p>Specifies a list of emojis that should be suggested as search term in a bar above the GIF search box (array of string emojis)</p>
|
||||
<h4><a class="anchor" href="#stickers-emoji-suggest-only-api" id="stickers-emoji-suggest-only-api" name="stickers-emoji-suggest-only-api"><i class="anchor-icon"></i></a><code>stickers_emoji_suggest_only_api</code></h4>
|
||||
<p>Specifies that the app should not display <a href="/api/stickers#sticker-suggestions">local sticker suggestions »</a> for emojis at all and just use the result of <a href="/method/messages.getStickers">messages.getStickers</a> (bool)</p>
|
||||
<p>Specifies that the app should not display <a href="/api/stickers#sticker-suggestions">local sticker suggestions »</a> for emojis at all and just use the result of <a href="/method/messages.getStickers">messages.getStickers</a> (bool)</p>
|
||||
<h4><a class="anchor" href="#stickers-emoji-cache-time" id="stickers-emoji-cache-time" name="stickers-emoji-cache-time"><i class="anchor-icon"></i></a><code>stickers_emoji_cache_time</code></h4>
|
||||
<p>Specifies the validity period of the local cache of <a href="/method/messages.getStickers">messages.getStickers</a>, also relevant when generating the <a href="/api/offsets#hash-generation">pagination hash</a> when invoking the method. (integer)</p>
|
||||
<h4><a class="anchor" href="#qr-login-camera" id="qr-login-camera" name="qr-login-camera"><i class="anchor-icon"></i></a><code>qr_login_camera</code></h4>
|
||||
|
@ -418,13 +418,13 @@ While <a href="/method/help.getConfig">help.getConfig</a> returns MTProto-specif
|
|||
<h4><a class="anchor" href="#autoarchive-setting-available" id="autoarchive-setting-available" name="autoarchive-setting-available"><i class="anchor-icon"></i></a><code>autoarchive_setting_available</code></h4>
|
||||
<p>Whether clients <em>can</em> invoke <a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a> with <a href="/constructor/globalPrivacySettings"><code>globalPrivacySettings.archive_and_mute_new_noncontact_peers = boolTrue</code></a>, to automatically archive and mute new incoming chats from non-contacts. (boolean)</p>
|
||||
<h4><a class="anchor" href="#pending-suggestions" id="pending-suggestions" name="pending-suggestions"><i class="anchor-icon"></i></a><code>pending_suggestions</code></h4>
|
||||
<p>Contains a list of suggestions that should be actively shown as a tooltip to the user. (Array of strings, possible values shown <a href="#suggestions">in the suggestions section »</a>). </p>
|
||||
<p>Contains a list of suggestions that should be actively shown as a tooltip to the user. (Array of strings, possible values shown <a href="#suggestions">in the suggestions section »</a>). </p>
|
||||
<h4><a class="anchor" href="#dismissed-suggestions" id="dismissed-suggestions" name="dismissed-suggestions"><i class="anchor-icon"></i></a><code>dismissed_suggestions</code></h4>
|
||||
<p>Contains a list of <a href="#inverted-suggestions">inverted suggestions</a> that were <a href="/api/config#dismissing-suggestions">dismissed</a> by the user. (Array of strings, possible values shown <a href="#inverted-suggestions">in the inverted suggestions section »</a>). </p>
|
||||
<p>Contains a list of <a href="#inverted-suggestions">inverted suggestions</a> that were <a href="/api/config#dismissing-suggestions">dismissed</a> by the user. (Array of strings, possible values shown <a href="#inverted-suggestions">in the inverted suggestions section »</a>). </p>
|
||||
<h4><a class="anchor" href="#topics-pinned-limit" id="topics-pinned-limit" name="topics-pinned-limit"><i class="anchor-icon"></i></a><code>topics_pinned_limit</code></h4>
|
||||
<p>Maximum number of <a href="/api/forum#forum-topics">topics</a> that can be pinned in a single <a href="/api/forum">forum</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#telegram-antispam-user-id" id="telegram-antispam-user-id" name="telegram-antispam-user-id"><i class="anchor-icon"></i></a><code>telegram_antispam_user_id</code></h4>
|
||||
<p>The ID of the official <a href="/api/antispam">native antispam bot</a>, that will automatically delete spam messages if enabled as specified in the <a href="/api/antispam">native antispam documentation »</a>.<br>
|
||||
<p>The ID of the official <a href="/api/antispam">native antispam bot</a>, that will automatically delete spam messages if enabled as specified in the <a href="/api/antispam">native antispam documentation »</a>.<br>
|
||||
When fetching the admin list of a supergroup using <a href="/method/channels.getParticipants">channels.getParticipants</a>, if native antispam functionality in the specified supergroup, the bot should be manually added to the admin list displayed to the user. (numeric string that represents a Telegram user/bot ID, should be casted to an int64)</p>
|
||||
<h4><a class="anchor" href="#telegram-antispam-group-size-min" id="telegram-antispam-group-size-min" name="telegram-antispam-group-size-min"><i class="anchor-icon"></i></a><code>telegram_antispam_group_size_min</code></h4>
|
||||
<p>Minimum number of group members required to enable <a href="/api/antispam">native antispam functionality</a>. (integer)</p>
|
||||
|
@ -433,9 +433,9 @@ When fetching the admin list of a supergroup using <a href="/method/channels.get
|
|||
<h4><a class="anchor" href="#hidden-members-group-size-min" id="hidden-members-group-size-min" name="hidden-members-group-size-min"><i class="anchor-icon"></i></a><code>hidden_members_group_size_min</code></h4>
|
||||
<p>Minimum number of participants required to hide the participants list of a supergroup using <a href="/method/channels.toggleParticipantsHidden">channels.toggleParticipantsHidden</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#url-auth-domains" id="url-auth-domains" name="url-auth-domains"><i class="anchor-icon"></i></a><code>url_auth_domains</code></h4>
|
||||
<p>A list of domains that support automatic login with manual user confirmation, <a href="/api/url-authorization#link-url-authorization">click here for more info on URL authorization »</a>. (array of strings)</p>
|
||||
<p>A list of domains that support automatic login with manual user confirmation, <a href="/api/url-authorization#link-url-authorization">click here for more info on URL authorization »</a>. (array of strings)</p>
|
||||
<h4><a class="anchor" href="#autologin-domains" id="autologin-domains" name="autologin-domains"><i class="anchor-icon"></i></a><code>autologin_domains</code></h4>
|
||||
<p>A list of Telegram domains that support automatic login with no user confirmation, <a href="/api/url-authorization#link-url-authorization">click here for more info on URL authorization »</a>. (array of strings)</p>
|
||||
<p>A list of Telegram domains that support automatic login with no user confirmation, <a href="/api/url-authorization#link-url-authorization">click here for more info on URL authorization »</a>. (array of strings)</p>
|
||||
<h4><a class="anchor" href="#whitelisted-domains" id="whitelisted-domains" name="whitelisted-domains"><i class="anchor-icon"></i></a><code>whitelisted_domains</code></h4>
|
||||
<p>A list of Telegram domains that can always be opened without additional user confirmation, when clicking on in-app links where the URL is not fully displayed (i.e. <a href="/constructor/messageEntityTextUrl">messageEntityTextUrl</a> entities). (array of strings)</p>
|
||||
<p>Note that when opening <a href="/api/links#direct-mini-app-links">direct Mini App links</a> for the first time, confirmation should still be requested from the user, even if the domain of the containing deep link is whitelisted (i.e. <code>t.me/<bot_username>/<short_name>?startapp=<start_parameter></code>, where <code>t.me</code> is whitelisted). </p>
|
||||
|
@ -462,11 +462,11 @@ When fetching the admin list of a supergroup using <a href="/method/channels.get
|
|||
<p>Default emoji status stickerset ID. (integer)<br>
|
||||
Note that the stickerset can be fetched using <a href="/constructor/inputStickerSetEmojiDefaultStatuses">inputStickerSetEmojiDefaultStatuses</a>. </p>
|
||||
<h4><a class="anchor" href="#ringtone-duration-max" id="ringtone-duration-max" name="ringtone-duration-max"><i class="anchor-icon"></i></a><code>ringtone_duration_max</code></h4>
|
||||
<p>The maximum duration in seconds of <a href="/api/ringtones">uploadable notification sounds »</a> (integer)</p>
|
||||
<p>The maximum duration in seconds of <a href="/api/ringtones">uploadable notification sounds »</a> (integer)</p>
|
||||
<h4><a class="anchor" href="#ringtone-size-max" id="ringtone-size-max" name="ringtone-size-max"><i class="anchor-icon"></i></a><code>ringtone_size_max</code></h4>
|
||||
<p>The maximum post-conversion size in bytes of <a href="/api/ringtones">uploadable notification sounds »</a></p>
|
||||
<p>The maximum post-conversion size in bytes of <a href="/api/ringtones">uploadable notification sounds »</a></p>
|
||||
<h4><a class="anchor" href="#ringtone-saved-count-max" id="ringtone-saved-count-max" name="ringtone-saved-count-max"><i class="anchor-icon"></i></a><code>ringtone_saved_count_max</code></h4>
|
||||
<p>The maximum number of <a href="/api/ringtones">saveable notification sounds »</a></p>
|
||||
<p>The maximum number of <a href="/api/ringtones">saveable notification sounds »</a></p>
|
||||
<h4><a class="anchor" href="#message-animated-emoji-max" id="message-animated-emoji-max" name="message-animated-emoji-max"><i class="anchor-icon"></i></a><code>message_animated_emoji_max</code></h4>
|
||||
<p>The maximum number of <a href="/api/custom-emoji">custom emojis</a> that may be present in a message. (integer)</p>
|
||||
<h4><a class="anchor" href="#stickers-premium-by-emoji-num" id="stickers-premium-by-emoji-num" name="stickers-premium-by-emoji-num"><i class="anchor-icon"></i></a><code>stickers_premium_by_emoji_num</code></h4>
|
||||
|
@ -484,9 +484,9 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
|
|||
<h4><a class="anchor" href="#saved-gifs-limit-premium" id="saved-gifs-limit-premium" name="saved-gifs-limit-premium"><i class="anchor-icon"></i></a><code>saved_gifs_limit_premium</code></h4>
|
||||
<p>The maximum number of GIFs a <a href="/api/premium">Premium</a> user may save (integer)</p>
|
||||
<h4><a class="anchor" href="#stickers-faved-limit-default" id="stickers-faved-limit-default" name="stickers-faved-limit-default"><i class="anchor-icon"></i></a><code>stickers_faved_limit_default</code></h4>
|
||||
<p>The maximum number of stickers a non-<a href="/api/premium">Premium</a> user may <a href="/api/stickers#favorite-stickersets">add to Favorites »</a> (integer)</p>
|
||||
<p>The maximum number of stickers a non-<a href="/api/premium">Premium</a> user may <a href="/api/stickers#favorite-stickersets">add to Favorites »</a> (integer)</p>
|
||||
<h4><a class="anchor" href="#stickers-faved-limit-premium" id="stickers-faved-limit-premium" name="stickers-faved-limit-premium"><i class="anchor-icon"></i></a><code>stickers_faved_limit_premium</code></h4>
|
||||
<p>The maximum number of stickers a <a href="/api/premium">Premium</a> user may <a href="/api/stickers#favorite-stickersets">add to Favorites »</a> (integer)</p>
|
||||
<p>The maximum number of stickers a <a href="/api/premium">Premium</a> user may <a href="/api/stickers#favorite-stickersets">add to Favorites »</a> (integer)</p>
|
||||
<h4><a class="anchor" href="#dialog-filters-limit-default" id="dialog-filters-limit-default" name="dialog-filters-limit-default"><i class="anchor-icon"></i></a><code>dialog_filters_limit_default</code></h4>
|
||||
<p>The maximum number of <a href="/api/folders">folders</a> a non-<a href="/api/premium">Premium</a> user may create (integer)</p>
|
||||
<h4><a class="anchor" href="#dialog-filters-limit-premium" id="dialog-filters-limit-premium" name="dialog-filters-limit-premium"><i class="anchor-icon"></i></a><code>dialog_filters_limit_premium</code></h4>
|
||||
|
@ -520,13 +520,13 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
|
|||
<h4><a class="anchor" href="#about-length-limit-premium" id="about-length-limit-premium" name="about-length-limit-premium"><i class="anchor-icon"></i></a><code>about_length_limit_premium</code></h4>
|
||||
<p>The maximum UTF-8 length of bios of <a href="/api/premium">Premium</a> users (integer)</p>
|
||||
<h4><a class="anchor" href="#premium-promo-order" id="premium-promo-order" name="premium-promo-order"><i class="anchor-icon"></i></a><code>premium_promo_order</code></h4>
|
||||
<p>Array of string identifiers, indicating the order of <a href="/api/premium">Telegram Premium</a> features in the Telegram Premium promotion popup, <a href="/api/premium#telegram-premium-features">see here for the possible values »</a></p>
|
||||
<p>Array of string identifiers, indicating the order of <a href="/api/premium">Telegram Premium</a> features in the Telegram Premium promotion popup, <a href="/api/premium#telegram-premium-features">see here for the possible values »</a></p>
|
||||
<h4><a class="anchor" href="#business-promo-order" id="business-promo-order" name="business-promo-order"><i class="anchor-icon"></i></a><code>business_promo_order</code></h4>
|
||||
<p>Array of string identifiers, indicating the order of <a href="/api/business">Telegram Business</a> features in the Telegram Business promotion popup, <a href="/api/business#business-features-promo-page">see here for the possible values »</a></p>
|
||||
<p>Array of string identifiers, indicating the order of <a href="/api/business">Telegram Business</a> features in the Telegram Business promotion popup, <a href="/api/business#business-features-promo-page">see here for the possible values »</a></p>
|
||||
<h4><a class="anchor" href="#premium-bot-username" id="premium-bot-username" name="premium-bot-username"><i class="anchor-icon"></i></a><code>premium_bot_username</code></h4>
|
||||
<p>Contains the username of the official <a href="/api/premium">Telegram Premium</a> bot that may be used to buy a <a href="/api/premium">Telegram Premium</a> subscription, see <a href="/api/premium">here for detailed instructions »</a> (string)</p>
|
||||
<p>Contains the username of the official <a href="/api/premium">Telegram Premium</a> bot that may be used to buy a <a href="/api/premium">Telegram Premium</a> subscription, see <a href="/api/premium">here for detailed instructions »</a> (string)</p>
|
||||
<h4><a class="anchor" href="#premium-invoice-slug" id="premium-invoice-slug" name="premium-invoice-slug"><i class="anchor-icon"></i></a><code>premium_invoice_slug</code></h4>
|
||||
<p>Contains an <a href="/api/payments">invoice slug</a> that may be used to buy a <a href="/api/premium">Telegram Premium</a> subscription, see <a href="/api/premium">here for detailed instructions »</a> (string)</p>
|
||||
<p>Contains an <a href="/api/payments">invoice slug</a> that may be used to buy a <a href="/api/premium">Telegram Premium</a> subscription, see <a href="/api/premium">here for detailed instructions »</a> (string)</p>
|
||||
<h4><a class="anchor" href="#premium-gift-attach-menu-icon" id="premium-gift-attach-menu-icon" name="premium-gift-attach-menu-icon"><i class="anchor-icon"></i></a><code>premium_gift_attach_menu_icon</code></h4>
|
||||
<p>Whether a gift icon should be shown in the attachment menu in private chats with users, offering the current user to gift a <a href="/api/premium">Telegram Premium</a> subscription to the other user in the chat. (boolean)</p>
|
||||
<h4><a class="anchor" href="#premium-gift-text-field-icon" id="premium-gift-text-field-icon" name="premium-gift-text-field-icon"><i class="anchor-icon"></i></a><code>premium_gift_text_field_icon</code></h4>
|
||||
|
@ -546,7 +546,7 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
|
|||
<h4><a class="anchor" href="#large-queue-max-active-operations-count" id="large-queue-max-active-operations-count" name="large-queue-max-active-operations-count"><i class="anchor-icon"></i></a><code>large_queue_max_active_operations_count</code></h4>
|
||||
<p>A soft limit, specifying the maximum number of files that should be downloaded in parallel from the same DC, for files bigger than 20MB. (integer)</p>
|
||||
<h4><a class="anchor" href="#authorization-autoconfirm-period" id="authorization-autoconfirm-period" name="authorization-autoconfirm-period"><i class="anchor-icon"></i></a><code>authorization_autoconfirm_period</code></h4>
|
||||
<p>An <a href="/api/auth#confirming-login">unconfirmed session »</a> will be autoconfirmed this many seconds after login. (integer)</p>
|
||||
<p>An <a href="/api/auth#confirming-login">unconfirmed session »</a> will be autoconfirmed this many seconds after login. (integer)</p>
|
||||
<h4><a class="anchor" href="#story-viewers-expire-period" id="story-viewers-expire-period" name="story-viewers-expire-period"><i class="anchor-icon"></i></a><code>story_viewers_expire_period</code></h4>
|
||||
<p>The exact list of users that viewed the story will be hidden from the poster this many seconds after the story expires. (integer)</p>
|
||||
<p>This limit applies <strong>only</strong> to non-<a href="/api/premium">Premium</a> users, <a href="/api/premium">Premium</a> users can <strong>always</strong> access the viewer list.</p>
|
||||
|
@ -581,18 +581,18 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
|
|||
<h4><a class="anchor" href="#stories-sent-monthly-limit-premium" id="stories-sent-monthly-limit-premium" name="stories-sent-monthly-limit-premium"><i class="anchor-icon"></i></a><code>stories_sent_monthly_limit_premium</code></h4>
|
||||
<p>Maximum number of stories that can be sent in a month by <a href="/api/premium">Premium</a> users. (integer)</p>
|
||||
<h4><a class="anchor" href="#stories-suggested-reactions-limit-default" id="stories-suggested-reactions-limit-default" name="stories-suggested-reactions-limit-default"><i class="anchor-icon"></i></a><code>stories_suggested_reactions_limit_default</code></h4>
|
||||
<p>Maximum number of <a href="/api/stories#media-areas">story reaction media areas »</a> that can be added to a story by non-<a href="/api/premium">Premium</a> users. (integer)</p>
|
||||
<p>Maximum number of <a href="/api/stories#media-areas">story reaction media areas »</a> that can be added to a story by non-<a href="/api/premium">Premium</a> users. (integer)</p>
|
||||
<h4><a class="anchor" href="#stories-suggested-reactions-limit-premium" id="stories-suggested-reactions-limit-premium" name="stories-suggested-reactions-limit-premium"><i class="anchor-icon"></i></a><code>stories_suggested_reactions_limit_premium</code></h4>
|
||||
<p>Maximum number of <a href="/api/stories#media-areas">story reaction media areas »</a> that can be added to a story by <a href="/api/premium">Premium</a> users. (integer)</p>
|
||||
<p>Maximum number of <a href="/api/stories#media-areas">story reaction media areas »</a> that can be added to a story by <a href="/api/premium">Premium</a> users. (integer)</p>
|
||||
<h4><a class="anchor" href="#stories-venue-search-username" id="stories-venue-search-username" name="stories-venue-search-username"><i class="anchor-icon"></i></a><code>stories_venue_search_username</code></h4>
|
||||
<p>Username of the inline bot to use to generate venue location tags for stories, see <a href="/api/stories#location-tags">here »</a> for more info. (string)</p>
|
||||
<p>Username of the inline bot to use to generate venue location tags for stories, see <a href="/api/stories#location-tags">here »</a> for more info. (string)</p>
|
||||
<h4><a class="anchor" href="#stories-changelog-user-id" id="stories-changelog-user-id" name="stories-changelog-user-id"><i class="anchor-icon"></i></a><code>stories_changelog_user_id</code></h4>
|
||||
<p>ID of the official Telegram user that will post stories about new Telegram features: stories posted by this user should be shown on the <a href="/api/stories#watching-stories">active or active and hidden stories bar</a> just like for contacts, even if the user was removed from the contact list. (integer, defaults to <code>777000</code>)</p>
|
||||
<h4><a class="anchor" href="#stories-entities" id="stories-entities" name="stories-entities"><i class="anchor-icon"></i></a><code>stories_entities</code></h4>
|
||||
<p>Whether <a href="/api/entities">styled text entities</a> and links in story text captions can be used by all users (<code>enabled</code>), only [Premium](/api/premium users) (<code>premium</code>), or no one (<code>disabled</code>). (string)</p>
|
||||
<p>This field is used both when posting stories, to indicate to the user whether they can use entities, and when viewing stories, to hide entities (client-side) on stories posted by users whose <a href="/api/premium">Premium</a> subscription has expired (if <code>stories_entities == "premium"</code> and <a href="/constructor/user">user</a>.<code>premium</code> is not set, or if <code>stories_entities == "disabled"</code>). </p>
|
||||
<h4><a class="anchor" href="#stories-area-url-max" id="stories-area-url-max" name="stories-area-url-max"><i class="anchor-icon"></i></a><code>stories_area_url_max</code></h4>
|
||||
<p>Maximum number of <a href="/api/stories#media-areas">URL media areas »</a> that can be added to a posted story. (integer)</p>
|
||||
<p>Maximum number of <a href="/api/stories#media-areas">URL media areas »</a> that can be added to a posted story. (integer)</p>
|
||||
<h4><a class="anchor" href="#giveaway-gifts-purchase-available" id="giveaway-gifts-purchase-available" name="giveaway-gifts-purchase-available"><i class="anchor-icon"></i></a><code>giveaway_gifts_purchase_available</code></h4>
|
||||
<p>Whether <a href="/api/giveaways">giveaways</a> can be started by the current user. (boolean)</p>
|
||||
<h4><a class="anchor" href="#giveaway-add-peers-max" id="giveaway-add-peers-max" name="giveaway-add-peers-max"><i class="anchor-icon"></i></a><code>giveaway_add_peers_max</code></h4>
|
||||
|
@ -608,9 +608,9 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
|
|||
<h4><a class="anchor" href="#boosts-per-sent-gift" id="boosts-per-sent-gift" name="boosts-per-sent-gift"><i class="anchor-icon"></i></a><code>boosts_per_sent_gift</code></h4>
|
||||
<p>The number of additional <a href="/api/boost">boost slots</a> that the current user will receive when <a href="/api/premium#gifting-telegram-premium">gifting a Telegram Premium subscription</a>. </p>
|
||||
<h4><a class="anchor" href="#transcribe-audio-trial-weekly-number" id="transcribe-audio-trial-weekly-number" name="transcribe-audio-trial-weekly-number"><i class="anchor-icon"></i></a><code>transcribe_audio_trial_weekly_number</code></h4>
|
||||
<p>The maximum number of <a href="/api/transcribe">speech recognition »</a> calls per week for non-<a href="/api/premium">Premium</a> users. (integer)</p>
|
||||
<p>The maximum number of <a href="/api/transcribe">speech recognition »</a> calls per week for non-<a href="/api/premium">Premium</a> users. (integer)</p>
|
||||
<h4><a class="anchor" href="#transcribe-audio-trial-duration-max" id="transcribe-audio-trial-duration-max" name="transcribe-audio-trial-duration-max"><i class="anchor-icon"></i></a><code>transcribe_audio_trial_duration_max</code></h4>
|
||||
<p>The maximum allowed duration of media in seconds for <a href="/api/transcribe">speech recognition »</a> for non-<a href="/api/premium">Premium</a> users. (integer)</p>
|
||||
<p>The maximum allowed duration of media in seconds for <a href="/api/transcribe">speech recognition »</a> for non-<a href="/api/premium">Premium</a> users. (integer)</p>
|
||||
<h4><a class="anchor" href="#recommended-channels-limit-default" id="recommended-channels-limit-default" name="recommended-channels-limit-default"><i class="anchor-icon"></i></a><code>recommended_channels_limit_default</code></h4>
|
||||
<p>The maximum number of similar channels that can be recommended by <a href="/method/channels.getChannelRecommendations">channels.getChannelRecommendations»</a> to non-<a href="/api/premium">Premium</a> users. (integer)</p>
|
||||
<h4><a class="anchor" href="#recommended-channels-limit-premium" id="recommended-channels-limit-premium" name="recommended-channels-limit-premium"><i class="anchor-icon"></i></a><code>recommended_channels_limit_premium</code></h4>
|
||||
|
@ -618,27 +618,27 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
|
|||
<h4><a class="anchor" href="#quote-length-max" id="quote-length-max" name="quote-length-max"><i class="anchor-icon"></i></a><code>quote_length_max</code></h4>
|
||||
<p>Maximum UTF-8 length of <a href="/constructor/inputReplyToMessage">quoted text</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#channel-bg-icon-level-min" id="channel-bg-icon-level-min" name="channel-bg-icon-level-min"><i class="anchor-icon"></i></a><code>channel_bg_icon_level_min</code></h4>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to change their <a href="/api/colors">message accent palette emoji »</a>. (integer)</p>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to change their <a href="/api/colors">message accent palette emoji »</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#channel-profile-bg-icon-level-min" id="channel-profile-bg-icon-level-min" name="channel-profile-bg-icon-level-min"><i class="anchor-icon"></i></a><code>channel_profile_bg_icon_level_min</code></h4>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a> and the boost level specified in the <code>channel_min_level</code> field of the <a href="/constructor/help.peerColorOption">help.peerColorOption</a> constructor for the chosen palette, channels gain the ability to change the emoji and color used in the <a href="/api/colors">profile accent palette »</a>. (integer)</p>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a> and the boost level specified in the <code>channel_min_level</code> field of the <a href="/constructor/help.peerColorOption">help.peerColorOption</a> constructor for the chosen palette, channels gain the ability to change the emoji and color used in the <a href="/api/colors">profile accent palette »</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#group-profile-bg-icon-level-min" id="group-profile-bg-icon-level-min" name="group-profile-bg-icon-level-min"><i class="anchor-icon"></i></a><code>group_profile_bg_icon_level_min</code></h4>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level</a> and the boost level specified in the <code>group_min_level</code> field of the <a href="/constructor/help.peerColorOption">help.peerColorOption</a> constructor for the chosen palette, supergroups gain the ability to change the emoji and color used in the <a href="/api/colors">profile accent palette »</a>. (integer)</p>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level</a> and the boost level specified in the <code>group_min_level</code> field of the <a href="/constructor/help.peerColorOption">help.peerColorOption</a> constructor for the chosen palette, supergroups gain the ability to change the emoji and color used in the <a href="/api/colors">profile accent palette »</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#channel-emoji-status-level-min" id="channel-emoji-status-level-min" name="channel-emoji-status-level-min"><i class="anchor-icon"></i></a><code>channel_emoji_status_level_min</code></h4>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to change their <a href="/api/emoji-status">status emoji »</a>. (integer)</p>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to change their <a href="/api/emoji-status">status emoji »</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#group-emoji-status-level-min" id="group-emoji-status-level-min" name="group-emoji-status-level-min"><i class="anchor-icon"></i></a><code>group_emoji_status_level_min</code></h4>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, supergroups gain the ability to change their <a href="/api/emoji-status">status emoji »</a>. (integer)</p>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, supergroups gain the ability to change their <a href="/api/emoji-status">status emoji »</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#channel-wallpaper-level-min" id="channel-wallpaper-level-min" name="channel-wallpaper-level-min"><i class="anchor-icon"></i></a><code>channel_wallpaper_level_min</code></h4>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to set a <a href="/api/wallpapers#channel-and-supergroup-wallpapers">fill channel wallpaper, see here » for more info</a>. (integer)</p>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to set a <a href="/api/wallpapers#channel-and-supergroup-wallpapers">fill channel wallpaper, see here » for more info</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#group-wallpaper-level-min" id="group-wallpaper-level-min" name="group-wallpaper-level-min"><i class="anchor-icon"></i></a><code>group_wallpaper_level_min</code></h4>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, supergroups gain the ability to set a <a href="/api/wallpapers#channel-and-supergroup-wallpapers">fill supergroup wallpaper, see here » for more info</a>. (integer)</p>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, supergroups gain the ability to set a <a href="/api/wallpapers#channel-and-supergroup-wallpapers">fill supergroup wallpaper, see here » for more info</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#channel-custom-wallpaper-level-min" id="channel-custom-wallpaper-level-min" name="channel-custom-wallpaper-level-min"><i class="anchor-icon"></i></a><code>channel_custom_wallpaper_level_min</code></h4>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to set any custom <a href="/api/wallpapers">wallpaper</a>, not just <a href="/api/wallpapers">fill channel wallpapers, see here » for more info</a>. (integer)</p>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, channels gain the ability to set any custom <a href="/api/wallpapers">wallpaper</a>, not just <a href="/api/wallpapers">fill channel wallpapers, see here » for more info</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#group-custom-wallpaper-level-min" id="group-custom-wallpaper-level-min" name="group-custom-wallpaper-level-min"><i class="anchor-icon"></i></a><code>group_custom_wallpaper_level_min</code></h4>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, supergroups gain the ability to set any custom <a href="/api/wallpapers">wallpaper</a>, not just <a href="/api/wallpapers">fill supergroup wallpapers, see here » for more info</a>. (integer)</p>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, supergroups gain the ability to set any custom <a href="/api/wallpapers">wallpaper</a>, not just <a href="/api/wallpapers">fill supergroup wallpapers, see here » for more info</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#group-transcribe-level-min" id="group-transcribe-level-min" name="group-transcribe-level-min"><i class="anchor-icon"></i></a><code>group_transcribe_level_min</code></h4>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, non-<a href="/api/premium">Premium</a> users in the supergroup gain the ability to <a href="/api/transcribe">transcribe any voice message</a>, without using up their free transcription quota. (integer)</p>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, non-<a href="/api/premium">Premium</a> users in the supergroup gain the ability to <a href="/api/transcribe">transcribe any voice message</a>, without using up their free transcription quota. (integer)</p>
|
||||
<h4><a class="anchor" href="#group-emoji-stickers-level-min" id="group-emoji-stickers-level-min" name="group-emoji-stickers-level-min"><i class="anchor-icon"></i></a><code>group_emoji_stickers_level_min</code></h4>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, supergroups gain the ability to associate a <a href="/api/custom-emoji">custom emoji stickerset »</a>, which can be used by all users of the group (including non-<a href="/api/premium">Premium</a> users!), for messages sent within the group. (integer)</p>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level »</a>, supergroups gain the ability to associate a <a href="/api/custom-emoji">custom emoji stickerset »</a>, which can be used by all users of the group (including non-<a href="/api/premium">Premium</a> users!), for messages sent within the group. (integer)</p>
|
||||
<h4><a class="anchor" href="#channel-restrict-sponsored-level-min" id="channel-restrict-sponsored-level-min" name="channel-restrict-sponsored-level-min"><i class="anchor-icon"></i></a><code>channel_restrict_sponsored_level_min</code></h4>
|
||||
<p>After reaching at least this <a href="/api/boost">boost level</a>, channel owners may disable ads on the channel for all users using <a href="/method/channels.restrictSponsoredMessages">channels.restrictSponsoredMessages</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#saved-dialogs-pinned-limit-default" id="saved-dialogs-pinned-limit-default" name="saved-dialogs-pinned-limit-default"><i class="anchor-icon"></i></a><code>saved_dialogs_pinned_limit_default</code></h4>
|
||||
|
@ -646,43 +646,43 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
|
|||
<h4><a class="anchor" href="#saved-dialogs-pinned-limit-premium" id="saved-dialogs-pinned-limit-premium" name="saved-dialogs-pinned-limit-premium"><i class="anchor-icon"></i></a><code>saved_dialogs_pinned_limit_premium</code></h4>
|
||||
<p>Maximum number of pinned dialogs in <a href="/api/saved-messages">saved messages</a> for <a href="/api/premium">Premium</a> users. (integer)</p>
|
||||
<h4><a class="anchor" href="#can-edit-factcheck" id="can-edit-factcheck" name="can-edit-factcheck"><i class="anchor-icon"></i></a><code>can_edit_factcheck</code></h4>
|
||||
<p>If set and true, the current user is an independent fact-checker and <a href="/api/factcheck">may edit fact-checks »</a>. (boolean)</p>
|
||||
<p>If set and true, the current user is an independent fact-checker and <a href="/api/factcheck">may edit fact-checks »</a>. (boolean)</p>
|
||||
<h4><a class="anchor" href="#factcheck-length-limit" id="factcheck-length-limit" name="factcheck-length-limit"><i class="anchor-icon"></i></a><code>factcheck_length_limit</code></h4>
|
||||
<p>Maximum UTF-8 length <a href="/api/factcheck">of fact-checks »</a>. (integer)</p>
|
||||
<p>Maximum UTF-8 length <a href="/api/factcheck">of fact-checks »</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#quick-replies-limit" id="quick-replies-limit" name="quick-replies-limit"><i class="anchor-icon"></i></a><code>quick_replies_limit</code></h4>
|
||||
<p>Maximum number of <a href="/api/business#quick-reply-shortcuts">quick reply shortcuts »</a> that may be created. (integer)</p>
|
||||
<p>Maximum number of <a href="/api/business#quick-reply-shortcuts">quick reply shortcuts »</a> that may be created. (integer)</p>
|
||||
<h4><a class="anchor" href="#quick-reply-messages-limit" id="quick-reply-messages-limit" name="quick-reply-messages-limit"><i class="anchor-icon"></i></a><code>quick_reply_messages_limit</code></h4>
|
||||
<p>Maximum number of messages that may be added to a <a href="/api/business#quick-reply-shortcuts">quick reply shortcut »</a>. (integer)</p>
|
||||
<p>Maximum number of messages that may be added to a <a href="/api/business#quick-reply-shortcuts">quick reply shortcut »</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#intro-title-length-limit" id="intro-title-length-limit" name="intro-title-length-limit"><i class="anchor-icon"></i></a><code>intro_title_length_limit</code></h4>
|
||||
<p>Maximum UTF-8 length of the <a href="/constructor/businessIntro">business introduction title »</a>. (integer)</p>
|
||||
<p>Maximum UTF-8 length of the <a href="/constructor/businessIntro">business introduction title »</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#intro-description-length-limit" id="intro-description-length-limit" name="intro-description-length-limit"><i class="anchor-icon"></i></a><code>intro_description_length_limit</code></h4>
|
||||
<p>Maximum UTF-8 length of the <a href="/constructor/businessIntro">business introduction description »</a>. (integer)</p>
|
||||
<p>Maximum UTF-8 length of the <a href="/constructor/businessIntro">business introduction description »</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#business-chat-links-limit" id="business-chat-links-limit" name="business-chat-links-limit"><i class="anchor-icon"></i></a><code>business_chat_links_limit</code></h4>
|
||||
<p>Maximum number of active <a href="/api/business#business-chat-links">business chat links</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#upload-premium-speedup-upload" id="upload-premium-speedup-upload" name="upload-premium-speedup-upload"><i class="anchor-icon"></i></a><code>upload_premium_speedup_upload</code></h4>
|
||||
<p>Indicates the file upload speedup enjoyed by <a href="/api/premium">Premium subscribers</a>, used <a href="/api/files#uploading-files">as specified here »</a> in the Premium modal shown when receiving <code>FLOOD_WAIT_PREMIUM_X</code> errors during file uploads. (integer)</p>
|
||||
<p>Indicates the file upload speedup enjoyed by <a href="/api/premium">Premium subscribers</a>, used <a href="/api/files#uploading-files">as specified here »</a> in the Premium modal shown when receiving <code>FLOOD_WAIT_PREMIUM_X</code> errors during file uploads. (integer)</p>
|
||||
<h4><a class="anchor" href="#upload-premium-speedup-download" id="upload-premium-speedup-download" name="upload-premium-speedup-download"><i class="anchor-icon"></i></a><code>upload_premium_speedup_download</code></h4>
|
||||
<p>Indicates the file download speedup enjoyed by <a href="/api/premium">Premium subscribers</a>, used <a href="/api/files#downloading-files">as specified here »</a> in the Premium modal shown when receiving <code>FLOOD_WAIT_PREMIUM_X</code> errors during file downloads. (integer)</p>
|
||||
<p>Indicates the file download speedup enjoyed by <a href="/api/premium">Premium subscribers</a>, used <a href="/api/files#downloading-files">as specified here »</a> in the Premium modal shown when receiving <code>FLOOD_WAIT_PREMIUM_X</code> errors during file downloads. (integer)</p>
|
||||
<h4><a class="anchor" href="#upload-premium-speedup-notify-period" id="upload-premium-speedup-notify-period" name="upload-premium-speedup-notify-period"><i class="anchor-icon"></i></a><code>upload_premium_speedup_notify_period</code></h4>
|
||||
<p>The Premium modal shown when receiving <code>FLOOD_WAIT_PREMIUM_X</code> errors during file uploads/downloads should be shown at most every <code>upload_premium_speedup_notify_period</code> seconds. (integer)</p>
|
||||
<h4><a class="anchor" href="#stories-pinned-to-top-count-max" id="stories-pinned-to-top-count-max" name="stories-pinned-to-top-count-max"><i class="anchor-icon"></i></a><code>stories_pinned_to_top_count_max</code></h4>
|
||||
<p>The maximum number of <a href="/api/stories#pinned-or-archived-stories">stories that can be pinned on top of the profile »</a>. (integer)</p>
|
||||
<p>The maximum number of <a href="/api/stories#pinned-or-archived-stories">stories that can be pinned on top of the profile »</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#channel-revenue-withdrawal-enabled" id="channel-revenue-withdrawal-enabled" name="channel-revenue-withdrawal-enabled"><i class="anchor-icon"></i></a><code>channel_revenue_withdrawal_enabled</code></h4>
|
||||
<p>If true, indicates that <a href="/api/revenue">channel ad revenue withdrawal is enabled in the current region</a>; otherwise, all ad revenue-related UI options should be hidden from the user. (boolean)</p>
|
||||
<h4><a class="anchor" href="#stars-purchase-blocked" id="stars-purchase-blocked" name="stars-purchase-blocked"><i class="anchor-icon"></i></a><code>stars_purchase_blocked</code></h4>
|
||||
<p>If false, indicates that <a href="/api/stars">Telegram Stars may be used in the current region</a>; otherwise, all Star-related UI options should be hidden from the user. (boolean)</p>
|
||||
<h4><a class="anchor" href="#stars-revenue-withdrawal-min" id="stars-revenue-withdrawal-min" name="stars-revenue-withdrawal-min"><i class="anchor-icon"></i></a><code>stars_revenue_withdrawal_min</code></h4>
|
||||
<p>Minimum required amount of <a href="/api/stars">Telegram Stars</a> on a channel or bot's balance to allow <a href="/api/stars#withdrawing-revenue">withdrawal »</a>. (integer)</p>
|
||||
<p>Minimum required amount of <a href="/api/stars">Telegram Stars</a> on a channel or bot's balance to allow <a href="/api/stars#withdrawing-revenue">withdrawal »</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#stars-paid-post-amount-max" id="stars-paid-post-amount-max" name="stars-paid-post-amount-max"><i class="anchor-icon"></i></a><code>stars_paid_post_amount_max</code></h4>
|
||||
<p>Maximum price in <a href="/api/stars">Telegram Stars</a> for posted <a href="/api/paid-media">paid media</a>. (integer)</p>
|
||||
<h4><a class="anchor" href="#stars-gifts-enabled" id="stars-gifts-enabled" name="stars-gifts-enabled"><i class="anchor-icon"></i></a><code>stars_gifts_enabled</code></h4>
|
||||
<p><a href="/api/stars#buying-or-gifting-stars">Star gifting functionality</a> should only be enabled if this flag is equal to true. (boolean)</p>
|
||||
<h4><a class="anchor" href="#bot-preview-medias-max" id="bot-preview-medias-max" name="bot-preview-medias-max"><i class="anchor-icon"></i></a><code>bot_preview_medias_max</code></h4>
|
||||
<p>Maximum number of <a href="/api/bots/webapps#main-mini-app-previews">main mini app previews »</a> that can be added for a localization. (integer)</p>
|
||||
<p>Maximum number of <a href="/api/bots/webapps#main-mini-app-previews">main mini app previews »</a> that can be added for a localization. (integer)</p>
|
||||
<h4><a class="anchor" href="#web-app-allowed-protocols" id="web-app-allowed-protocols" name="web-app-allowed-protocols"><i class="anchor-icon"></i></a><code>web_app_allowed_protocols</code></h4>
|
||||
<p>Specifies a list of allowed schemes for URLs received in <a href="/api/web-events#web-app-open-link">web_app_open_link events</a>. (array of strings)</p>
|
||||
<h4><a class="anchor" href="#ton-proxy-address" id="ton-proxy-address" name="ton-proxy-address"><i class="anchor-icon"></i></a><code>ton_proxy_address</code></h4>
|
||||
<p>Specifies the domain name to be used to securely open <a href="/api/links#ton-sites">TON sites »</a>. (string)</p>
|
||||
<p>Specifies the domain name to be used to securely open <a href="/api/links#ton-sites">TON sites »</a>. (string)</p>
|
||||
<h3><a class="anchor" href="#suggestions" id="suggestions" name="suggestions"><i class="anchor-icon"></i></a>Suggestions</h3>
|
||||
<p>The API can return a set of useful suggestions for users of graphical clients. </p>
|
||||
<h4><a class="anchor" href="#basic-suggestions" id="basic-suggestions" name="basic-suggestions"><i class="anchor-icon"></i></a>Basic suggestions</h4>
|
||||
|
@ -699,7 +699,7 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
|
|||
|
||||
<a href='/method/help.getAppConfig'>help.getAppConfig</a>#61e3f854 hash:<a href='/type/int'>int</a> = <a href='/type/help.AppConfig'>help.AppConfig</a>;</code></pre>
|
||||
<p>The <a href="/method/help.getAppConfig">help.getAppConfig</a> method returns a JSON object containing rapidly evolving, client-specific configuration parameters.<br>
|
||||
A full list of these parameters can be seen in the <a href="#client-configuration">Client Configuration section »</a>, but we're mostly interested in the <code>pending_suggestions</code> and <code>autoarchive_setting_available</code> fields of the returned JSON object: </p>
|
||||
A full list of these parameters can be seen in the <a href="#client-configuration">Client Configuration section »</a>, but we're mostly interested in the <code>pending_suggestions</code> and <code>autoarchive_setting_available</code> fields of the returned JSON object: </p>
|
||||
<ul>
|
||||
<li><code>autoarchive_setting_available</code> - Whether clients <em>can</em> invoke <a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a> with <a href="/constructor/globalPrivacySettings"><code>globalPrivacySettings.archive_and_mute_new_noncontact_peers = boolTrue</code></a>, to automatically archive and mute new incoming chats from non-contacts. (boolean)</li>
|
||||
<li><code>pending_suggestions</code> - Contains a list of suggestions that should be actively shown as a tooltip to the user. Array of strings, possible values shown below:<ul>
|
||||
|
@ -713,7 +713,7 @@ A full list of these parameters can be seen in the <a href="#client-configuratio
|
|||
<li><code>"PREMIUM_RESTORE"</code> - Suggests the user to restore a recently expired Premium subscription</li>
|
||||
<li><code>"PREMIUM_CHRISTMAS"</code> - Suggests the user to <a href="/api/premium#gifting-telegram-premium">gift Telegram Premium</a> subscriptions to friends for Christmas.</li>
|
||||
<li><code>"PREMIUM_GRACE"</code> - Suggests the user to extend their expiring Telegram Premium subscription</li>
|
||||
<li><code>"BIRTHDAY_SETUP"</code> - Suggests the user to set a <a href="/api/profile#birthday">birthday »</a>.</li>
|
||||
<li><code>"BIRTHDAY_SETUP"</code> - Suggests the user to set a <a href="/api/profile#birthday">birthday »</a>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -721,7 +721,7 @@ A full list of these parameters can be seen in the <a href="#client-configuratio
|
|||
<p>These suggestions are <em>enabled by default</em>, and are never returned in the <code>pending_suggestions</code> field of the <a href="#client-configuration">client configuration object</a>. </p>
|
||||
<p>They can be dismissed by invoking <a href="/method/help.dismissSuggestion">help.dismissSuggestion</a> as usual, but unlike <a href="#basic-suggestions">basic suggestions</a>, once dismissed they will appear in the <code>dismissed_suggestions</code> field of the <a href="#client-configuration">client configuration object</a>. </p>
|
||||
<ul>
|
||||
<li><code>"BIRTHDAY_CONTACTS_TODAY"</code> - If not dismissed, indicates that the client should display the tooltip that recommends to gift a Telegram Premium subscription to contacts on their <a href="/api/profile#birthday">birthday »</a>.<br>
|
||||
<li><code>"BIRTHDAY_CONTACTS_TODAY"</code> - If not dismissed, indicates that the client should display the tooltip that recommends to gift a Telegram Premium subscription to contacts on their <a href="/api/profile#birthday">birthday »</a>.<br>
|
||||
This suggestion can be dismissed by invoking <a href="/method/help.dismissSuggestion">help.dismissSuggestion</a> when the user hides the tooltip, but it is also automatically dismissed by the server if the user gifts one or more Telegram Premium subscriptions to friends with birthdays falling within the next/previous 24 hours. </li>
|
||||
</ul>
|
||||
<h4><a class="anchor" href="#channel-suggestions" id="channel-suggestions" name="channel-suggestions"><i class="anchor-icon"></i></a>Channel suggestions</h4>
|
||||
|
|
|
@ -93,7 +93,7 @@ Note that according to the user's <a href="/api/privacy">privacy settings</a>, n
|
|||
|
||||
<a href='/method/contacts.addContact'>contacts.addContact</a>#e8f463d0 flags:<a href='/type/%23'>#</a> add_phone_privacy_exception:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/InputUser'>InputUser</a> first_name:<a href='/type/string'>string</a> last_name:<a href='/type/string'>string</a> phone:<a href='/type/string'>string</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||
<p>Telegram users may also be added to the contact list (even if we do not have access to their phone number!) using <a href="/method/contacts.addContact">contacts.addContact</a>. </p>
|
||||
<p>Set the <code>add_phone_privacy_exception</code> flag if we wish to allow the other user to see our phone number: this flag <strong>must</strong> be set if the <code>need_contacts_exception</code> flag of <a href="/constructor/peerSettings">peerSettings</a> is set (see the <a href="/api/action-bar">action bar documentation for more info »</a>). </p>
|
||||
<p>Set the <code>add_phone_privacy_exception</code> flag if we wish to allow the other user to see our phone number: this flag <strong>must</strong> be set if the <code>need_contacts_exception</code> flag of <a href="/constructor/peerSettings">peerSettings</a> is set (see the <a href="/api/action-bar">action bar documentation for more info »</a>). </p>
|
||||
<p>The other user will be offered to also add us to the contact list via the <a href="/api/action-bar">add contact action bar</a>: if they accept, their phone number will be automatically added to our contact. </p>
|
||||
<h3><a class="anchor" href="#share-our-phone-number" id="share-our-phone-number" name="share-our-phone-number"><i class="anchor-icon"></i></a>Share our phone number</h3>
|
||||
<pre><code>---functions---
|
||||
|
@ -121,7 +121,7 @@ Note that according to the user's <a href="/api/privacy">privacy settings</a>, n
|
|||
<a href='/method/contacts.getContactIDs'>contacts.getContactIDs</a>#7adc669d hash:<a href='/type/long'>long</a> = <a href='/type/Vector%20t'>Vector</a><<a href='/type/int'>int</a>>;</code></pre>
|
||||
<p>Use <a href="/method/contacts.getContacts">contacts.getContacts</a> to obtain all members of the contact list that have an associated Telegram account. </p>
|
||||
<p>Use <a href="/method/contacts.getContactIDs">contacts.getContactIDs</a> to obtain an array of Telegram user IDs for all contacts (0 is returned for contacts do not have an associated Telegram account or have hidden their account using privacy settings). </p>
|
||||
<p>To obtain the <em>full</em> contact list, including contacts which do not have an associated Telegram account, use <a href="/method/contacts.getSaved">contacts.getSaved</a> in combination with a <a href="/api/takeout">takeout session »</a>. </p>
|
||||
<p>To obtain the <em>full</em> contact list, including contacts which do not have an associated Telegram account, use <a href="/method/contacts.getSaved">contacts.getSaved</a> in combination with a <a href="/api/takeout">takeout session »</a>. </p>
|
||||
<h3><a class="anchor" href="#getting-contact-statuses" id="getting-contact-statuses" name="getting-contact-statuses"><i class="anchor-icon"></i></a>Getting contact statuses</h3>
|
||||
<p>Schema:</p>
|
||||
<pre><code><a href='/constructor/userStatusEmpty'>userStatusEmpty</a>#9d05049 = <a href='/type/UserStatus'>UserStatus</a>;
|
||||
|
|
|
@ -55,15 +55,15 @@
|
|||
---functions---
|
||||
|
||||
<a href='/method/messages.getCustomEmojiDocuments'>messages.getCustomEmojiDocuments</a>#d9ab0f54 document_id:<a href='/type/Vector%20t'>Vector</a><<a href='/type/long'>long</a>> = <a href='/type/Vector%20t'>Vector</a><<a href='/type/Document'>Document</a>>;</code></pre>
|
||||
<p>Custom emojis are a special kind of <a href="/api/entities">entity »</a>, containing just a <code>document_id</code>, which can be passed to <a href="/method/messages.getCustomEmojiDocuments">messages.getCustomEmojiDocuments</a> to fetch the <a href="/api/stickers">static, animated or video sticker emoji</a> that should be displayed to the user as described in the <a href="/api/stickers">stickers documentation</a>. </p>
|
||||
<p>Custom emojis are a special kind of <a href="/api/entities">entity »</a>, containing just a <code>document_id</code>, which can be passed to <a href="/method/messages.getCustomEmojiDocuments">messages.getCustomEmojiDocuments</a> to fetch the <a href="/api/stickers">static, animated or video sticker emoji</a> that should be displayed to the user as described in the <a href="/api/stickers">stickers documentation</a>. </p>
|
||||
<p>Custom emoji documents will contain <a href="/constructor/documentAttributeCustomEmoji">documentAttributeCustomEmoji</a> attribute instead of a <a href="/constructor/documentAttributeSticker">documentAttributeSticker</a>, containing information on the associated emoji (<code>alt</code>), whether the emoji can be used by non-premium users (<code>free</code>) and the associated <code>stickerset</code>.<br>
|
||||
If the <a href="/constructor/documentAttributeCustomEmoji">documentAttributeCustomEmoji</a>.<code>text_color</code> flag is set, the color of this TGS custom emoji should be changed to the text color when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context.</p>
|
||||
<p>Note that when sending messages with attached custom emojis, the <a href="/constructor/messageEntityCustomEmoji">messageEntityCustomEmoji</a> <a href="/api/entities">entity »</a> must wrap exactly one regular emoji (the one contained in <a href="/constructor/documentAttributeCustomEmoji">documentAttributeCustomEmoji</a>.<code>alt</code>) in the related text, otherwise the server will ignore it. </p>
|
||||
<p>Like stickers, custom emojis are organized in <a href="/api/stickers#stickersets">stickersets</a>: see the <a href="/api/stickers">stickers documentation »</a> for more info on how to work with them.</p>
|
||||
<p>To send a message with one or more custom emojis, create and attach <a href="/constructor/messageEntityCustomEmoji">messageEntityCustomEmoji</a> <a href="/api/entities">entities »</a> to a message.<br>
|
||||
Note that you can attach a maximum of <code>message_animated_emoji_max</code> custom emojis, as specified by the <a href="/api/config#message-animated-emoji-max">appConfig field »</a>. </p>
|
||||
<p>Note that when sending messages with attached custom emojis, the <a href="/constructor/messageEntityCustomEmoji">messageEntityCustomEmoji</a> <a href="/api/entities">entity »</a> must wrap exactly one regular emoji (the one contained in <a href="/constructor/documentAttributeCustomEmoji">documentAttributeCustomEmoji</a>.<code>alt</code>) in the related text, otherwise the server will ignore it. </p>
|
||||
<p>Like stickers, custom emojis are organized in <a href="/api/stickers#stickersets">stickersets</a>: see the <a href="/api/stickers">stickers documentation »</a> for more info on how to work with them.</p>
|
||||
<p>To send a message with one or more custom emojis, create and attach <a href="/constructor/messageEntityCustomEmoji">messageEntityCustomEmoji</a> <a href="/api/entities">entities »</a> to a message.<br>
|
||||
Note that you can attach a maximum of <code>message_animated_emoji_max</code> custom emojis, as specified by the <a href="/api/config#message-animated-emoji-max">appConfig field »</a>. </p>
|
||||
<h3><a class="anchor" href="#emoji-categories" id="emoji-categories" name="emoji-categories"><i class="anchor-icon"></i></a>Emoji categories</h3>
|
||||
<p>The custom emoji selection UI should offer a list of categories to quickly filter results by a (list of) emojis, or by some other criteria, see <a href="/api/emoji-categories">here »</a> for more info. </p>
|
||||
<p>The custom emoji selection UI should offer a list of categories to quickly filter results by a (list of) emojis, or by some other criteria, see <a href="/api/emoji-categories">here »</a> for more info. </p>
|
||||
<h3><a class="anchor" href="#emoji-keywords" id="emoji-keywords" name="emoji-keywords"><i class="anchor-icon"></i></a>Emoji keywords</h3>
|
||||
<pre><code><a href='/constructor/emojiKeyword'>emojiKeyword</a>#d5b3b9f9 keyword:<a href='/type/string'>string</a> emoticons:<a href='/type/Vector%20t'>Vector</a><<a href='/type/string'>string</a>> = <a href='/type/EmojiKeyword'>EmojiKeyword</a>;
|
||||
<a href='/constructor/emojiKeywordDeleted'>emojiKeywordDeleted</a>#236df622 keyword:<a href='/type/string'>string</a> emoticons:<a href='/type/Vector%20t'>Vector</a><<a href='/type/string'>string</a>> = <a href='/type/EmojiKeyword'>EmojiKeyword</a>;
|
||||
|
|
|
@ -77,7 +77,7 @@ Shown in the right bottom corner of the preview animation as a quick way for the
|
|||
Must also be shown in messages with this effect, near the message date: clicking on this icon should re-trigger the effect. </li>
|
||||
<li>Preview animation: the <a href="/api/stickers#animated-stickers">animated sticker</a> specified in <code>effect_sticker_id</code>.<br>
|
||||
Used for the effect selection menu. </li>
|
||||
<li>Effect animation: a different <a href="/api/stickers#animated-stickers">animated sticker</a>, specified either by <code>effect_animation_id</code> (if set) or by the <a href="/api/stickers#premium-animated-sticker-effects">premium animated sticker effect</a> associated to the animated sticker specified in <code>effect_sticker_id</code> (always different from the animated sticker itself, fetched thanks to the <a href="/constructor/videoSize">videoSize</a> of type <code>f</code> as specified <a href="/api/stickers#premium-animated-sticker-effects">here »</a>).<br>
|
||||
<li>Effect animation: a different <a href="/api/stickers#animated-stickers">animated sticker</a>, specified either by <code>effect_animation_id</code> (if set) or by the <a href="/api/stickers#premium-animated-sticker-effects">premium animated sticker effect</a> associated to the animated sticker specified in <code>effect_sticker_id</code> (always different from the animated sticker itself, fetched thanks to the <a href="/constructor/videoSize">videoSize</a> of type <code>f</code> as specified <a href="/api/stickers#premium-animated-sticker-effects">here »</a>).<br>
|
||||
The effect animation should be only played once, when first receiving or sending the message.<br>
|
||||
Clicking on the preview icon near the message date should re-trigger the effect.</li>
|
||||
</ul></div>
|
||||
|
|
|
@ -66,11 +66,11 @@
|
|||
<li><a href="/method/messages.getEmojiGroups">messages.getEmojiGroups</a> in all other cases (including GIFs, emojis and custom emojis). </li>
|
||||
</ul>
|
||||
<p>The methods listed above must be used to fetch a categorized list of UTF-8 emojis, periodically refreshed by the client, passing the <code>hash</code> returned by the previous call. </p>
|
||||
<p>Each category is described by a <code>title</code> (i.e. "Animals", "Faces", "Flags"), is represented in the UI by a single <a href="/api/custom-emoji">custom emoji »</a> (<code>icon_emoji_id</code>). </p>
|
||||
<p>Each category is described by a <code>title</code> (i.e. "Animals", "Faces", "Flags"), is represented in the UI by a single <a href="/api/custom-emoji">custom emoji »</a> (<code>icon_emoji_id</code>). </p>
|
||||
<p>All categories should be displayed in the sticker/emoji/custom emoji/GIF search bar, located in the top section of the sticker/custom emoji/GIF selection UI, using the <code>icon_emoji_id</code>. </p>
|
||||
<p>When the user clicks on a specific emoji category, the client should display:</p>
|
||||
<ul>
|
||||
<li>All <a href="/api/premium">Premium</a>-only stickers (i.e. those with a <a href="/api/stickers#premium-animated-sticker-effects">Premium effect »</a>)/<a href="/api/premium">Premium</a>-only <a href="/api/custom-emoji">custom emojis</a> (i.e. those where the <a href="/constructor/documentAttributeCustomEmoji">documentAttributeCustomEmoji</a>.<code>free</code> flag is <strong>not</strong> set) if the <a href="/constructor/emojiGroupPremium">emojiGroupPremium</a> category is clicked OR</li>
|
||||
<li>All <a href="/api/premium">Premium</a>-only stickers (i.e. those with a <a href="/api/stickers#premium-animated-sticker-effects">Premium effect »</a>)/<a href="/api/premium">Premium</a>-only <a href="/api/custom-emoji">custom emojis</a> (i.e. those where the <a href="/constructor/documentAttributeCustomEmoji">documentAttributeCustomEmoji</a>.<code>free</code> flag is <strong>not</strong> set) if the <a href="/constructor/emojiGroupPremium">emojiGroupPremium</a> category is clicked OR</li>
|
||||
<li>All stickers/<a href="/api/custom-emoji">custom emojis</a>/emojis/GIFs matching the emojis in <code>emoticons</code> for the selected category, if an <a href="/constructor/emojiGroup">emojiGroup</a>/<a href="/constructor/emojiGroupGreeting">emojiGroupGreeting</a> category is clicked. </li>
|
||||
</ul>
|
||||
<p>Note:</p>
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
<p>The newly set <a href="/type/EmojiStatus">EmojiStatus</a> constructor will be contained in the <code>emoji_status</code> field of the <a href="/constructor/user">user</a> constructor, and other users will receive an <a href="/constructor/updateUserEmojiStatus">updateUserEmojiStatus</a>. </p>
|
||||
<p>Other logged-in clients will also receive an <a href="/constructor/updateRecentEmojiStatuses">updateRecentEmojiStatuses</a> update, indicating that the recent status emoji list has changed. </p>
|
||||
<p>Recently used emoji statuses can be fetched using <a href="/method/account.getRecentEmojiStatuses">account.getRecentEmojiStatuses</a>, and the list can be cleared using <a href="/method/account.clearRecentEmojiStatuses">account.clearRecentEmojiStatuses</a>. </p>
|
||||
<p>Note that the custom emoji selection UI should offer a list of categories to quickly filter results by a (list of) emojis, or by some other criteria, see <a href="/api/emoji-categories">here »</a> for more info. </p>
|
||||
<p>Note that the custom emoji selection UI should offer a list of categories to quickly filter results by a (list of) emojis, or by some other criteria, see <a href="/api/emoji-categories">here »</a> for more info. </p>
|
||||
<h4><a class="anchor" href="#setting-an-emoji-status-in-channels-and-supergroups" id="setting-an-emoji-status-in-channels-and-supergroups" name="setting-an-emoji-status-in-channels-and-supergroups"><i class="anchor-icon"></i></a>Setting an emoji status in channels and supergroups</h4>
|
||||
<pre><code><a href='/constructor/emojiList'>emojiList</a>#7a1e11d1 hash:<a href='/type/long'>long</a> document_id:<a href='/type/Vector%20t'>Vector</a><<a href='/type/long'>long</a>> = <a href='/type/EmojiList'>EmojiList</a>;
|
||||
|
||||
|
@ -82,7 +82,7 @@
|
|||
<a href='/method/account.getChannelRestrictedStatusEmojis'>account.getChannelRestrictedStatusEmojis</a>#35a9e0d5 hash:<a href='/type/long'>long</a> = <a href='/type/EmojiList'>EmojiList</a>;</code></pre>
|
||||
<p><strong>Only</strong> channel/supergroup custom emoji <a href="/constructor/stickerSet">stickersets</a>, i.e. <a href="/constructor/stickerSet">stickersets</a> with the <code>channel_emoji_status</code> flag set, can be used in channel/supergroup custom emoji statuses. </p>
|
||||
<p>Note, however, that some specific <a href="/api/custom-emoji">custom emojis</a> from channel/supergroup custom emoji stickersets cannot be used as channel/supergroup statuses: use <a href="/method/account.getChannelRestrictedStatusEmojis">account.getChannelRestrictedStatusEmojis</a> to fetch the full list of IDs of custom emojis that cannot be used in channel/supergroup statuses.</p>
|
||||
<p>Channels/supergroups gain the ability to change their status emoji only after reaching at least the <a href="/api/boost">boost level</a> specified in the <a href="/api/config#channel-emoji-status-level-min"><code>channel_emoji_status_level_min</code> »</a>/<a href="/api/config#group-emoji-status-level-min"><code>group_emoji_status_level_min</code> »</a> config parameters. </p>
|
||||
<p>Channels/supergroups gain the ability to change their status emoji only after reaching at least the <a href="/api/boost">boost level</a> specified in the <a href="/api/config#channel-emoji-status-level-min"><code>channel_emoji_status_level_min</code> »</a>/<a href="/api/config#group-emoji-status-level-min"><code>group_emoji_status_level_min</code> »</a> config parameters. </p>
|
||||
<h3><a class="anchor" href="#featured-emoji-status-stickersets" id="featured-emoji-status-stickersets" name="featured-emoji-status-stickersets"><i class="anchor-icon"></i></a>Featured emoji status stickersets</h3>
|
||||
<pre><code><a href='/constructor/emojiStatus'>emojiStatus</a>#929b619d document_id:<a href='/type/long'>long</a> = <a href='/type/EmojiStatus'>EmojiStatus</a>;
|
||||
|
||||
|
@ -96,7 +96,7 @@
|
|||
|
||||
<a href='/method/account.getDefaultEmojiStatuses'>account.getDefaultEmojiStatuses</a>#d6753386 hash:<a href='/type/long'>long</a> = <a href='/type/account.EmojiStatuses'>account.EmojiStatuses</a>;
|
||||
<a href='/method/account.getChannelDefaultEmojiStatuses'>account.getChannelDefaultEmojiStatuses</a>#7727a7d5 hash:<a href='/type/long'>long</a> = <a href='/type/account.EmojiStatuses'>account.EmojiStatuses</a>;</code></pre>
|
||||
<p>A set of standard statuses for users/(channels/supergroups) can be fetched by passing <a href="/constructor/inputStickerSetEmojiDefaultStatuses">inputStickerSetEmojiDefaultStatuses</a>/<a href="/constructor/inputStickerSetEmojiChannelDefaultStatuses">inputStickerSetEmojiChannelDefaultStatuses</a> to <a href="/method/messages.getStickerSet">messages.getStickerSet</a>, as specified in the <a href="/api/stickers">stickerset documentation »</a>. </p>
|
||||
<p>A set of standard statuses for users/(channels/supergroups) can be fetched by passing <a href="/constructor/inputStickerSetEmojiDefaultStatuses">inputStickerSetEmojiDefaultStatuses</a>/<a href="/constructor/inputStickerSetEmojiChannelDefaultStatuses">inputStickerSetEmojiChannelDefaultStatuses</a> to <a href="/method/messages.getStickerSet">messages.getStickerSet</a>, as specified in the <a href="/api/stickers">stickerset documentation »</a>. </p>
|
||||
<p><a href="/method/account.getDefaultEmojiStatuses">account.getDefaultEmojiStatuses</a> can also be used to get a list of featured emoji statuses, from multiple featured custom emoji stickersets.<br>
|
||||
<a href="/method/account.getChannelDefaultEmojiStatuses">account.getChannelDefaultEmojiStatuses</a> is the equivalent method for channel/supergroup emoji statuses.</p></div>
|
||||
|
||||
|
|
|
@ -61,10 +61,10 @@ Each of the assignable codepoints, once assigned by the Unicode consortium, maps
|
|||
</ul>
|
||||
<p>Since storing a 21-bit number for each letter would result in a waste of space, the Unicode consortium defines multiple encodings that allow storing a code point into a smaller <em>code unit</em>: </p>
|
||||
<h4><a class="anchor" href="#utf-8" id="utf-8" name="utf-8"><i class="anchor-icon"></i></a>UTF-8</h4>
|
||||
<p><a href="https://en.wikipedia.org/wiki/UTF-8">UTF-8 »</a> is a Unicode encoding that allows storing a 21-bit Unicode code point into <em>code units</em> as small as 8 bits.<br>
|
||||
<p><a href="https://en.wikipedia.org/wiki/UTF-8">UTF-8 »</a> is a Unicode encoding that allows storing a 21-bit Unicode code point into <em>code units</em> as small as 8 bits.<br>
|
||||
UTF-8 is used by the MTProto and Bot API when transmitting and receiving fields of type <a href="/type/string">string</a>. </p>
|
||||
<h4><a class="anchor" href="#utf-16" id="utf-16" name="utf-16"><i class="anchor-icon"></i></a>UTF-16</h4>
|
||||
<p><a href="https://en.wikipedia.org/wiki/UTF-16">UTF-16 »</a> is a Unicode encoding that allows storing a 21-bit Unicode code point into one or two 16-bit <em>code units</em>. </p>
|
||||
<p><a href="https://en.wikipedia.org/wiki/UTF-16">UTF-16 »</a> is a Unicode encoding that allows storing a 21-bit Unicode code point into one or two 16-bit <em>code units</em>. </p>
|
||||
<p>UTF-16 is used when computing the length and offsets of entities in the MTProto and bot APIs, by counting the number of UTF-16 code units (<strong>not</strong> code points).</p>
|
||||
<h4><a class="anchor" href="#computing-entity-length" id="computing-entity-length" name="computing-entity-length"><i class="anchor-icon"></i></a>Computing entity length</h4>
|
||||
<ul>
|
||||
|
@ -91,10 +91,10 @@ for byte in text {
|
|||
<ul>
|
||||
<li><a href="https://core.telegram.org/constructor/messageEntityBold"><strong>messageEntityBold</strong></a> => <code><b>bold</b></code>, <code><strong>bold</strong></code>, <code>**bold**</code></li>
|
||||
<li><a href="https://core.telegram.org/constructor/messageEntityItalic"><em>messageEntityItalic</em></a> => <code><i>italic</i></code>, <code><em>italic</em></code> <code>*italic*</code></li>
|
||||
<li><a href="https://core.telegram.org/constructor/messageEntityCode"><code>messageEntityCode</code> »</a> => <code><code>code</code></code>, <code>`code`</code></li>
|
||||
<li><a href="https://core.telegram.org/constructor/messageEntityCode"><code>messageEntityCode</code> »</a> => <code><code>code</code></code>, <code>`code`</code></li>
|
||||
<li><a href="https://core.telegram.org/constructor/messageEntityStrike"><del>messageEntityStrike</del></a> => <code><s>strike</s></code>, <code><strike>strike</strike></code>, <code><del>strike</del></code>, <code>~~strike~~</code></li>
|
||||
<li><a href="https://core.telegram.org/constructor/messageEntityUnderline"><u>messageEntityUnderline</u></a> => <code><u>underline</u></code></li>
|
||||
<li><a href="https://core.telegram.org/constructor/messageEntityPre"><code>messageEntityPre</code> »</a> => <code><pre language="c++">code</pre></code>, </li>
|
||||
<li><a href="https://core.telegram.org/constructor/messageEntityPre"><code>messageEntityPre</code> »</a> => <code><pre language="c++">code</pre></code>, </li>
|
||||
</ul>
|
||||
<pre>
|
||||
```c++
|
||||
|
@ -106,8 +106,8 @@ code
|
|||
<li><a href="/constructor/inputMessageEntityMentionName">inputMessageEntityMentionName</a> => <a href="https://t.me/botfather">Mention a user</a></li>
|
||||
<li><a href="/constructor/inputMessageEntityMentionName">messageEntityMention</a> => <a href="https://t.me/botfather">@botfather</a> (this mention is generated automatically server-side for @usernames in messages)</li>
|
||||
</ul>
|
||||
<p>Also, <a href="/constructor/messageEntityCustomEmoji">messageEntityCustomEmoji</a> entities are used for <a href="/api/custom-emoji">custom emojis »</a>.</p>
|
||||
<p>A number of other entities are also available, see the <a href="/type/MessageEntity">type page for the full list »</a>.</p></div>
|
||||
<p>Also, <a href="/constructor/messageEntityCustomEmoji">messageEntityCustomEmoji</a> entities are used for <a href="/api/custom-emoji">custom emojis »</a>.</p>
|
||||
<p>A number of other entities are also available, see the <a href="/type/MessageEntity">type page for the full list »</a>.</p></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ An error is characterized by several parameters:</p>
|
|||
<h4><a class="anchor" href="#error-type" id="error-type" name="error-type"><i class="anchor-icon"></i></a>Error Type</h4>
|
||||
<p>A string literal in the form of <code>/[A-Z_0-9]+/</code>, which summarizes the problem. For example, <code>AUTH_KEY_UNREGISTERED</code>. This is an optional parameter.</p>
|
||||
<h4><a class="anchor" href="#error-database" id="error-database" name="error-database"><i class="anchor-icon"></i></a>Error Database</h4>
|
||||
<p>A full human-readable JSON list of RPC errors that can be returned by all methods in the API can be found <a href="/file/400780400136/2/BZBIj6SH0pw.133746.json/4d0deb08c48a24e879">here »</a>, what follows is a description of its fields: </p>
|
||||
<p>A full human-readable JSON list of RPC errors that can be returned by all methods in the API can be found <a href="/file/400780400741/4/8hsnYXGWGeI.133746.json/837006fc367dabeebe">here »</a>, what follows is a description of its fields: </p>
|
||||
<ul>
|
||||
<li><code>errors</code> - All error messages and codes for each method (object).<ul>
|
||||
<li>Keys: Error codes as strings (numeric strings)</li>
|
||||
|
@ -164,7 +164,7 @@ Also note that by session we mean a logged-in session identified by an <a href="
|
|||
<h4><a class="anchor" href="#error-example" id="error-example" name="error-example"><i class="anchor-icon"></i></a>Error Example:</h4>
|
||||
<ul>
|
||||
<li>FLOOD_WAIT_X: A wait of X seconds is required (where X is a number)</li>
|
||||
<li>FLOOD_PREMIUM_WAIT_X: A wait of X seconds is required (where X is a number); the user may also purchase a <a href="/api/premium">Telegram Premium subscription</a> to remove this limitation. See <a href="/api/files">here »</a> for more info on how to handle this error. </li>
|
||||
<li>FLOOD_PREMIUM_WAIT_X: A wait of X seconds is required (where X is a number); the user may also purchase a <a href="/api/premium">Telegram Premium subscription</a> to remove this limitation. See <a href="/api/files">here »</a> for more info on how to handle this error. </li>
|
||||
</ul>
|
||||
<h3><a class="anchor" href="#500-internal" id="500-internal" name="500-internal"><i class="anchor-icon"></i></a>500 INTERNAL</h3>
|
||||
<p>An internal server error occurred while a request was being processed; for example, there was a disruption while accessing a database or file storage.</p>
|
||||
|
|
|
@ -100,9 +100,9 @@
|
|||
<li>FILE_PART_SIZE_INVALID - 512KB cannot be evenly divided by <strong>part_size</strong></li>
|
||||
<li>FILE_PART_SIZE_CHANGED - The part size is different from the size of one of the previous parts in the same file</li>
|
||||
<li>FLOOD_PREMIUM_WAIT_X: Indicates that upload speed is limited because the current account does not have a <a href="/api/premium">Premium</a> subscription, and that the query must be automatically repeated by the client after X seconds.<br>
|
||||
When receiving this error, clients should display the <a href="/api/premium">Telegram Premium subscription modal</a>, offering the user to purchase a Premium subscription to increase upload speed <a href="/api/config#upload-premium-speedup-upload">upload_premium_speedup_upload »</a> times.<br>
|
||||
When receiving this error, clients should display the <a href="/api/premium">Telegram Premium subscription modal</a>, offering the user to purchase a Premium subscription to increase upload speed <a href="/api/config#upload-premium-speedup-upload">upload_premium_speedup_upload »</a> times.<br>
|
||||
Note that this modal should only be displayed if the file that is being uploaded is currently visible to the user; if it isn't, the modal should be displayed once the loading/already loaded media becomes visible.<br>
|
||||
Also, this modal should only be shown <strong>at most</strong> every <a href="/api/config#upload-premium-speedup-notify-period">upload_premium_speedup_notify_period »</a>, to avoid bombarding the user with this popup for every file whose upload is slowed down.<br>
|
||||
Also, this modal should only be shown <strong>at most</strong> every <a href="/api/config#upload-premium-speedup-notify-period">upload_premium_speedup_notify_period »</a>, to avoid bombarding the user with this popup for every file whose upload is slowed down.<br>
|
||||
This error can only be received when the user has uploaded tens of gigabytes or more. </li>
|
||||
</ul>
|
||||
<p>While the parts are being uploaded, an <a href="https://en.wikipedia.org/wiki/MD5">MD5 hash</a> of the file contents can also be computed to be used later as the <strong>md5_checksum</strong> parameter in the <a href="/constructor/inputFile">inputFile</a> constructor (since it is checked only by the server, for encrypted secret chat files it must be generated from the encrypted file).<br>
|
||||
|
@ -132,7 +132,7 @@ After the entire file is successfully saved, the final method may be called and
|
|||
<p>Use <a href="/method/messages.editMessage">messages.editMessage</a> to edit or replace a media file sent using <a href="/method/messages.sendMedia">messages.sendMedia</a> and <a href="/method/messages.sendMultiMedia">messages.sendMultiMedia</a>. </p>
|
||||
<p>If one wishes to edit only the <code>spoiler</code>, <code>ttl_seconds</code> or <code>query</code> attributes of the media, this may be done without reuploading the entire media file, by simply passing the old media to the <code>id</code> parameter of <a href="/constructor/inputMediaPhoto">inputMediaPhoto</a>, <a href="/constructor/inputMediaDocument">inputMediaDocument</a> and updating the values of the <code>spoiler</code>/<code>ttl_seconds</code>/<code>query</code> attributes as needed. </p>
|
||||
<p>If one wishes to edit any other attribute (for example, the file name specified in <a href="/constructor/documentAttributeFilename">documentAttributeFilename</a>, any other <a href="/type/DocumentAttribute">DocumentAttribute</a> or any flag different from <code>spoiler</code>/<code>ttl_seconds</code>/<code>query</code>) <strong>a full reupload of the file is required</strong>, in order to be able to specify the new attributes in <a href="/constructor/inputMediaUploadedPhoto">inputMediaUploadedPhoto</a>/<a href="/constructor/inputMediaUploadedDocument">inputMediaUploadedDocument</a>. </p>
|
||||
<p>The only exception to this rule is when editing the <a href="/constructor/documentAttributeVideo">documentAttributeVideo</a>.<code>video_start_ts</code> attribute of video <a href="/api/stories">stories</a>, in which case <a href="/constructor/inputMediaDocument">inputMediaDocument</a> may still be used with <a href="/constructor/inputFileStoryDocument">inputFileStoryDocument</a> instead of <a href="/constructor/inputFile">inputFile</a> without reuploading the entire story video, see <a href="/api/stories#editing-stories">here »</a> for more info on the full flow.</p>
|
||||
<p>The only exception to this rule is when editing the <a href="/constructor/documentAttributeVideo">documentAttributeVideo</a>.<code>video_start_ts</code> attribute of video <a href="/api/stories">stories</a>, in which case <a href="/constructor/inputMediaDocument">inputMediaDocument</a> may still be used with <a href="/constructor/inputFileStoryDocument">inputFileStoryDocument</a> instead of <a href="/constructor/inputFile">inputFile</a> without reuploading the entire story video, see <a href="/api/stories#editing-stories">here »</a> for more info on the full flow.</p>
|
||||
<h4><a class="anchor" href="#streamed-uploads" id="streamed-uploads" name="streamed-uploads"><i class="anchor-icon"></i></a>Streamed uploads</h4>
|
||||
<p>The API also supports streamed uploads, in cases where the length of the file is not known before starting the upload. </p>
|
||||
<p>This is useful for example when converting a video, to avoid buffering the entire converted video on the filesystem, each part is uploaded immediately as soon as it is produced by the encoder. </p>
|
||||
|
@ -211,7 +211,7 @@ Use the <a href="/constructor/inputChatPhoto">inputChatPhoto</a> to reuse previo
|
|||
<p>The profile picture should be rendered by placing the sticker at the center of a square canvas, in such a way that it occupies at most 67% of it. The background of the canvas is generated from <code>background_colors</code>, which contains a vector of 1, 2, 3 or 4 RBG-24 colors used to generate a solid (1), gradient (2) or freeform gradient (3, 4) background, similar to how <a href="/api/wallpapers#fill-types">fill wallpapers</a> are generated. The rotation angle for gradient backgrounds is 0.<br>
|
||||
If animated or video stickers/custom emojis are used, the <code>video_start_ts</code> flag can contain a floating point UNIX timestamp in seconds, indicating the frame of the profile picture that should be used as static preview. </p>
|
||||
<p><a href="/method/account.getDefaultProfilePhotoEmojis">account.getDefaultProfilePhotoEmojis</a> may be used to fetch a list of suggested <a href="/api/custom-emoji">custom emojis</a> that can be used as profile pictures even by non-premium accounts; <a href="/method/account.getDefaultGroupPhotoEmojis">account.getDefaultGroupPhotoEmojis</a> is the counterpart for group profile pictures.</p>
|
||||
<p>The custom emoji selection UI should offer a list of categories to quickly filter results by a (list of) emojis, or by some other criteria, see <a href="/api/emoji-categories">here »</a> for more info. </p>
|
||||
<p>The custom emoji selection UI should offer a list of categories to quickly filter results by a (list of) emojis, or by some other criteria, see <a href="/api/emoji-categories">here »</a> for more info. </p>
|
||||
<h3><a class="anchor" href="#downloading-files" id="downloading-files" name="downloading-files"><i class="anchor-icon"></i></a>Downloading files</h3>
|
||||
<p>There are methods available to download files which have been successfully uploaded. The schema of the types and methods used is presented below:</p>
|
||||
<pre><code><a href='/constructor/upload.file'>upload.file</a>#96a18d5 type:<a href='/type/storage.FileType'>storage.FileType</a> mtime:<a href='/type/int'>int</a> bytes:<a href='/type/bytes'>bytes</a> = <a href='/type/upload.File'>upload.File</a>;
|
||||
|
@ -330,7 +330,7 @@ The data for the input parameter of the <a href="/type/InputFileLocation">InputF
|
|||
<ul>
|
||||
<li><strong>offset</strong> / (1024 * 1024) == (<strong>offset</strong> + <strong>limit</strong> - 1) / (1024 * 1024).</li>
|
||||
</ul>
|
||||
<p>When downloading multiple files in parallel from the same DC, clients should limit the parallelism to download at most <code>small_queue_max_active_operations_count</code>/<code>large_queue_max_active_operations_count</code> files in parallel when downloading files smaller/bigger than 20MB (<a href="/api/config#client-configuration">client configuration parameters »</a>). </p>
|
||||
<p>When downloading multiple files in parallel from the same DC, clients should limit the parallelism to download at most <code>small_queue_max_active_operations_count</code>/<code>large_queue_max_active_operations_count</code> files in parallel when downloading files smaller/bigger than 20MB (<a href="/api/config#client-configuration">client configuration parameters »</a>). </p>
|
||||
<p>The file download operation may return a <code>FILE_REFERENCE_EXPIRED</code> error (or another error starting with <code>FILE_REFERENCE_</code>): in this case, the <code>file_reference</code> field of the input location must be <a href="/api/file_reference">refreshed</a>.
|
||||
The file download operation may return an <a href="/constructor/upload.fileCdnRedirect">upload.fileCdnRedirect</a> constructor: in this case, <a href="/cdn">these</a> instructions must be followed for downloading CDN files.
|
||||
The file download operation may also return one of the following <a href="/api/errors#400-bad-request">data input errors</a>:</p>
|
||||
|
@ -341,9 +341,9 @@ The file download operation may also return one of the following <a href="/api/e
|
|||
<li>FILE_MIGRATE_X: The file is in the datacenter No. X</li>
|
||||
<li>FLOOD_WAIT_X: Repeat the query after X seconds</li>
|
||||
<li>FLOOD_PREMIUM_WAIT_X: Indicates that download speed is limited because the current account does not have a <a href="/api/premium">Premium</a> subscription, and that the query must be automatically repeated by the client after X seconds.<br>
|
||||
When receiving this error, clients should display the <a href="/api/premium">Telegram Premium subscription modal</a>, offering the user to purchase a Premium subscription to increase download speed <a href="/api/config#upload-premium-speedup-download">upload_premium_speedup_download »</a> times.<br>
|
||||
When receiving this error, clients should display the <a href="/api/premium">Telegram Premium subscription modal</a>, offering the user to purchase a Premium subscription to increase download speed <a href="/api/config#upload-premium-speedup-download">upload_premium_speedup_download »</a> times.<br>
|
||||
Note that this modal should only be displayed if the file that is being downloaded is currently visible to the user; if it isn't, the modal should be displayed once the loading/already loaded media becomes visible.<br>
|
||||
Also, this modal should only be shown <strong>at most</strong> every <a href="/api/config#upload-premium-speedup-notify-period">upload_premium_speedup_notify_period »</a>, to avoid bombarding the user with this popup for every file whose download is slowed down.<br>
|
||||
Also, this modal should only be shown <strong>at most</strong> every <a href="/api/config#upload-premium-speedup-notify-period">upload_premium_speedup_notify_period »</a>, to avoid bombarding the user with this popup for every file whose download is slowed down.<br>
|
||||
This error can only be received when the user has uploaded tens of gigabytes or more. </li>
|
||||
</ul>
|
||||
<h4><a class="anchor" href="#verifying-downloaded-chunks" id="verifying-downloaded-chunks" name="verifying-downloaded-chunks"><i class="anchor-icon"></i></a>Verifying downloaded chunks</h4>
|
||||
|
@ -453,7 +453,7 @@ The server also generates a trimmed and scaled down video preview for videos, GI
|
|||
<pre><code><a href='/constructor/photoStrippedSize'>photoStrippedSize</a>#e0b0bc2e type:<a href='/type/string'>string</a> bytes:<a href='/type/bytes'>bytes</a> = <a href='/type/PhotoSize'>PhotoSize</a>;</code></pre>
|
||||
<p>A <a href="/constructor/photoStrippedSize">photoStrippedSize</a> (with type <code>i</code>) is an extremely low-res thumbnail, embedded directly inside media location objects.<br>
|
||||
It should be shown to the user in chat message previews, or while still downloading the most appropriately sized <a href="/constructor/photoSize">photoSize</a> through the media DCs as <a href="#downloading-files">described above</a>. </p>
|
||||
<p>The stripped <code>bytes</code> payload should be inflated to a JPG payload as seen <a href="https://github.com/telegramdesktop/tdesktop/blob/1757dd856b84d23f83d4e562c94dde825f6eb40c/Telegram/SourceFiles/ui/image/image.cpp#L43">here »</a>.</p>
|
||||
<p>The stripped <code>bytes</code> payload should be inflated to a JPG payload as seen <a href="https://github.com/telegramdesktop/tdesktop/blob/1757dd856b84d23f83d4e562c94dde825f6eb40c/Telegram/SourceFiles/ui/image/image.cpp#L43">here »</a>.</p>
|
||||
<h4><a class="anchor" href="#vector-thumbnails" id="vector-thumbnails" name="vector-thumbnails"><i class="anchor-icon"></i></a>Vector thumbnails</h4>
|
||||
<pre><code><a href='/constructor/photoPathSize'>photoPathSize</a>#d8214d41 type:<a href='/type/string'>string</a> bytes:<a href='/type/bytes'>bytes</a> = <a href='/type/PhotoSize'>PhotoSize</a>;</code></pre>
|
||||
<p>Messages with <a href="/api/stickers#animated-stickers">animated</a>, <a href="/api/stickers#video-stickers">video</a>, <a href="/api/stickers#static-stickers">static</a> stickers can have a compressed svg (< 300 bytes) to show the outline of the sticker before fetching the actual sticker.
|
||||
|
@ -490,7 +490,7 @@ path += "z"</code></pre>
|
|||
</svg></code></pre>
|
||||
<h4><a class="anchor" href="#video-types" id="video-types" name="video-types"><i class="anchor-icon"></i></a>Video types</h4>
|
||||
<pre><code><a href='/constructor/videoSize'>videoSize</a>#de33b094 flags:<a href='/type/%23'>#</a> type:<a href='/type/string'>string</a> w:<a href='/type/int'>int</a> h:<a href='/type/int'>int</a> size:<a href='/type/int'>int</a> video_start_ts:flags.0?<a href='/type/double'>double</a> = <a href='/type/VideoSize'>VideoSize</a>;</code></pre>
|
||||
<p>A <a href="/constructor/videoSize">videoSize</a> constructor is typically used for <a href="#animated-profile-pictures">animated profile pictures</a>, video previews and <a href="/api/stickers#premium-animated-sticker-effects">premium sticker effects »</a>.</p>
|
||||
<p>A <a href="/constructor/videoSize">videoSize</a> constructor is typically used for <a href="#animated-profile-pictures">animated profile pictures</a>, video previews and <a href="/api/stickers#premium-animated-sticker-effects">premium sticker effects »</a>.</p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -512,8 +512,8 @@ path += "z"</code></pre>
|
|||
</tr>
|
||||
<tr>
|
||||
<td><code>f</code></td>
|
||||
<td><a href="/api/stickers#premium-animated-sticker-effects">Premium sticker effect »</a></td>
|
||||
<td><a href="/api/stickers#animated-stickers">TGS »</a></td>
|
||||
<td><a href="/api/stickers#premium-animated-sticker-effects">Premium sticker effect »</a></td>
|
||||
<td><a href="/api/stickers#animated-stickers">TGS »</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -140,11 +140,11 @@ These links are generated by invoking <a href="/method/chatlists.exportChatlistI
|
|||
Only channels and groups/supergroups may be specified in the <code>peers</code> array; these channels and groups must be public, or the user must have permission to manage invite links. Basic groups will automatically be <a href="/api/channel#migration">converted to supergroups</a> when invoking the method.<br>
|
||||
An optional name for the shared link may also be specified using <code>title</code>. </p>
|
||||
<p>Use <a href="/method/chatlists.getExportedInvites">chatlists.getExportedInvites</a> to list all links generated for a folder, use <a href="/method/chatlists.editExportedInvite">chatlists.editExportedInvite</a> to edit the title or list of <code>peers</code> of a specific link and <a href="/method/chatlists.deleteExportedInvite">chatlists.deleteExportedInvite</a> to revoke an exported link, preventing new users from importing it. </p>
|
||||
<p>The maximum number of per-folder invites that can be created by <a href="/api/premium">Premium</a>/non-<a href="/api/premium">Premium</a> users is specified by the <code>chatlist_invites_limit_default</code>/<code>chatlist_invites_limit_premium</code> <a href="/api/config#chatlist-invites-limit-default">client configuration parameters »</a>. </p>
|
||||
<p>The maximum number of per-folder invites that can be created by <a href="/api/premium">Premium</a>/non-<a href="/api/premium">Premium</a> users is specified by the <code>chatlist_invites_limit_default</code>/<code>chatlist_invites_limit_premium</code> <a href="/api/config#chatlist-invites-limit-default">client configuration parameters »</a>. </p>
|
||||
<p>Use <a href="/method/chatlists.checkChatlistInvite">chatlists.checkChatlistInvite</a> to obtain information about a chat folder deep link before importing it with <a href="/method/chatlists.joinChatlistInvite">chatlists.joinChatlistInvite</a>, specifying in <code>peers</code> which channels and groups to join (excluding inaccessible channels/supergroups, i.e. the user may not join a supergroup/channel where they were banned, corresponding to a <a href="/constructor/channelForbidden">channelForbidden</a> constructor).<br>
|
||||
If the user can't join any of the <code>peers</code> of a folder, the folder can't be imported.</p>
|
||||
<p>The maximum number of shareable folders that a <a href="/api/premium">Premium</a>/non-<a href="/api/premium">Premium</a> user may join is specified by the <code>chatlists_joined_limit_default</code>/<code>chatlists_joined_limit_premium</code> <a href="/api/config#chatlists-joined-limit-default">client configuration parameters »</a>. </p>
|
||||
<p>Users that import a folder should retrieve additions made to the peer list by invoking <a href="/method/chatlists.getChatlistUpdates">chatlists.getChatlistUpdates</a> at most every <code>chatlist_update_period</code> seconds (a <a href="/api/config#chatlist-update-period">client configuration parameter »</a>).<br>
|
||||
<p>The maximum number of shareable folders that a <a href="/api/premium">Premium</a>/non-<a href="/api/premium">Premium</a> user may join is specified by the <code>chatlists_joined_limit_default</code>/<code>chatlists_joined_limit_premium</code> <a href="/api/config#chatlists-joined-limit-default">client configuration parameters »</a>. </p>
|
||||
<p>Users that import a folder should retrieve additions made to the peer list by invoking <a href="/method/chatlists.getChatlistUpdates">chatlists.getChatlistUpdates</a> at most every <code>chatlist_update_period</code> seconds (a <a href="/api/config#chatlist-update-period">client configuration parameter »</a>).<br>
|
||||
If the returned <code>missing_peers</code> list is non-empty, the client should present it to the user, who may choose to join all or a subset of them (excluding inaccessible channels/supergroups), passing them to the <code>peers</code> parameter of <a href="/method/chatlists.joinChatlistUpdates">chatlists.joinChatlistUpdates</a>.<br>
|
||||
If after excluding inaccessible peers and peers deselected by the user the <code>peers</code> list is empty, invoke <a href="/method/chatlists.hideChatlistUpdates">chatlists.hideChatlistUpdates</a> instead of <a href="/method/chatlists.joinChatlistUpdates">chatlists.joinChatlistUpdates</a>.</p>
|
||||
<p>When removing an imported folder, the list of included peers should be presented to the user prior to deletion, with the peers listed in <a href="/method/chatlists.getLeaveChatlistSuggestions">chatlists.getLeaveChatlistSuggestions</a> already pre-marked for deletion: the user may then choose to delete or keep some or all of the groups and channels of the folder when invoking <a href="/method/chatlists.leaveChatlist">chatlists.leaveChatlist</a> to delete the folder, specifying in <code>peers</code> the list of channels and groups from the folder that should also be removed.</p>
|
||||
|
|
|
@ -106,7 +106,7 @@ All topics except for the "General" topic can be deleted by invoking <a href="/m
|
|||
<p>Note that <a href="/api/premium">Telegram Premium</a> users can pass any custom emoji to <code>icon_emoji_id</code>, while other users can only use the custom emojis contained in the <a href="/constructor/inputStickerSetEmojiDefaultTopicIcons">inputStickerSetEmojiDefaultTopicIcons</a> emoji pack.<br>
|
||||
If the default chat icon is used, its color cannot be modified after creating the topic. </p>
|
||||
<p>Topics may be pinned or unpinned using <a href="/method/channels.updatePinnedForumTopic">channels.updatePinnedForumTopic</a>; use <a href="/method/channels.reorderPinnedForumTopics">channels.reorderPinnedForumTopics</a> to reorder pinned topics.<br>
|
||||
You can pin at most <code>topics_pinned_limit</code> topics per forum, as specified by the <a href="/api/config#client-configuration">client configuration parameters »</a>.</p>
|
||||
You can pin at most <code>topics_pinned_limit</code> topics per forum, as specified by the <a href="/api/config#client-configuration">client configuration parameters »</a>.</p>
|
||||
<p>Users may also choose to display messages from all topics as if they were sent to a normal group, using a "View as messages" setting in the local client.<br>
|
||||
This setting only affects the current account, and is synced to other logged in sessions using the <a href="/method/channels.toggleViewForumAsMessages">channels.toggleViewForumAsMessages</a> method; invoking this method will update the value of the <code>view_forum_as_messages</code> flag of <a href="/constructor/channelFull">channelFull</a> or <a href="/constructor/dialog">dialog</a> and emit an <a href="/constructor/updateChannelViewForumAsMessages">updateChannelViewForumAsMessages</a>.</p></div>
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
<div id="dev_page_content"><!-- scroll_nav -->
|
||||
|
||||
<p>Telegram users can make it easy for others to contact them or find their public groups and channels via <a href="https://telegram.org/faq#usernames-and-t-me">usernames</a>: clients can also assign multiple <a href="https://fragment.com">Fragment »</a> <strong>collectible usernames</strong> to accounts, supergroups and channels they own; <a href="https://fragment.com">Fragment »</a> also allows purchasing phone number collectibles that can be used to register Telegram accounts. </p>
|
||||
<p>Telegram users can make it easy for others to contact them or find their public groups and channels via <a href="https://telegram.org/faq#usernames-and-t-me">usernames</a>: clients can also assign multiple <a href="https://fragment.com">Fragment »</a> <strong>collectible usernames</strong> to accounts, supergroups and channels they own; <a href="https://fragment.com">Fragment »</a> also allows purchasing phone number collectibles that can be used to register Telegram accounts. </p>
|
||||
<h3><a class="anchor" href="#collectible-usernames" id="collectible-usernames" name="collectible-usernames"><i class="anchor-icon"></i></a>Collectible usernames</h3>
|
||||
<p>Schema:</p>
|
||||
<pre><code><a href='/constructor/username'>username</a>#b4073647 flags:<a href='/type/%23'>#</a> editable:flags.0?<a href='/constructor/true'>true</a> active:flags.1?<a href='/constructor/true'>true</a> username:<a href='/type/string'>string</a> = <a href='/type/Username'>Username</a>;
|
||||
|
@ -66,8 +66,8 @@
|
|||
<a href='/method/channels.toggleUsername'>channels.toggleUsername</a>#50f24105 channel:<a href='/type/InputChannel'>InputChannel</a> username:<a href='/type/string'>string</a> active:<a href='/type/Bool'>Bool</a> = <a href='/type/Bool'>Bool</a>;
|
||||
<a href='/method/channels.reorderUsernames'>channels.reorderUsernames</a>#b45ced1d channel:<a href='/type/InputChannel'>InputChannel</a> order:<a href='/type/Vector%20t'>Vector</a><<a href='/type/string'>string</a>> = <a href='/type/Bool'>Bool</a>;
|
||||
<a href='/method/channels.deactivateAllUsernames'>channels.deactivateAllUsernames</a>#0a245dd3 channel:<a href='/type/InputChannel'>InputChannel</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>Collectible usernames work just like basic <a href="https://t.me/username">@usernames</a>, they appear in Global Search results and have <a href="/api/links#public-username-links">deep links »</a>, just like basic usernames. </p>
|
||||
<p>The ownership of collectible usernames is secured by TON, a fast and scalable blockchain network. They can be bought and sold through the <a href="https://fragment.com">Fragment platform »</a>, giving a simple and secure way to acquire and exchange valuable Telegram domains. </p>
|
||||
<p>Collectible usernames work just like basic <a href="https://t.me/username">@usernames</a>, they appear in Global Search results and have <a href="/api/links#public-username-links">deep links »</a>, just like basic usernames. </p>
|
||||
<p>The ownership of collectible usernames is secured by TON, a fast and scalable blockchain network. They can be bought and sold through the <a href="https://fragment.com">Fragment platform »</a>, giving a simple and secure way to acquire and exchange valuable Telegram domains. </p>
|
||||
<p>On the Fragment platform, clients may associate or dissociate purchased collectible usernames either to their Telegram account, or to a bot/channel/supergroup they own. </p>
|
||||
<p>If any collectible username is associated to an account, channel or supergroup, <a href="/constructor/user">user</a>.<code>username</code> and <a href="/constructor/channel">channel</a>.<code>username</code> won't be set, and <a href="/constructor/user">user</a>.<code>usernames</code> and <a href="/constructor/channel">channel</a>.<code>usernames</code> will be set, instead: these fields contain an array of <a href="/constructor/username">username</a> constructors, which indicate whether a certain username is a basic username (<code>editable</code> is set) or a collectible username (<code>editable</code> is not set); and whether a collectible username is <code>active</code> or not.<br>
|
||||
The first username in the <code>usernames</code> vector must be shown in-UI as the main username.</p>
|
||||
|
@ -76,7 +76,7 @@ Note that you can't mark as inactive the basic (non-collectible) username, if an
|
|||
<p><a href="/method/channels.deactivateAllUsernames">channels.deactivateAllUsernames</a> may also be used to mark as inactive all collectible usernames associated to a certain supergroup or channel: useful for example when making a group or channel private, by first invoking <a href="/method/channels.updateUsername">channels.updateUsername</a> with an empty username to remove the editable username (if present), and then invoking this method to remove all associated collectible usernames. </p>
|
||||
<p>Use <a href="/method/account.reorderUsernames">account.reorderUsernames</a>/<a href="/method/bots.reorderUsernames">bots.reorderUsernames</a>/<a href="/method/channels.reorderUsernames">channels.reorderUsernames</a> to change the order of the usernames associated to an account, channel or supergroup: all currently active usernames must be specified. </p>
|
||||
<h3><a class="anchor" href="#collectible-phone-numbers" id="collectible-phone-numbers" name="collectible-phone-numbers"><i class="anchor-icon"></i></a>Collectible phone numbers</h3>
|
||||
<p><a href="https://fragment.com">Fragment</a> collectible phone numbers can only be used to create Telegram accounts, using the usual <a href="/api/auth">sign up/login flow »</a>.</p>
|
||||
<p><a href="https://fragment.com">Fragment</a> collectible phone numbers can only be used to create Telegram accounts, using the usual <a href="/api/auth">sign up/login flow »</a>.</p>
|
||||
<h3><a class="anchor" href="#fetching-info-about-fragment-collectibles" id="fetching-info-about-fragment-collectibles" name="fetching-info-about-fragment-collectibles"><i class="anchor-icon"></i></a>Fetching info about Fragment collectibles</h3>
|
||||
<p>Schema:</p>
|
||||
<pre><code><a href='/constructor/inputCollectibleUsername'>inputCollectibleUsername</a>#e39460a9 username:<a href='/type/string'>string</a> = <a href='/type/InputCollectible'>InputCollectible</a>;
|
||||
|
|
|
@ -55,11 +55,11 @@
|
|||
|
||||
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#7852834e flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> invert_media:flags.16?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> media:<a href='/type/InputMedia'>InputMedia</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a><<a href='/type/MessageEntity'>MessageEntity</a>> schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> quick_reply_shortcut:flags.17?<a href='/type/InputQuickReplyShortcut'>InputQuickReplyShortcut</a> effect:flags.18?<a href='/type/long'>long</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||
<p>On Telegram, GIFs are actually MPEG4 videos without sound; if the user tries to upload an actual GIF file, it will be automatically converted to an MPEG4 file by the server. </p>
|
||||
<p>To upload a GIF, follow the usual <a href="/api/files#uploading-files">file upload procedure »</a>, specifying the <a href="/constructor/documentAttributeAnimated">documentAttributeAnimated</a>. </p>
|
||||
<p>Uploading a GIF will automatically add it to the user's <a href="#saved-gifs">saved GIFs list »</a>. </p>
|
||||
<p>To upload a GIF, follow the usual <a href="/api/files#uploading-files">file upload procedure »</a>, specifying the <a href="/constructor/documentAttributeAnimated">documentAttributeAnimated</a>. </p>
|
||||
<p>Uploading a GIF will automatically add it to the user's <a href="#saved-gifs">saved GIFs list »</a>. </p>
|
||||
<h4><a class="anchor" href="#uploading-by-hash" id="uploading-by-hash" name="uploading-by-hash"><i class="anchor-icon"></i></a>Uploading by hash</h4>
|
||||
<p>For some types of documents like GIFs, <a href="/method/messages.getDocumentByHash">messages.getDocumentByHash</a> can be used to search for the document on Telegram servers, instead of uploading it from scratch.<br>
|
||||
See <a href="/api/files#uploading-by-hash">here »</a> for the full procedure. </p>
|
||||
See <a href="/api/files#uploading-by-hash">here »</a> for the full procedure. </p>
|
||||
<h3><a class="anchor" href="#saved-gifs" id="saved-gifs" name="saved-gifs"><i class="anchor-icon"></i></a>Saved GIFs</h3>
|
||||
<pre><code><a href='/constructor/updateSavedGifs'>updateSavedGifs</a>#9375341e = <a href='/type/Update'>Update</a>;
|
||||
|
||||
|
@ -73,17 +73,17 @@ See <a href="/api/files#uploading-by-hash">here »</a> for the full procedure.
|
|||
<p>GIFs received in a chat may be added to (or removed from) the saved gifs list using <a href="/method/messages.saveGif">messages.saveGif</a>. </p>
|
||||
<p>Modifying the saved gifs list with the method indicated above will emit an <a href="/constructor/updateSavedGifs">updateSavedGifs</a> update to other currently logged in sessions, which should trigger a call to <a href="/method/messages.getSavedGifs">messages.getSavedGifs</a>, to refresh the locally cached list. </p>
|
||||
<p><a href="/method/messages.getSavedGifs">messages.getSavedGifs</a> should also be called when first logging in. </p>
|
||||
<p><a href="#uploading-gifs">Uploading »</a> a GIF will automatically add it to the saved gifs list. </p>
|
||||
<p>The saved GIFs list should be displayed in the <a href="#searching-gifs">GIF selection UI »</a>. </p>
|
||||
<p><a href="#uploading-gifs">Uploading »</a> a GIF will automatically add it to the saved gifs list. </p>
|
||||
<p>The saved GIFs list should be displayed in the <a href="#searching-gifs">GIF selection UI »</a>. </p>
|
||||
<p>The maximum number of GIFs that may be added to the saved GIF list is specified by <a href="/api/config#saved-gifs-limit-default">appConfig.saved_gifs_limit_default</a>/<a href="/api/config#saved-gifs-limit-premium">appConfig.saved_gifs_limit_premium</a> for non-<a href="/api/premium">Premium</a>/<a href="/api/premium">Premium</a> users. </p>
|
||||
<p>Trying to add one more GIF after the non-Premium limit is reached should open the Premium subscription modal.<br>
|
||||
If the user adds one more GIF even after the non-Premium/Premium limit is reached, the server will automatically delete the oldest GIF, and the client should display a toast, notifying the user of this deletion. </p>
|
||||
<h3><a class="anchor" href="#searching-gifs" id="searching-gifs" name="searching-gifs"><i class="anchor-icon"></i></a>Searching GIFs</h3>
|
||||
<pre><code><a href='/constructor/config'>config</a>#cc1a241e flags:<a href='/type/%23'>#</a> default_p2p_contacts:flags.3?<a href='/constructor/true'>true</a> preload_featured_stickers:flags.4?<a href='/constructor/true'>true</a> revoke_pm_inbox:flags.6?<a href='/constructor/true'>true</a> blocked_mode:flags.8?<a href='/constructor/true'>true</a> force_try_ipv6:flags.14?<a href='/constructor/true'>true</a> date:<a href='/type/int'>int</a> expires:<a href='/type/int'>int</a> test_mode:<a href='/type/Bool'>Bool</a> this_dc:<a href='/type/int'>int</a> dc_options:<a href='/type/Vector%20t'>Vector</a><<a href='/type/DcOption'>DcOption</a>> dc_txt_domain_name:<a href='/type/string'>string</a> chat_size_max:<a href='/type/int'>int</a> megagroup_size_max:<a href='/type/int'>int</a> forwarded_count_max:<a href='/type/int'>int</a> online_update_period_ms:<a href='/type/int'>int</a> offline_blur_timeout_ms:<a href='/type/int'>int</a> offline_idle_timeout_ms:<a href='/type/int'>int</a> online_cloud_timeout_ms:<a href='/type/int'>int</a> notify_cloud_delay_ms:<a href='/type/int'>int</a> notify_default_delay_ms:<a href='/type/int'>int</a> push_chat_period_ms:<a href='/type/int'>int</a> push_chat_limit:<a href='/type/int'>int</a> edit_time_limit:<a href='/type/int'>int</a> revoke_time_limit:<a href='/type/int'>int</a> revoke_pm_time_limit:<a href='/type/int'>int</a> rating_e_decay:<a href='/type/int'>int</a> stickers_recent_limit:<a href='/type/int'>int</a> channels_read_media_period:<a href='/type/int'>int</a> tmp_sessions:flags.0?<a href='/type/int'>int</a> call_receive_timeout_ms:<a href='/type/int'>int</a> call_ring_timeout_ms:<a href='/type/int'>int</a> call_connect_timeout_ms:<a href='/type/int'>int</a> call_packet_timeout_ms:<a href='/type/int'>int</a> me_url_prefix:<a href='/type/string'>string</a> autoupdate_url_prefix:flags.7?<a href='/type/string'>string</a> gif_search_username:flags.9?<a href='/type/string'>string</a> venue_search_username:flags.10?<a href='/type/string'>string</a> img_search_username:flags.11?<a href='/type/string'>string</a> static_maps_provider:flags.12?<a href='/type/string'>string</a> caption_length_max:<a href='/type/int'>int</a> message_length_max:<a href='/type/int'>int</a> webfile_dc_id:<a href='/type/int'>int</a> suggested_lang_code:flags.2?<a href='/type/string'>string</a> lang_pack_version:flags.2?<a href='/type/int'>int</a> base_lang_pack_version:flags.2?<a href='/type/int'>int</a> reactions_default:flags.15?<a href='/type/Reaction'>Reaction</a> autologin_token:flags.16?<a href='/type/string'>string</a> = <a href='/type/Config'>Config</a>;</code></pre>
|
||||
<p>Clients should implement a GIF selection/search UI that is almost identical to the <a href="/api/stickers">sticker</a> search UI, featuring a search bar (with a list of <a href="/api/emoji-categories">emoji categories</a>) followed (initially) by the list of <a href="#saved-gifs">saved GIFs</a> that may be selected and sent by the user to the current chat. </p>
|
||||
<p>Entering text in the search bar should replace the saved GIFs list with the results of the GIF search, which must be implemented as an <a href="/api/bots/inline">inline query »</a> to the bot specified in <a href="/constructor/config">config</a>.<code>gif_search_username</code>, with <code>peer</code>=<a href="/constructor/inputPeerEmpty">inputPeerEmpty</a> and <code>query</code> set equal to the input of the user.<br>
|
||||
<p>Entering text in the search bar should replace the saved GIFs list with the results of the GIF search, which must be implemented as an <a href="/api/bots/inline">inline query »</a> to the bot specified in <a href="/constructor/config">config</a>.<code>gif_search_username</code>, with <code>peer</code>=<a href="/constructor/inputPeerEmpty">inputPeerEmpty</a> and <code>query</code> set equal to the input of the user.<br>
|
||||
Again, the GIF search UI should be almost identical to the <a href="/api/stickers">sticker</a> search UI: even if inline bot queries are used, the usual inline query UI should <strong>not</strong> be used for the GIF search UI. </p>
|
||||
<p>As mentioned above, the GIF search bar should also offer a list of categories to quickly filter results by a (list of) emojis, or by some other criteria, see <a href="/api/emoji-categories">here »</a> for more info. </p>
|
||||
<p>As mentioned above, the GIF search bar should also offer a list of categories to quickly filter results by a (list of) emojis, or by some other criteria, see <a href="/api/emoji-categories">here »</a> for more info. </p>
|
||||
<p>When an emoji category is selected, the search input bar should be disabled, and a search should be made, passing to <code>query</code> the first emoji of the selected emoji group.</p></div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
|
||||
<a href='/method/payments.checkGiftCode'>payments.checkGiftCode</a>#8e51b4c1 slug:<a href='/type/string'>string</a> = <a href='/type/payments.CheckedGiftCode'>payments.CheckedGiftCode</a>;
|
||||
<a href='/method/payments.applyGiftCode'>payments.applyGiftCode</a>#f6e26854 slug:<a href='/type/string'>string</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||
<p>First of all, invoke <a href="/method/payments.getPremiumGiftCodeOptions">payments.getPremiumGiftCodeOptions</a> to obtain a list of <a href="/constructor/premiumGiftCodeOption">premiumGiftCodeOption</a> constructors, containing a list of giveaway options that may be chosen by the admin, indicating the number and duration of the of <a href="/api/premium">Telegram Premium</a> subscriptions that will be gifted in the giveaway, along with their price (<code>amount</code>) in the specified <code>currency</code> (see the <a href="/constructor/premiumGiftCodeOption">constructor page »</a> for more info on these fields). </p>
|
||||
<p>First of all, invoke <a href="/method/payments.getPremiumGiftCodeOptions">payments.getPremiumGiftCodeOptions</a> to obtain a list of <a href="/constructor/premiumGiftCodeOption">premiumGiftCodeOption</a> constructors, containing a list of giveaway options that may be chosen by the admin, indicating the number and duration of the of <a href="/api/premium">Telegram Premium</a> subscriptions that will be gifted in the giveaway, along with their price (<code>amount</code>) in the specified <code>currency</code> (see the <a href="/constructor/premiumGiftCodeOption">constructor page »</a> for more info on these fields). </p>
|
||||
<p>Once the admin has chosen a specific gift code option, invoke <a href="/method/payments.getPaymentForm">payments.getPaymentForm</a>, passing an <a href="/constructor/inputInvoicePremiumGiftCode">inputInvoicePremiumGiftCode</a>, with the chosen <a href="/constructor/premiumGiftCodeOption">premiumGiftCodeOption</a> in <code>option</code> and a <code>purpose</code> containing either:</p>
|
||||
<ul>
|
||||
<li><a href="/constructor/inputStorePaymentPremiumGiveaway">inputStorePaymentPremiumGiveaway</a> to create a giveaway, where Telegram will randomly select <code>option.users</code> subscribers to the channel/supergroup specified in <code>purpose.boost_peer</code> (only new subscribers starting from the giveaway creation date if the <code>purpose.only_new_subscribers</code> field is set).<br>
|
||||
|
@ -95,12 +95,12 @@ The set of users that can participate to the giveaway can be restricted by passi
|
|||
The end date of the giveaway must be specified in <code>until_date</code>, and it must be at most <a href="/api/config#giveaway-period-max">giveaway_period_max</a> seconds in the future; at that date, Telegram will randomly choose <code>option.users</code> subscribers according to the conditions specified above, and send them a Telegram Premium giftcode as a <a href="/constructor/messageActionGiftCode">messageActionGiftCode</a> constructor, that should be used client-side to generate a <a href="/api/links#premium-giftcode-links">giftcode link</a>.<br>
|
||||
The channel/supergroup specified in <code>boost_peer</code> will receive <a href="/api/config#giveaway-boosts-per-premium">giveaway_boosts_per_premium</a> <a href="/api/boost">boosts</a> from each user, that cannot be reassigned to another channel/supergroup for the duration of the gifted subscription. </li>
|
||||
<li>or <a href="/constructor/inputStorePaymentPremiumGiftCode">inputStorePaymentPremiumGiftCode</a>, to gift <a href="/api/premium">Telegram Premium</a> subscriptions only to some specific subscribers (<code>purpose.users</code>, max <a href="/api/config#giveaway-add-peers-max">giveaway_add_peers_max</a> users) of the channel/supergroup specified in <code>purpose.boost_peer</code>, which will receive <a href="/api/config#giveaway-boosts-per-premium">giveaway_boosts_per_premium</a> <a href="/api/boost">boosts</a> from each user, that cannot be reassigned to another channel/supergroup for the duration of the gifted subscription.<br>
|
||||
Users may also use this method to simply gift subscriptions to contacts by <strong>not</strong> setting the <code>boost_peer</code> field: in this case, gifting a <a href="/api/premium">Telegram Premium</a> subscription to another user will create <a href="/api/config#boosts-per-sent-gift">boosts_per_sent_gift</a> <a href="/api/boost">boost slots »</a> for us, and one boost slot for the destination user. </li>
|
||||
Users may also use this method to simply gift subscriptions to contacts by <strong>not</strong> setting the <code>boost_peer</code> field: in this case, gifting a <a href="/api/premium">Telegram Premium</a> subscription to another user will create <a href="/api/config#boosts-per-sent-gift">boosts_per_sent_gift</a> <a href="/api/boost">boost slots »</a> for us, and one boost slot for the destination user. </li>
|
||||
</ul>
|
||||
<p>Then, follow the <a href="/api/payments#22-getting-invoice-info-about-the-product">invoice payment flow as described in the payments documentation »</a>. </p>
|
||||
<p>Then, follow the <a href="/api/payments#22-getting-invoice-info-about-the-product">invoice payment flow as described in the payments documentation »</a>. </p>
|
||||
<p>More alternative payment flows are also available:</p>
|
||||
<ul>
|
||||
<li>The Premium Bot flow, by contacting <a href="/api/config#premium-bot-username">premium_bot_username</a>, and following the inline keyboard payment flow for giveaways (the final keyboard with the prices will contain buttons with <a href="/api/links#invoice-links">invoice deep links »</a> that should be used to make the payment).</li>
|
||||
<li>The Premium Bot flow, by contacting <a href="/api/config#premium-bot-username">premium_bot_username</a>, and following the inline keyboard payment flow for giveaways (the final keyboard with the prices will contain buttons with <a href="/api/links#invoice-links">invoice deep links »</a> that should be used to make the payment).</li>
|
||||
<li>Payment via <a href="https://fragment.com">Fragment</a>, which also allows making larger purchases.</li>
|
||||
<li>The store-based subscription flow based on <a href="/method/payments.assignAppStoreTransaction">payments.assignAppStoreTransaction</a>/<a href="/method/payments.assignPlayMarketTransaction">payments.assignPlayMarketTransaction</a>, currently not available to third-party apps. </li>
|
||||
</ul>
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
|
||||
<a href='/method/channels.checkUsername'>channels.checkUsername</a>#10e6bd2c channel:<a href='/type/InputChannel'>InputChannel</a> username:<a href='/type/string'>string</a> = <a href='/type/Bool'>Bool</a>;
|
||||
<a href='/method/channels.updateUsername'>channels.updateUsername</a>#3514b3de channel:<a href='/type/InputChannel'>InputChannel</a> username:<a href='/type/string'>string</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>Only <a href="/api/channel">supergroups and channels</a> may have a public usernames: <a href="/api/channel">normal groups</a> must be migrated to a <a href="/api/channel">supergroup</a> before they can be assigned a username, see the <a href="/api/channel#migration">migration docs »</a> for more info. </p>
|
||||
<p>Only <a href="/api/channel">supergroups and channels</a> may have a public usernames: <a href="/api/channel">normal groups</a> must be migrated to a <a href="/api/channel">supergroup</a> before they can be assigned a username, see the <a href="/api/channel#migration">migration docs »</a> for more info. </p>
|
||||
<p><a href="/method/channels.updateUsername">channels.updateUsername</a> can be used to directly assign or change the public username of a supergroup or channel.<br>
|
||||
You can use <a href="/method/channels.updateUsername">channels.checkUsername</a> before assigning the username to make sure that the specified username is valid and available. </p>
|
||||
<p><a href="/method/channels.joinChannel">channels.joinChannel</a> can be used to join a supergroup or channel using peer information obtained using <a href="/method/contacts.resolveUsername">contacts.resolveUsername</a>.</p>
|
||||
|
@ -98,7 +98,7 @@ You can use <a href="/method/channels.updateUsername">channels.checkUsername</a>
|
|||
|
||||
<a href='/method/messages.checkChatInvite'>messages.checkChatInvite</a>#3eadb1bb hash:<a href='/type/string'>string</a> = <a href='/type/ChatInvite'>ChatInvite</a>;
|
||||
<a href='/method/messages.importChatInvite'>messages.importChatInvite</a>#6c50051c hash:<a href='/type/string'>string</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||
<p>Private invite links can optionally have an expiration date, a usage limit, and can even be set to only allow users into the channel, supergroup or group upon explicit approval of an admin: see <a href="#join-requests">join requests »</a> for more info.</p>
|
||||
<p>Private invite links can optionally have an expiration date, a usage limit, and can even be set to only allow users into the channel, supergroup or group upon explicit approval of an admin: see <a href="#join-requests">join requests »</a> for more info.</p>
|
||||
<p>Invite links match the following regex: <code>@(?:t|telegram)\.(?:me|dog)/(joinchat/|\+)?([\w-]+)@i</code>.<br>
|
||||
The first matching group can be passed to the <code>hash</code> parameter of <a href="/method/messages.checkChatInvite">messages.checkChatInvite</a> to get info about the chat, and <a href="/method/messages.importChatInvite">messages.importChatInvite</a> to join the chat.<br>
|
||||
<a href="/method/messages.checkChatInvite">messages.checkChatInvite</a> may return <a href="/constructor/chatInvitePeek">chatInvitePeek</a> only for <a href="/api/channel">supergroups and channels</a>, in which case the user may directly fetch chat messages using <a href="/api/updates">updates</a>, <a href="/method/messages.getHistory">messages.getHistory</a> and <a href="/method/channels.getMessages">channels.getMessages</a> until the time indicated by the <code>expires</code> unixtime field.</p>
|
||||
|
@ -142,7 +142,7 @@ Use <a href="/method/messages.deleteExportedChatInvite">messages.deleteExportedC
|
|||
<p>Bot administrators will receive a <a href="/constructor/updateBotChatInviteRequester">updateBotChatInviteRequester</a> update for each separate join request.<br>
|
||||
User administrators will receive an <a href="/constructor/updatePendingJoinRequests">updatePendingJoinRequests</a>, and should invoke <a href="/method/messages.getChatInviteImporters">messages.getChatInviteImporters</a> with the <code>requested</code> flag set to obtain a list of users waiting to be admitted into the group. </p>
|
||||
<p>Administrators can then use <a href="/method/messages.hideChatJoinRequest">messages.hideChatJoinRequest</a> to approve or dismiss a join request, and <a href="/method/messages.hideAllChatJoinRequests">messages.hideAllChatJoinRequests</a> to approve or dismiss in bulk multiple join requests. </p>
|
||||
<p>Administrators can also choose to send a message to the user before admitting them into the group: in this case, graphical clients <em>on the user side</em> should display a message on the dialog bar of the chat with the admin, indicating that the chat was initiated by the admin of a chat/channel they have recently requested to join, see the <a href="/api/action-bar#an-admin-from-a-recent-join-request-is-contacting-you">action bar documentation »</a> for more info. </p>
|
||||
<p>Administrators can also choose to send a message to the user before admitting them into the group: in this case, graphical clients <em>on the user side</em> should display a message on the dialog bar of the chat with the admin, indicating that the chat was initiated by the admin of a chat/channel they have recently requested to join, see the <a href="/api/action-bar#an-admin-from-a-recent-join-request-is-contacting-you">action bar documentation »</a> for more info. </p>
|
||||
<h3><a class="anchor" href="#direct-invites" id="direct-invites" name="direct-invites"><i class="anchor-icon"></i></a>Direct invites</h3>
|
||||
<pre><code><a href='/constructor/missingInvitee'>missingInvitee</a>#628c9224 flags:<a href='/type/%23'>#</a> premium_would_allow_invite:flags.0?<a href='/constructor/true'>true</a> premium_required_for_pm:flags.1?<a href='/constructor/true'>true</a> user_id:<a href='/type/long'>long</a> = <a href='/type/MissingInvitee'>MissingInvitee</a>;
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
<li>AND is a valid username</li>
|
||||
</ul>
|
||||
<p>...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>
|
||||
<p>Everywhere where link parameters contain a user, chat, channel or supergroup ID, it will be in MTProto format, see <a href="/api/bots/ids">here »</a> for info on how to convert it to bot API format. </p>
|
||||
<p>Everywhere where link parameters contain a user, chat, channel or supergroup ID, it will be in MTProto format, see <a href="/api/bots/ids">here »</a> for info on how to convert it to bot API format. </p>
|
||||
<h3><a class="anchor" href="#ton-sites" id="ton-sites" name="ton-sites"><i class="anchor-icon"></i></a>TON Sites</h3>
|
||||
<p>Used to open <a href="https://blog.ton.org/ton-sites">TON Sites</a> using the in-app <a href="https://telegram.org/blog/w3-browser-mini-app-store#telegram-browser">Telegram Browser</a>. </p>
|
||||
<p>Syntax:</p>
|
||||
|
@ -105,13 +105,13 @@
|
|||
<li>Replace all <code>.</code> characters with <code>-d</code></li>
|
||||
<li>Replace <code>-</code> characters with <code>-h</code> (except for the <code>-</code>s generated by the first replace)</li>
|
||||
<li>Append a <code>.</code></li>
|
||||
<li>Append the domain name specified in the <a href="/api/config#ton-proxy-address">ton_proxy_address client configuration parameter »</a></li>
|
||||
<li>Append the domain name specified in the <a href="/api/config#ton-proxy-address">ton_proxy_address client configuration parameter »</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<p>The resulting URL should only be opened using the in-app <a href="https://telegram.org/blog/w3-browser-mini-app-store#telegram-browser">Telegram Browser</a> (i.e. no option should be given to open such links using third party browsers). </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>
|
||||
<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>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/<username>?text=<draft_text>&profile</code></pre>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
|
@ -129,7 +129,7 @@
|
|||
<tr>
|
||||
<td><code>username</code></td>
|
||||
<td style="text-align: center;">Required</td>
|
||||
<td>Username to <a href="/api/invites#public-usernames">check or import »</a></td>
|
||||
<td>Username to <a href="/api/invites#public-usernames">check or import »</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>draft_text</code></td>
|
||||
|
@ -203,7 +203,7 @@ These links can be generated even for profiles that don't have a username, and t
|
|||
</table>
|
||||
<p>Note that <a href="#message-links">chat invite links</a> have the same syntax, but <code><phone_number></code> won't be a valid phone number. </p>
|
||||
<h3><a class="anchor" href="#chat-invite-links" id="chat-invite-links" name="chat-invite-links"><i class="anchor-icon"></i></a>Chat invite links</h3>
|
||||
<p>Used to invite users to private groups and channels, see <a href="/api/invites#invite-links">here for more info on how to generate such links »</a>. </p>
|
||||
<p>Used to invite users to private groups and channels, see <a href="/api/invites#invite-links">here for more info on how to generate such links »</a>. </p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/+<hash></code></pre>
|
||||
<p><code>t.me</code> syntax (legacy):</p>
|
||||
|
@ -223,12 +223,12 @@ These links can be generated even for profiles that don't have a username, and t
|
|||
<tr>
|
||||
<td><code>hash</code></td>
|
||||
<td style="text-align: center;">Required</td>
|
||||
<td>Invite hash to <a href="/api/invites#invite-links">check or import »</a></td>
|
||||
<td>Invite hash to <a href="/api/invites#invite-links">check or import »</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#chat-folder-links" id="chat-folder-links" name="chat-folder-links"><i class="anchor-icon"></i></a>Chat folder links</h3>
|
||||
<p>Used to invite users to private groups and channels, see <a href="/api/folders#shared-folders">here for more info on how to generate such links »</a>. </p>
|
||||
<p>Used to invite users to private groups and channels, see <a href="/api/folders#shared-folders">here for more info on how to generate such links »</a>. </p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/addlist/<slug></code></pre>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
|
@ -246,7 +246,7 @@ These links can be generated even for profiles that don't have a username, and t
|
|||
<tr>
|
||||
<td><code>slug</code></td>
|
||||
<td style="text-align: center;">Required</td>
|
||||
<td>Invite slug to <a href="/api/folders#shared-folders">check or import »</a></td>
|
||||
<td>Invite slug to <a href="/api/folders#shared-folders">check or import »</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -351,9 +351,9 @@ These links should be handled as follows:</p>
|
|||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#business-chat-links" id="business-chat-links" name="business-chat-links"><i class="anchor-icon"></i></a>Business chat links</h3>
|
||||
<p><a href="/api/business#business-chat-links">Business chat deep links »</a> allow business owners to share pre-made links to their <a href="/api/business">Telegram Business</a> account, optionally filling out the message input field with a pre-prepared message (with support for <a href="/api/entities">styled text entities »</a>). </p>
|
||||
<p><a href="/api/business#business-chat-links">Business chat deep links »</a> allow business owners to share pre-made links to their <a href="/api/business">Telegram Business</a> account, optionally filling out the message input field with a pre-prepared message (with support for <a href="/api/entities">styled text entities »</a>). </p>
|
||||
<p>There is no additional limit on the prepared message length (because the message text is <em>not</em> present in the URL's query string, but rather it's fetched from the server using the link slug); each created business chat deep link also has a view counter. </p>
|
||||
<p>See <a href="/api/business#business-chat-links">here »</a> for more info on how to create, edit, resolve and get view information about business chat links.</p>
|
||||
<p>See <a href="/api/business#business-chat-links">here »</a> for more info on how to create, edit, resolve and get view information about business chat links.</p>
|
||||
<p>These links should be handled as follows:</p>
|
||||
<ul>
|
||||
<li>Invoke <a href="/method/account.resolveBusinessChatLink">account.resolveBusinessChatLink</a>, passing the <code>slug</code> to obtain info about the link as a <a href="/constructor/account.resolvedBusinessChatLinks">account.resolvedBusinessChatLinks</a> and increase the view counter.</li>
|
||||
|
@ -416,7 +416,7 @@ tg://resolve?domain=<username>&voicechat=<invite_hash></code></p
|
|||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#stickerset-links" id="stickerset-links" name="stickerset-links"><i class="anchor-icon"></i></a>Stickerset links</h3>
|
||||
<p>Used to import stickersets or <a href="/api/custom-emoji">custom emoji</a> stickersets as described <a href="/api/stickers#installing-stickersets">here »</a>.</p>
|
||||
<p>Used to import stickersets or <a href="/api/custom-emoji">custom emoji</a> stickersets as described <a href="/api/stickers#installing-stickersets">here »</a>.</p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/addstickers/<slug>
|
||||
t.me/addemoji/<slug></code></pre>
|
||||
|
@ -441,7 +441,7 @@ tg://addemoji?set=<slug></code></pre>
|
|||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#custom-emoji-stickerset-links" id="custom-emoji-stickerset-links" name="custom-emoji-stickerset-links"><i class="anchor-icon"></i></a>Custom emoji stickerset links</h3>
|
||||
<p>Used to import <a href="/api/custom-emoji">custom emoji</a> stickersets as described <a href="/api/stickers#installing-stickersets">here »</a>.</p>
|
||||
<p>Used to import <a href="/api/custom-emoji">custom emoji</a> stickersets as described <a href="/api/stickers#installing-stickersets">here »</a>.</p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/addemoji/<slug></code></pre>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
|
@ -464,7 +464,7 @@ tg://addemoji?set=<slug></code></pre>
|
|||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#story-links" id="story-links" name="story-links"><i class="anchor-icon"></i></a>Story links</h3>
|
||||
<p>Used to link to a <a href="/api/stories">Telegram Story »</a>, generated using the procedure <a href="/api/links#story-links">specified here »</a>. </p>
|
||||
<p>Used to link to a <a href="/api/stories">Telegram Story »</a>, generated using the procedure <a href="/api/links#story-links">specified here »</a>. </p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/<username>/s/<story_id></code></pre>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
|
@ -487,13 +487,13 @@ tg://addemoji?set=<slug></code></pre>
|
|||
<tr>
|
||||
<td><code>story_id</code></td>
|
||||
<td style="text-align: center;">Required</td>
|
||||
<td>ID of the <a href="/api/stories#watching-stories">Telegram Story to be fetched and viewed as described here »</a>.</td>
|
||||
<td>ID of the <a href="/api/stories#watching-stories">Telegram Story to be fetched and viewed as described here »</a>.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#boost-links" id="boost-links" name="boost-links"><i class="anchor-icon"></i></a>Boost links</h3>
|
||||
<p>Used by users to <a href="/api/boost">boost channels »</a>, granting them the ability to post stories and further perks.</p>
|
||||
<p>Use the channel information to boost the channel as described <a href="/api/boost">here »</a>. </p>
|
||||
<p>Used by users to <a href="/api/boost">boost channels »</a>, granting them the ability to post stories and further perks.</p>
|
||||
<p>Use the channel information to boost the channel as described <a href="/api/boost">here »</a>. </p>
|
||||
<p><code>t.me</code> syntax (public channels):</p>
|
||||
<pre><code>t.me/boost/<username>
|
||||
t.me/<username>?boost</code></pre>
|
||||
|
@ -529,7 +529,7 @@ t.me/c/<id>?boost</code></pre>
|
|||
<h3><a class="anchor" href="#proxy-links" id="proxy-links" name="proxy-links"><i class="anchor-icon"></i></a>Proxy links</h3>
|
||||
<p>Used to share a proxy server that can be used to connect to Telegram. </p>
|
||||
<h4><a class="anchor" href="#mtproxy-links" id="mtproxy-links" name="mtproxy-links"><i class="anchor-icon"></i></a>MTProxy links</h4>
|
||||
<p>Used for <a href="/mtproto/mtproto-transports#transport-obfuscation">MTProxies »</a>.</p>
|
||||
<p>Used for <a href="/mtproto/mtproto-transports#transport-obfuscation">MTProxies »</a>.</p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/proxy?server=<server>&port=<port>&secret=<secret></code></pre>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
|
@ -557,7 +557,7 @@ t.me/c/<id>?boost</code></pre>
|
|||
<tr>
|
||||
<td><code>secret</code></td>
|
||||
<td style="text-align: center;">Required</td>
|
||||
<td>MTProxy <a href="/mtproto/mtproto-transports#transport-obfuscation">secret »</a></td>
|
||||
<td>MTProxy <a href="/mtproto/mtproto-transports#transport-obfuscation">secret »</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -600,7 +600,7 @@ t.me/c/<id>?boost</code></pre>
|
|||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#theme-links" id="theme-links" name="theme-links"><i class="anchor-icon"></i></a>Theme links</h3>
|
||||
<p>Used to <a href="/api/themes#installing-themes">install themes »</a>.</p>
|
||||
<p>Used to <a href="/api/themes#installing-themes">install themes »</a>.</p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/addtheme/<name></code></pre>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
|
@ -618,14 +618,14 @@ t.me/c/<id>?boost</code></pre>
|
|||
<tr>
|
||||
<td><code>name</code></td>
|
||||
<td style="text-align: center;">Required</td>
|
||||
<td>Theme short name used when <a href="/api/themes#installing-themes">installing themes »</a></td>
|
||||
<td>Theme short name used when <a href="/api/themes#installing-themes">installing themes »</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#wallpaper-links" id="wallpaper-links" name="wallpaper-links"><i class="anchor-icon"></i></a>Wallpaper links</h3>
|
||||
<p>Used to share and install chat backgrounds (wallpapers): see <a href="/api/wallpapers">here for more info on the various wallpaper and fill types »</a>. </p>
|
||||
<p>Used to share and install chat backgrounds (wallpapers): see <a href="/api/wallpapers">here for more info on the various wallpaper and fill types »</a>. </p>
|
||||
<h4><a class="anchor" href="#image-wallpapers" id="image-wallpapers" name="image-wallpapers"><i class="anchor-icon"></i></a><a href="/api/wallpapers#image-wallpapers">Image wallpapers</a></h4>
|
||||
<p>Used for <a href="/api/wallpapers#image-wallpapers">image-based wallpapers »</a>. </p>
|
||||
<p>Used for <a href="/api/wallpapers#image-wallpapers">image-based wallpapers »</a>. </p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/bg/<slug>?mode=<mode></code></pre>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
|
@ -648,12 +648,12 @@ t.me/c/<id>?boost</code></pre>
|
|||
<tr>
|
||||
<td><code>mode</code></td>
|
||||
<td style="text-align: center;">Optional</td>
|
||||
<td>A combination of <code>blur</code> and <code>motion</code> (joined by <code>+</code>) to enable blurring and/or parallax motion as specified in the <a href="/api/wallpapers#image-wallpapers">docs »</a>.</td>
|
||||
<td>A combination of <code>blur</code> and <code>motion</code> (joined by <code>+</code>) to enable blurring and/or parallax motion as specified in the <a href="/api/wallpapers#image-wallpapers">docs »</a>.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h4><a class="anchor" href="#solid-fill-wallpapers" id="solid-fill-wallpapers" name="solid-fill-wallpapers"><i class="anchor-icon"></i></a>Solid fill wallpapers</h4>
|
||||
<p>Used for <a href="/api/wallpapers#fill-wallpapers">fill wallpapers »</a> with a <a href="/api/wallpapers#solid-fill">solid fill »</a>. </p>
|
||||
<p>Used for <a href="/api/wallpapers#fill-wallpapers">fill wallpapers »</a> with a <a href="/api/wallpapers#solid-fill">solid fill »</a>. </p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/bg/<hex_color></code></pre>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
|
@ -676,7 +676,7 @@ t.me/c/<id>?boost</code></pre>
|
|||
</tbody>
|
||||
</table>
|
||||
<h4><a class="anchor" href="#gradient-fill-wallpapers" id="gradient-fill-wallpapers" name="gradient-fill-wallpapers"><i class="anchor-icon"></i></a>Gradient fill wallpapers</h4>
|
||||
<p>Used for <a href="/api/wallpapers#fill-wallpapers">fill wallpapers »</a> with a <a href="/api/wallpapers#gradient-fill">gradient fill »</a>. </p>
|
||||
<p>Used for <a href="/api/wallpapers#fill-wallpapers">fill wallpapers »</a> with a <a href="/api/wallpapers#gradient-fill">gradient fill »</a>. </p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/bg/<top_color>-<bottom_color>?rotation=<rotation></code></pre>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
|
@ -709,7 +709,7 @@ t.me/c/<id>?boost</code></pre>
|
|||
</tbody>
|
||||
</table>
|
||||
<h4><a class="anchor" href="#freeform-gradient-fill-wallpapers" id="freeform-gradient-fill-wallpapers" name="freeform-gradient-fill-wallpapers"><i class="anchor-icon"></i></a>Freeform gradient fill wallpapers</h4>
|
||||
<p>Used for <a href="/api/wallpapers#fill-wallpapers">fill wallpapers »</a> with a <a href="/api/wallpapers#freeform-gradient-fill">freeform gradient fill »</a>. </p>
|
||||
<p>Used for <a href="/api/wallpapers#fill-wallpapers">fill wallpapers »</a> with a <a href="/api/wallpapers#freeform-gradient-fill">freeform gradient fill »</a>. </p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/bg/<hex_color1>~<hex_color2>~<hex_color3>
|
||||
t.me/bg/<hex_color1>~<hex_color2>~<hex_color3>~<hex_color4></code></pre>
|
||||
|
@ -749,7 +749,7 @@ tg://bg?gradient=<hex_color1>~<hex_color2>~<hex_color3>~<he
|
|||
</tbody>
|
||||
</table>
|
||||
<h4><a class="anchor" href="#solid-pattern-wallpapers" id="solid-pattern-wallpapers" name="solid-pattern-wallpapers"><i class="anchor-icon"></i></a>Solid pattern wallpapers</h4>
|
||||
<p>Used for <a href="/api/wallpapers#pattern-wallpapers">pattern wallpapers »</a> with a <a href="/api/wallpapers#solid-fill">solid fill »</a>. </p>
|
||||
<p>Used for <a href="/api/wallpapers#pattern-wallpapers">pattern wallpapers »</a> with a <a href="/api/wallpapers#solid-fill">solid fill »</a>. </p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/bg/<slug>?intensity=<intensity>&bg_color=<bg_color>&mode=<mode></code></pre>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
|
@ -787,7 +787,7 @@ tg://bg?gradient=<hex_color1>~<hex_color2>~<hex_color3>~<he
|
|||
</tbody>
|
||||
</table>
|
||||
<h4><a class="anchor" href="#gradient-pattern-wallpapers" id="gradient-pattern-wallpapers" name="gradient-pattern-wallpapers"><i class="anchor-icon"></i></a>Gradient pattern wallpapers</h4>
|
||||
<p>Used for <a href="/api/wallpapers#pattern-wallpapers">pattern wallpapers »</a> with a <a href="/api/wallpapers#gradient-fill">gradient fill »</a>. </p>
|
||||
<p>Used for <a href="/api/wallpapers#pattern-wallpapers">pattern wallpapers »</a> with a <a href="/api/wallpapers#gradient-fill">gradient fill »</a>. </p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/bg/<slug>?intensity=<intensity>&bg_color=<top_color>-<bottom_color>&rotation=<rotation>&mode=<mode></code></pre>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
|
@ -835,7 +835,7 @@ tg://bg?gradient=<hex_color1>~<hex_color2>~<hex_color3>~<he
|
|||
</tbody>
|
||||
</table>
|
||||
<h4><a class="anchor" href="#freeform-gradient-pattern-wallpapers" id="freeform-gradient-pattern-wallpapers" name="freeform-gradient-pattern-wallpapers"><i class="anchor-icon"></i></a>Freeform gradient pattern wallpapers</h4>
|
||||
<p>Used for <a href="/api/wallpapers#pattern-wallpapers">pattern wallpapers »</a> with a <a href="/api/wallpapers#freeform-gradient-fill">freeform gradient fill »</a>. </p>
|
||||
<p>Used for <a href="/api/wallpapers#pattern-wallpapers">pattern wallpapers »</a> with a <a href="/api/wallpapers#freeform-gradient-fill">freeform gradient fill »</a>. </p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/bg/<slug>?intensity=<intensity>&bg_color=<hex_color1>~<hex_color2>~<hex_color3>&mode=<mode>
|
||||
t.me/bg/<slug>?intensity=<intensity>&bg_color=<hex_color1>~<hex_color2>~<hex_color3>~<hex_color4>&mode=<mode></code></pre>
|
||||
|
@ -913,7 +913,7 @@ tg://bg?slug=<slug>&intensity=<intensity>&bg_color=<hex_c
|
|||
<tr>
|
||||
<td><code>parameter</code></td>
|
||||
<td style="text-align: center;">Optional</td>
|
||||
<td>Start parameter, up to 64 <a href="https://en.wikipedia.org/wiki/Base64#The_URL_applications">base64url</a> characters: if provided and the <code>bot_username</code> is indeed a bot, the text input bar should be replaced with a <code>Start</code> button (even if the user has already started the bot) that should invoke <a href="/method/messages.startBot">messages.startBot</a> with the appropriate <code>parameter</code> once clicked. Note that if the <code>bot_username</code> is equal to the <a href="/api/config#premium-bot-username"><code>premium_bot_username</code> configuration value »</a>, clicking on this link should immediately invoke <a href="/method/messages.startBot">messages.startBot</a> with the appropriate <code>parameter</code>.</td>
|
||||
<td>Start parameter, up to 64 <a href="https://en.wikipedia.org/wiki/Base64#The_URL_applications">base64url</a> characters: if provided and the <code>bot_username</code> is indeed a bot, the text input bar should be replaced with a <code>Start</code> button (even if the user has already started the bot) that should invoke <a href="/method/messages.startBot">messages.startBot</a> with the appropriate <code>parameter</code> once clicked. Note that if the <code>bot_username</code> is equal to the <a href="/api/config#premium-bot-username"><code>premium_bot_username</code> configuration value »</a>, clicking on this link should immediately invoke <a href="/method/messages.startBot">messages.startBot</a> with the appropriate <code>parameter</code>.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -975,7 +975,7 @@ tg://resolve?domain=<bot_username>&startgroup&admin=<permission
|
|||
<tr>
|
||||
<td><code>admin</code></td>
|
||||
<td style="text-align: center;">Optional for group links, required for channel links</td>
|
||||
<td>A combination of the following identifiers separated by <code>+</code>, each corresponding to the appropriate flag in the <a href="/constructor/chatAdminRights">chatAdminRights »</a> constructor: <br>- <code>change_info</code> - <a href="/constructor/chatAdminRights">chatAdminRights.change_info</a> <br>- <code>post_messages</code> - <a href="/constructor/chatAdminRights">chatAdminRights.post_messages</a> <br>- <code>edit_messages</code> - <a href="/constructor/chatAdminRights">chatAdminRights.edit_messages</a> <br>- <code>delete_messages</code> - <a href="/constructor/chatAdminRights">chatAdminRights.delete_messages</a> <br>- <code>restrict_members</code> - <a href="/constructor/chatAdminRights">chatAdminRights.ban_users</a> <br>- <code>invite_users</code> - <a href="/constructor/chatAdminRights">chatAdminRights.invite_users</a> <br>- <code>pin_messages</code> - <a href="/constructor/chatAdminRights">chatAdminRights.pin_messages</a> <br>- <code>manage_topics</code> - <a href="/constructor/chatAdminRights">chatAdminRights.manage_topics</a> <br>- <code>promote_members</code> - <a href="/constructor/chatAdminRights">chatAdminRights.add_admins</a> <br>- <code>manage_video_chats</code> - <a href="/constructor/chatAdminRights">chatAdminRights.manage_call</a> <br>- <code>anonymous</code> - <a href="/constructor/chatAdminRights">chatAdminRights.anonymous</a> <br>- <code>manage_chat</code> - <a href="/constructor/chatAdminRights">chatAdminRights.other</a> <br>- <code>post_stories</code> - <a href="/constructor/chatAdminRights">chatAdminRights.post_stories</a> <br>- <code>edit_stories</code> - <a href="/constructor/chatAdminRights">chatAdminRights.edit_stories</a> <br>- <code>delete_stories</code> - <a href="/constructor/chatAdminRights">chatAdminRights.delete_stories</a></td>
|
||||
<td>A combination of the following identifiers separated by <code>+</code>, each corresponding to the appropriate flag in the <a href="/constructor/chatAdminRights">chatAdminRights »</a> constructor: <br>- <code>change_info</code> - <a href="/constructor/chatAdminRights">chatAdminRights.change_info</a> <br>- <code>post_messages</code> - <a href="/constructor/chatAdminRights">chatAdminRights.post_messages</a> <br>- <code>edit_messages</code> - <a href="/constructor/chatAdminRights">chatAdminRights.edit_messages</a> <br>- <code>delete_messages</code> - <a href="/constructor/chatAdminRights">chatAdminRights.delete_messages</a> <br>- <code>restrict_members</code> - <a href="/constructor/chatAdminRights">chatAdminRights.ban_users</a> <br>- <code>invite_users</code> - <a href="/constructor/chatAdminRights">chatAdminRights.invite_users</a> <br>- <code>pin_messages</code> - <a href="/constructor/chatAdminRights">chatAdminRights.pin_messages</a> <br>- <code>manage_topics</code> - <a href="/constructor/chatAdminRights">chatAdminRights.manage_topics</a> <br>- <code>promote_members</code> - <a href="/constructor/chatAdminRights">chatAdminRights.add_admins</a> <br>- <code>manage_video_chats</code> - <a href="/constructor/chatAdminRights">chatAdminRights.manage_call</a> <br>- <code>anonymous</code> - <a href="/constructor/chatAdminRights">chatAdminRights.anonymous</a> <br>- <code>manage_chat</code> - <a href="/constructor/chatAdminRights">chatAdminRights.other</a> <br>- <code>post_stories</code> - <a href="/constructor/chatAdminRights">chatAdminRights.post_stories</a> <br>- <code>edit_stories</code> - <a href="/constructor/chatAdminRights">chatAdminRights.edit_stories</a> <br>- <code>delete_stories</code> - <a href="/constructor/chatAdminRights">chatAdminRights.delete_stories</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -1060,7 +1060,7 @@ tg://resolve?domain=<bot_username>&startgroup&admin=<permission
|
|||
<pre><code>tg://settings/theme</code></pre>
|
||||
<p>No parameters.</p>
|
||||
<h3><a class="anchor" href="#login-code-link" id="login-code-link" name="login-code-link"><i class="anchor-icon"></i></a>Login code link</h3>
|
||||
<p>Contains the phone number verification code to use during <a href="/api/auth">user authorization »</a>. </p>
|
||||
<p>Contains the phone number verification code to use during <a href="/api/auth">user authorization »</a>. </p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/login/<code></code></pre>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
|
@ -1083,7 +1083,7 @@ tg://resolve?domain=<bot_username>&startgroup&admin=<permission
|
|||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#invoice-links" id="invoice-links" name="invoice-links"><i class="anchor-icon"></i></a>Invoice links</h3>
|
||||
<p>Used to initiate <a href="/api/payments">payment of an invoice »</a>, generated using <a href="/constructor/payments.exportedInvoice">payments.exportedInvoice</a>. </p>
|
||||
<p>Used to initiate <a href="/api/payments">payment of an invoice »</a>, generated using <a href="/constructor/payments.exportedInvoice">payments.exportedInvoice</a>. </p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/invoice/<slug>
|
||||
t.me/$<slug></code></pre>
|
||||
|
@ -1102,7 +1102,7 @@ t.me/$<slug></code></pre>
|
|||
<tr>
|
||||
<td><code>slug</code></td>
|
||||
<td style="text-align: center;">Required</td>
|
||||
<td>The invoice slug to be used <a href="/api/payments">during payment »</a>.</td>
|
||||
<td>The invoice slug to be used <a href="/api/payments">during payment »</a>.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -1130,13 +1130,13 @@ t.me/$<slug></code></pre>
|
|||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#telegram-passport-links" id="telegram-passport-links" name="telegram-passport-links"><i class="anchor-icon"></i></a>Telegram Passport links</h3>
|
||||
<p>See <a href="/api/passport#uri-format">the Telegram Passport documentation for parameters and usage »</a>. </p>
|
||||
<p>See <a href="/api/passport#uri-format">the Telegram Passport documentation for parameters and usage »</a>. </p>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
<pre><code>tg://passport?params
|
||||
tg://resolve?domain=telegrampassport&params</code></pre>
|
||||
<h3><a class="anchor" href="#phone-confirmation-links" id="phone-confirmation-links" name="phone-confirmation-links"><i class="anchor-icon"></i></a>Phone confirmation links</h3>
|
||||
<p>Different from <a href="#login-code-link">login code links</a>.<br>
|
||||
These links are used to confirm ownership of the phone number, to prevent account deletion: see <a href="/api/account-deletion">the account deletion docs for more info on how to handle them »</a>.</p>
|
||||
These links are used to confirm ownership of the phone number, to prevent account deletion: see <a href="/api/account-deletion">the account deletion docs for more info on how to handle them »</a>.</p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/confirmphone?phone=<phone>&hash=<hash></code></pre>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
|
@ -1159,13 +1159,13 @@ These links are used to confirm ownership of the phone number, to prevent accoun
|
|||
<tr>
|
||||
<td><code>hash</code></td>
|
||||
<td style="text-align: center;">Required</td>
|
||||
<td>Confirmation hash to handle <a href="/api/account-deletion">as described here »</a></td>
|
||||
<td>Confirmation hash to handle <a href="/api/account-deletion">as described here »</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#premium-multigift-links" id="premium-multigift-links" name="premium-multigift-links"><i class="anchor-icon"></i></a>Premium multigift links</h3>
|
||||
<p>Used to bring the user to the screen used for gifting Telegram Premium subscriptions to friends, see <a href="/api/giveaways">here for more info on gifting Telegram Premium to multiple users »</a>. </p>
|
||||
<p>This link is used to invite users to gift Premium subscription to other users, see <a href="#premium-giftcode-links">here »</a> for the different link type containing the actual giftcodes that can be used to import a gifted Telegram Premium subscription. </p>
|
||||
<p>Used to bring the user to the screen used for gifting Telegram Premium subscriptions to friends, see <a href="/api/giveaways">here for more info on gifting Telegram Premium to multiple users »</a>. </p>
|
||||
<p>This link is used to invite users to gift Premium subscription to other users, see <a href="#premium-giftcode-links">here »</a> for the different link type containing the actual giftcodes that can be used to import a gifted Telegram Premium subscription. </p>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
<pre><code>tg://premium_multigift?ref=<referrer></code></pre>
|
||||
<p>Parameters: </p>
|
||||
|
@ -1230,7 +1230,7 @@ These links are used to confirm ownership of the phone number, to prevent accoun
|
|||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#qr-code-login-links" id="qr-code-login-links" name="qr-code-login-links"><i class="anchor-icon"></i></a>QR code login links</h3>
|
||||
<p>Used by the <a href="/api/qr-login">QR code login flow »</a>.</p>
|
||||
<p>Used by the <a href="/api/qr-login">QR code login flow »</a>.</p>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
<pre><code>tg://login?token=<base64encodedtoken></code></pre>
|
||||
<p>Parameters:</p>
|
||||
|
@ -1251,8 +1251,8 @@ These links are used to confirm ownership of the phone number, to prevent accoun
|
|||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#main-mini-app-links" id="main-mini-app-links" name="main-mini-app-links"><i class="anchor-icon"></i></a>Main Mini App links</h3>
|
||||
<p>Used to open <a href="/api/bots/webapps#main-mini-apps">Main Mini Apps »</a>. </p>
|
||||
<p>If the specified bot <strong>does not</strong> have a configured Main Mini App (i.e. the <a href="/constructor/user">user</a>.<code>bot_has_main_app</code> flag will <strong>not</strong> be set), fall back to the behavior of <a href="#public-username-links">username links »</a>. </p>
|
||||
<p>Used to open <a href="/api/bots/webapps#main-mini-apps">Main Mini Apps »</a>. </p>
|
||||
<p>If the specified bot <strong>does not</strong> have a configured Main Mini App (i.e. the <a href="/constructor/user">user</a>.<code>bot_has_main_app</code> flag will <strong>not</strong> be set), fall back to the behavior of <a href="#public-username-links">username links »</a>. </p>
|
||||
<p>The main mini app should be opened using <a href="/method/messages.requestMainWebView">messages.requestMainWebView</a>. </p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/<bot_username>?startapp&mode=<mode>
|
||||
|
@ -1274,7 +1274,7 @@ tg://resolve?domain=<bot_username>&startapp=<start_parameter>&am
|
|||
<tr>
|
||||
<td><code>bot_username</code></td>
|
||||
<td style="text-align: center;">Required</td>
|
||||
<td>Username of the bot that owns the <a href="/api/bots/webapps#main-mini-apps">main mini app »</a></td>
|
||||
<td>Username of the bot that owns the <a href="/api/bots/webapps#main-mini-apps">main mini app »</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>start_parameter</code></td>
|
||||
|
@ -1291,7 +1291,7 @@ tg://resolve?domain=<bot_username>&startapp=<start_parameter>&am
|
|||
<h3><a class="anchor" href="#direct-mini-app-links" id="direct-mini-app-links" name="direct-mini-app-links"><i class="anchor-icon"></i></a>Direct mini app links</h3>
|
||||
<p>Used to share <a href="/api/bots/webapps#direct-link-mini-apps">Direct link Mini apps</a>. </p>
|
||||
<p>These links are different from <a href="#bot-attachment-or-side-menu-links">bot attachment menu deep links</a>, because they don't require the user to install an attachment menu, and a single bot can offer multiple named mini apps, distinguished by their <code>short_name</code>. </p>
|
||||
<p>These links should be handled as specified in the <a href="/api/bots/webapps#direct-link-mini-apps">direct link Mini Apps documentation »</a>. </p>
|
||||
<p>These links should be handled as specified in the <a href="/api/bots/webapps#direct-link-mini-apps">direct link Mini Apps documentation »</a>. </p>
|
||||
<p><code>t.me</code> syntax:</p>
|
||||
<pre><code>t.me/<bot_username>/<short_name>?startapp=<start_parameter>&mode=<mode></code></pre>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
|
@ -1330,8 +1330,8 @@ tg://resolve?domain=<bot_username>&startapp=<start_parameter>&am
|
|||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#bot-attachment-or-side-menu-links" id="bot-attachment-or-side-menu-links" name="bot-attachment-or-side-menu-links"><i class="anchor-icon"></i></a>Bot attachment or side menu links</h3>
|
||||
<p>Used to install and open a <a href="/api/bots/attach">bot attachment or side menu »</a> in a certain chat.<br>
|
||||
For all link types, clients should first <a href="/api/bots/attach">install the associated bot attachment or side menu entry as specified here »</a>, and if the user accepts the installation prompt, open the Mini App using the following logic, depending on the link subtype:</p>
|
||||
<p>Used to install and open a <a href="/api/bots/attach">bot attachment or side menu »</a> in a certain chat.<br>
|
||||
For all link types, clients should first <a href="/api/bots/attach">install the associated bot attachment or side menu entry as specified here »</a>, and if the user accepts the installation prompt, open the Mini App using the following logic, depending on the link subtype:</p>
|
||||
<h4><a class="anchor" href="#open-in-current-chat" id="open-in-current-chat" name="open-in-current-chat"><i class="anchor-icon"></i></a>Open in current chat</h4>
|
||||
<p>After installing the attachment/side menu entry globally, opens the associated mini app using <a href="/method/messages.requestWebView">messages.requestWebView</a> in the currently open chat, by passing it to the <code>peer</code> parameter of <a href="/method/messages.requestWebView">messages.requestWebView</a>. </p>
|
||||
<p>If the current chat is not supported by the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>peer_types</code> field: </p>
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<h1 id="dev_page_title">Min constructors</h1>
|
||||
|
||||
<div id="dev_page_content"><p>In some situations <a href="/constructor/user">user</a> and <a href="/constructor/channel">channel</a> constructors have reduced set of fields present (although <code>id</code> is always there) and <code>min</code> flag set. This is done for performance and privacy reasons. </p>
|
||||
<p>When receiving said constructors, the client must first check if user or chat object without <code>min</code> flag is already present in the <a href="/api/peers">local peer database »</a>.<br>
|
||||
<p>When receiving said constructors, the client must first check if user or chat object without <code>min</code> flag is already present in the <a href="/api/peers">local peer database »</a>.<br>
|
||||
If it is present, then the client should merge the remote and the local object, ignoring some specific fields of the remote object as specified by the <a href="/constructor/user">user</a> and <a href="/constructor/channel">channel</a> pages. </p>
|
||||
<p>Additionally, the client must store the context (similar to <a href="/api/file_reference">file references</a>) in which the user/channel was seen. Later, when the client needs to pass the user/channel as input argument (e.g. passing the <code>access_hash</code> to fetch profile, mute, ban info etc), the context is used to generate the <code>input*FromMessage</code> constructor, instead of normal <code>inputUser</code>, <code>inputChannel</code> or <code>inputPeer</code>.</p>
|
||||
<ul>
|
||||
|
|
|
@ -53,8 +53,8 @@
|
|||
<a href='/method/contacts.getLocated'>contacts.getLocated</a>#d348bc44 flags:<a href='/type/%23'>#</a> background:flags.1?<a href='/constructor/true'>true</a> geo_point:<a href='/type/InputGeoPoint'>InputGeoPoint</a> self_expires:flags.0?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||
<p>Use <a href="/method/contacts.getLocated">contacts.getLocated</a> to fetch a list of nearby users and groups. </p>
|
||||
<p>Do <strong>not</strong> set any of the <code>background</code>, <code>self_expires</code> flags: only populate <code>geo_point</code> with the current geolocation of the user: a list of users and geochats located nearby will be returned (<strong>without</strong> publishing the current location of the user). </p>
|
||||
<p>This functionality is useful for example to <a href="/api/contacts#adding-telegram-users-as-contacts">exchange contacts</a> with a nearby Telegram user, or <a href="/method/channels.joinChannel">join</a> a location-based group chat, see <a href="https://telegram.org/blog/contacts-local-groups">here »</a> for more usecases. </p>
|
||||
<p>See <a href="#creating-a-geogroup">here »</a> for more info on how to create a geogroup, and <a href="#advertising-our-current-location">here »</a> for more info on how to advertise our current location to other users. </p>
|
||||
<p>This functionality is useful for example to <a href="/api/contacts#adding-telegram-users-as-contacts">exchange contacts</a> with a nearby Telegram user, or <a href="/method/channels.joinChannel">join</a> a location-based group chat, see <a href="https://telegram.org/blog/contacts-local-groups">here »</a> for more usecases. </p>
|
||||
<p>See <a href="#creating-a-geogroup">here »</a> for more info on how to create a geogroup, and <a href="#advertising-our-current-location">here »</a> for more info on how to advertise our current location to other users. </p>
|
||||
<h3><a class="anchor" href="#creating-a-geogroup" id="creating-a-geogroup" name="creating-a-geogroup"><i class="anchor-icon"></i></a>Creating a geogroup</h3>
|
||||
<pre><code><a href='/constructor/inputGeoPoint'>inputGeoPoint</a>#48222faf flags:<a href='/type/%23'>#</a> lat:<a href='/type/double'>double</a> long:<a href='/type/double'>double</a> accuracy_radius:flags.0?<a href='/type/int'>int</a> = <a href='/type/InputGeoPoint'>InputGeoPoint</a>;
|
||||
|
||||
|
@ -63,7 +63,7 @@
|
|||
<a href='/method/channels.createChannel'>channels.createChannel</a>#91006707 flags:<a href='/type/%23'>#</a> broadcast:flags.0?<a href='/constructor/true'>true</a> megagroup:flags.1?<a href='/constructor/true'>true</a> for_import:flags.3?<a href='/constructor/true'>true</a> forum:flags.5?<a href='/constructor/true'>true</a> title:<a href='/type/string'>string</a> about:<a href='/type/string'>string</a> geo_point:flags.2?<a href='/type/InputGeoPoint'>InputGeoPoint</a> address:flags.2?<a href='/type/string'>string</a> ttl_period:flags.4?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;
|
||||
|
||||
<a href='/method/channels.editLocation'>channels.editLocation</a>#58e63f6d channel:<a href='/type/InputChannel'>InputChannel</a> geo_point:<a href='/type/InputGeoPoint'>InputGeoPoint</a> address:<a href='/type/string'>string</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>Pass a <code>geo_point</code> to <a href="/method/channels.createChannel">channels.createChannel</a> when creating a <a href="/api/channel">supergroup</a> in order to create a geogroup associated to a geolocation, that will be returned to <a href="#fetching-nearby-users-and-geogroups">nearby users »</a>. </p>
|
||||
<p>Pass a <code>geo_point</code> to <a href="/method/channels.createChannel">channels.createChannel</a> when creating a <a href="/api/channel">supergroup</a> in order to create a geogroup associated to a geolocation, that will be returned to <a href="#fetching-nearby-users-and-geogroups">nearby users »</a>. </p>
|
||||
<p>A textual description of the location (1-64 UTF-8 chars) should also be passed in <code>address</code>. </p>
|
||||
<p>Use <a href="/method/channels.editLocation">channels.editLocation</a> to change the group's location.</p>
|
||||
<h3><a class="anchor" href="#advertising-our-current-location" id="advertising-our-current-location" name="advertising-our-current-location"><i class="anchor-icon"></i></a>Advertising our current location</h3>
|
||||
|
@ -73,10 +73,10 @@
|
|||
|
||||
<a href='/method/contacts.getLocated'>contacts.getLocated</a>#d348bc44 flags:<a href='/type/%23'>#</a> background:flags.1?<a href='/constructor/true'>true</a> geo_point:<a href='/type/InputGeoPoint'>InputGeoPoint</a> self_expires:flags.0?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||
<p>Our current location may be <a href="#fetching-nearby-users-and-geogroups">advertised to other users</a> using <a href="/method/contacts.getLocated">contacts.getLocated</a>: in this case the <code>self_expires</code> flag <strong>must always be set</strong>. </p>
|
||||
<p>Note that if the current user is already advertising their location using the <a href="/api/business#location">Telegram Business location feature »</a> (even without a <code>geo_point</code>, just with a textual <code>address</code>), the method will return a <code>BUSINESS_ADDRESS_ACTIVE</code> error, indicating that the location may only be changed (or removed) using <a href="/method/account.updateBusinessLocation">account.updateBusinessLocation »</a>, instead of <a href="/method/contacts.getLocated">contacts.getLocated</a>. </p>
|
||||
<p>Note that if the current user is already advertising their location using the <a href="/api/business#location">Telegram Business location feature »</a> (even without a <code>geo_point</code>, just with a textual <code>address</code>), the method will return a <code>BUSINESS_ADDRESS_ACTIVE</code> error, indicating that the location may only be changed (or removed) using <a href="/method/account.updateBusinessLocation">account.updateBusinessLocation »</a>, instead of <a href="/method/contacts.getLocated">contacts.getLocated</a>. </p>
|
||||
<p>This flag is used to specify the expiration TTL of the passed geolocation (i.e. the geolocation will expire after <code>self_expires</code> seconds); pass <code>0x7fffffff</code> to disable expiry, 0 to make the current geolocation private. </p>
|
||||
<p>The method will also return a list of nearby users and chats, but only if the passed expiration TTL is not equal to zero.<br>
|
||||
Users may still fetch nearby users and chats without making their geolocation public by simply not setting the flag, see <a href="#fetching-nearby-users-and-geogroups">here »</a> for more info. </p>
|
||||
Users may still fetch nearby users and chats without making their geolocation public by simply not setting the flag, see <a href="#fetching-nearby-users-and-geogroups">here »</a> for more info. </p>
|
||||
<p>While the geolocation of the current user is public, clients should update it in the background every half-an-hour or so (or in any case before the expiration date specified with <code>self_expires</code>), while setting this flag: if the new location is more than 1 KM away from the previous one, or if the previous location is unknown, the <code>background</code> flag should be set.</p></div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<div id="dev_page_content"><!-- scroll_nav -->
|
||||
|
||||
<p>Content creators can accept <a href="/api/stars">Stars</a> by publishing <strong>paid photos or videos</strong> on their channels. Subscribers will be allowed to view such posts only after paying the author to unlock them. </p>
|
||||
<p>Creators can then <a href="/api/stars#withdrawing-revenue">withdraw Stars using the Toncoin cryptocurrency »</a>, or use them to <a href="/api/stars#paying-for-ads">advertise their channel</a> and get even more subscribers – all of this with next to <strong>0 commission</strong> from Telegram.</p>
|
||||
<p>Creators can then <a href="/api/stars#withdrawing-revenue">withdraw Stars using the Toncoin cryptocurrency »</a>, or use them to <a href="/api/stars#paying-for-ads">advertise their channel</a> and get even more subscribers – all of this with next to <strong>0 commission</strong> from Telegram.</p>
|
||||
<h3><a class="anchor" href="#posting-paid-media" id="posting-paid-media" name="posting-paid-media"><i class="anchor-icon"></i></a>Posting paid media</h3>
|
||||
<pre><code><a href='/constructor/channelFull'>channelFull</a>#bbab348d flags:<a href='/type/%23'>#</a> can_view_participants:flags.3?<a href='/constructor/true'>true</a> can_set_username:flags.6?<a href='/constructor/true'>true</a> can_set_stickers:flags.7?<a href='/constructor/true'>true</a> hidden_prehistory:flags.10?<a href='/constructor/true'>true</a> can_set_location:flags.16?<a href='/constructor/true'>true</a> has_scheduled:flags.19?<a href='/constructor/true'>true</a> can_view_stats:flags.20?<a href='/constructor/true'>true</a> blocked:flags.22?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> can_delete_channel:flags2.0?<a href='/constructor/true'>true</a> antispam:flags2.1?<a href='/constructor/true'>true</a> participants_hidden:flags2.2?<a href='/constructor/true'>true</a> translations_disabled:flags2.3?<a href='/constructor/true'>true</a> stories_pinned_available:flags2.5?<a href='/constructor/true'>true</a> view_forum_as_messages:flags2.6?<a href='/constructor/true'>true</a> restricted_sponsored:flags2.11?<a href='/constructor/true'>true</a> can_view_revenue:flags2.12?<a href='/constructor/true'>true</a> paid_media_allowed:flags2.14?<a href='/constructor/true'>true</a> can_view_stars_revenue:flags2.15?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:<a href='/type/string'>string</a> participants_count:flags.0?<a href='/type/int'>int</a> admins_count:flags.1?<a href='/type/int'>int</a> kicked_count:flags.2?<a href='/type/int'>int</a> banned_count:flags.2?<a href='/type/int'>int</a> online_count:flags.13?<a href='/type/int'>int</a> read_inbox_max_id:<a href='/type/int'>int</a> read_outbox_max_id:<a href='/type/int'>int</a> unread_count:<a href='/type/int'>int</a> chat_photo:<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> exported_invite:flags.23?<a href='/type/ExportedChatInvite'>ExportedChatInvite</a> bot_info:<a href='/type/Vector%20t'>Vector</a><<a href='/type/BotInfo'>BotInfo</a>> migrated_from_chat_id:flags.4?<a href='/type/long'>long</a> migrated_from_max_id:flags.4?<a href='/type/int'>int</a> pinned_msg_id:flags.5?<a href='/type/int'>int</a> stickerset:flags.8?<a href='/type/StickerSet'>StickerSet</a> available_min_id:flags.9?<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> linked_chat_id:flags.14?<a href='/type/long'>long</a> location:flags.15?<a href='/type/ChannelLocation'>ChannelLocation</a> slowmode_seconds:flags.17?<a href='/type/int'>int</a> slowmode_next_send_date:flags.18?<a href='/type/int'>int</a> stats_dc:flags.12?<a href='/type/int'>int</a> pts:<a href='/type/int'>int</a> call:flags.21?<a href='/type/InputGroupCall'>InputGroupCall</a> ttl_period:flags.24?<a href='/type/int'>int</a> pending_suggestions:flags.25?<a href='/type/Vector%20t'>Vector</a><<a href='/type/string'>string</a>> groupcall_default_join_as:flags.26?<a href='/type/Peer'>Peer</a> theme_emoticon:flags.27?<a href='/type/string'>string</a> requests_pending:flags.28?<a href='/type/int'>int</a> recent_requesters:flags.28?<a href='/type/Vector%20t'>Vector</a><<a href='/type/long'>long</a>> default_send_as:flags.29?<a href='/type/Peer'>Peer</a> available_reactions:flags.30?<a href='/type/ChatReactions'>ChatReactions</a> reactions_limit:flags2.13?<a href='/type/int'>int</a> stories:flags2.4?<a href='/type/PeerStories'>PeerStories</a> wallpaper:flags2.7?<a href='/type/WallPaper'>WallPaper</a> boosts_applied:flags2.8?<a href='/type/int'>int</a> boosts_unrestrict:flags2.9?<a href='/type/int'>int</a> emojiset:flags2.10?<a href='/type/StickerSet'>StickerSet</a> = <a href='/type/ChatFull'>ChatFull</a>;
|
||||
|
||||
|
@ -58,7 +58,7 @@
|
|||
<p>To post paid media, use <a href="/method/messages.sendMedia">messages.sendMedia</a>, passing an <a href="/constructor/inputMediaPaidMedia">inputMediaPaidMedia</a> constructor, containing:</p>
|
||||
<ul>
|
||||
<li>In <code>stars_amount</code>, the amount of <a href="/api/stars">Telegram Stars</a> users must pay to obtain access to the media.<br>
|
||||
The maximum value that can be passed here is specified in the <a href="/api/config#stars-paid-post-amount-max">stars_paid_post_amount_max client configuration value »</a>.</li>
|
||||
The maximum value that can be passed here is specified in the <a href="/api/config#stars-paid-post-amount-max">stars_paid_post_amount_max client configuration value »</a>.</li>
|
||||
<li>In <code>extended_media</code>, the actual media files (currently only photos and videos are supported).
|
||||
To send albums, do <strong>not</strong> use <a href="/method/messages.sendMultiMedia">messages.sendMultiMedia</a>, but rather pass all the medias in the <code>extended_media</code> array. </li>
|
||||
</ul>
|
||||
|
@ -82,16 +82,16 @@ To send albums, do <strong>not</strong> use <a href="/method/messages.sendMultiM
|
|||
<li>In <code>stars_amount</code>, the price of the media in <a href="/api/stars">Telegram Stars</a></li>
|
||||
<li>In <code>extended_media</code>, a vector of <a href="/type/MessageExtendedMedia">MessageExtendedMedia</a> constructors, which will <strong>all</strong> be either:<ul>
|
||||
<li><a href="/constructor/messageExtendedMediaPreview">messageExtendedMediaPreview</a>, for media the current user hasn't bought yet, <strong>optionally</strong> contains basic info about the media (width, height, <a href="/api/files#stripped-thumbnails">extremely low resolution thumbnail</a>, video duration for videos). </li>
|
||||
<li><a href="/constructor/messageExtendedMedia">messageExtendedMedia</a>, for media the current user has already purchased, containing the actual <a href="/constructor/messageMediaPhoto">messageMediaPhoto</a>/<a href="/constructor/messageMediaDocument">messageMediaDocument</a> (video) that can be downloaded and viewed <a href="/api/files">as usual »</a>. </li>
|
||||
<li><a href="/constructor/messageExtendedMedia">messageExtendedMedia</a>, for media the current user has already purchased, containing the actual <a href="/constructor/messageMediaPhoto">messageMediaPhoto</a>/<a href="/constructor/messageMediaDocument">messageMediaDocument</a> (video) that can be downloaded and viewed <a href="/api/files">as usual »</a>. </li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<p>To purchase paid media, follow the <a href="/api/payments#22-getting-invoice-info-about-the-product">usual payment flow »</a>, passing an <a href="/constructor/inputInvoiceMessage">inputInvoiceMessage</a> with the peer and message ID of the paid media. </p>
|
||||
<p>To purchase paid media, follow the <a href="/api/payments#22-getting-invoice-info-about-the-product">usual payment flow »</a>, passing an <a href="/constructor/inputInvoiceMessage">inputInvoiceMessage</a> with the peer and message ID of the paid media. </p>
|
||||
<p>Once the payment succeds, an <a href="/constructor/updateMessageExtendedMedia">updateMessageExtendedMedia</a> will be emitted, replacing the <a href="/constructor/messageExtendedMediaPreview">messageExtendedMediaPreview</a> constructors associated with the message with <a href="/constructor/messageExtendedMedia">messageExtendedMedia</a> constructors.<br>
|
||||
No other updates will be emitted (i.e. <strong>no</strong> <a href="/constructor/updateEditChannelMessage">updateEditChannelMessage</a> updates will be emitted for the message containing the paid media, even if re-fetching the same messages through other means like <a href="/method/messages.getHistory">messages.getHistory</a> <em>will</em> return the revealed <a href="/constructor/messageExtendedMedia">messageExtendedMedia</a> constructors).</p>
|
||||
<p>The associated <a href="/constructor/starsTransaction">starsTransaction</a> that will be generated will be of type <a href="/constructor/starsTransactionPeer">starsTransactionPeer</a> (with <code>peer</code> equal to the channel), <code>msg_id</code> equal to the message ID of the paid media and <code>extended_media</code> set to the revealed paid media. </p>
|
||||
<p><strong>Note</strong>: the <a href="/constructor/updateMessageExtendedMedia">updateMessageExtendedMedia</a> update does not have a <code>pts</code>/<code>qts</code> field.<br>
|
||||
This means that this update can only be received passively via the socket (<a href="/api/updates#event-sequences">see here »</a>), and it <strong>cannot</strong> be returned by <a href="/method/updates.getDifference">updates.getDifference</a> or <a href="/method/updates.getChannelDifference">updates.getChannelDifference</a>.<br>
|
||||
This means that this update can only be received passively via the socket (<a href="/api/updates#event-sequences">see here »</a>), and it <strong>cannot</strong> be returned by <a href="/method/updates.getDifference">updates.getDifference</a> or <a href="/method/updates.getChannelDifference">updates.getChannelDifference</a>.<br>
|
||||
This implies that if a certain client is offline, and another session purchases a paid media, the first client will not receive the revealed <a href="/constructor/messageExtendedMedia">messageExtendedMedia</a> constructors when it reconnects to the server, and it would have no way to know that a cached paid media can be revealed to the user. </p>
|
||||
<p>To bypass this issue, if:</p>
|
||||
<ul>
|
||||
|
|
|
@ -138,7 +138,7 @@ Look at the <a href="/passport">Passport Manual</a> to see how to request passpo
|
|||
<p>Note that all hashes are raw binary data, not hexits</p>
|
||||
</blockquote>
|
||||
<h4><a class="anchor" href="#credentials" id="credentials" name="credentials"><i class="anchor-icon"></i></a>Credentials</h4>
|
||||
<p>The credentials are a JSON-serialized object, structured exactly as in the <a href="/passport#credentials">bot API »</a>.
|
||||
<p>The credentials are a JSON-serialized object, structured exactly as in the <a href="/passport#credentials">bot API »</a>.
|
||||
Since decryption credentials are E2E encrypted, apps have to store the decryption credentials as JSON and not TL payloads.</p>
|
||||
<p>The credentials are used as described in the <a href="/passport#credentials">Passport Manual</a> to decrypt the files attached to the <a href="/constructor/secureValue">secureValue</a>.
|
||||
In this case, the container for the E2E encrypted data is in TL, while the encrypted data itself is in JSON.</p>
|
||||
|
@ -313,7 +313,7 @@ For more info on how to decrypt the <em>data</em> field, see the <a href="/passp
|
|||
---functions---
|
||||
|
||||
<a href='/method/upload.getFile'>upload.getFile</a>#be5335be flags:<a href='/type/%23'>#</a> precise:flags.0?<a href='/constructor/true'>true</a> cdn_supported:flags.1?<a href='/constructor/true'>true</a> location:<a href='/type/InputFileLocation'>InputFileLocation</a> offset:<a href='/type/long'>long</a> limit:<a href='/type/int'>int</a> = <a href='/type/upload.File'>upload.File</a>;</code></pre>
|
||||
<p>Files (JPG format when decrypted, max. 10 MB) are downloaded chunk by chunk as described in <a href="/api/files">files »</a>, except that instead of generating an <a href="/constructor/inputFile">inputFileLocation</a>, an <a href="/constructor/inputFileLocation">inputFileLocation</a> should be generated, instead.</p>
|
||||
<p>Files (JPG format when decrypted, max. 10 MB) are downloaded chunk by chunk as described in <a href="/api/files">files »</a>, except that instead of generating an <a href="/constructor/inputFile">inputFileLocation</a>, an <a href="/constructor/inputFileLocation">inputFileLocation</a> should be generated, instead.</p>
|
||||
<ul>
|
||||
<li>The <code>id</code> field is the <code>id</code> of the <a href="/constructor/secureFile">secureFile</a></li>
|
||||
<li>The <code>access_hash</code> field is the <code>access_hash</code> of the <a href="/constructor/secureFile">secureFile</a></li>
|
||||
|
@ -343,12 +343,12 @@ Emails and phone numbers sent using telegram passport are <em>already verified</
|
|||
|
||||
<a href='/method/users.setSecureValueErrors'>users.setSecureValueErrors</a>#90c894b5 id:<a href='/type/InputUser'>InputUser</a> errors:<a href='/type/Vector%20t'>Vector</a><<a href='/type/SecureValueError'>SecureValueError</a>> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>If the data you received contains errors, the bot can use the <a href="/method/users.setSecureValueErrors">users.setSecureValueErrors</a> method to inform the user and <a href="#requesting-information">request information</a> again. The user will not be able to resend the data, until all errors are fixed.</p>
|
||||
<p>Descriptions of the method parameters can be found in the method's <a href="/method/users.setSecureValueErrors">documentation page »</a>.</p>
|
||||
<p>Descriptions of the method parameters can be found in the method's <a href="/method/users.setSecureValueErrors">documentation page »</a>.</p>
|
||||
<h3><a class="anchor" href="#as-a-user" id="as-a-user" name="as-a-user"><i class="anchor-icon"></i></a>As a user</h3>
|
||||
<h4><a class="anchor" href="#receiving-requests" id="receiving-requests" name="receiving-requests"><i class="anchor-icon"></i></a>Receiving requests</h4>
|
||||
<p>The process starts when your app receives an event from one of the <a href="/passport#sdk">SDKs</a>, or from a custom source.</p>
|
||||
<h4><a class="anchor" href="#uri-format" id="uri-format" name="uri-format"><i class="anchor-icon"></i></a>URI format</h4>
|
||||
<p>The SDKs trigger a passport authorization request by opening the following <a href="/api/links">deep links »</a>:</p>
|
||||
<p>The SDKs trigger a passport authorization request by opening the following <a href="/api/links">deep links »</a>:</p>
|
||||
<p><code>tg:</code> syntax:</p>
|
||||
<pre><code>tg://passport?bot_id=<bot_user_id>&scope=<scope>&public_key=<public_key>&nonce=<nonce>
|
||||
tg://resolve?domain=telegrampassport&bot_id=<bot_user_id>&scope=<scope>&public_key=<public_key>&nonce=<nonce></code></pre>
|
||||
|
@ -565,7 +565,7 @@ tg://resolve?domain=telegrampassport&bot_id=<bot_user_id>&scope=&l
|
|||
</table>
|
||||
<p>You can also use the special type "idd" as an alias for one of "pp", "dl", "ic" and the special type "add" as an alias for one of "ub", "bs", "ra". </p>
|
||||
<h4><a class="anchor" href="#setting-up-telegram-passport" id="setting-up-telegram-passport" name="setting-up-telegram-passport"><i class="anchor-icon"></i></a>Setting up Telegram Passport</h4>
|
||||
<p>The next step for the client app is to request the user's 2FA passport, and configure Telegram Passport/fetch and decrypt remotely saved Telegram Passport parameters as described in the <a href="/passport/encryption">Encryption article »</a>.</p>
|
||||
<p>The next step for the client app is to request the user's 2FA passport, and configure Telegram Passport/fetch and decrypt remotely saved Telegram Passport parameters as described in the <a href="/passport/encryption">Encryption article »</a>.</p>
|
||||
<h4><a class="anchor" href="#fetching-the-passport-form" id="fetching-the-passport-form" name="fetching-the-passport-form"><i class="anchor-icon"></i></a>Fetching the passport form</h4>
|
||||
<pre><code><a href='/constructor/account.authorizationForm'>account.authorizationForm</a>#ad2e1cd8 flags:<a href='/type/%23'>#</a> required_types:<a href='/type/Vector%20t'>Vector</a><<a href='/type/SecureRequiredType'>SecureRequiredType</a>> values:<a href='/type/Vector%20t'>Vector</a><<a href='/type/SecureValue'>SecureValue</a>> errors:<a href='/type/Vector%20t'>Vector</a><<a href='/type/SecureValueError'>SecureValueError</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> privacy_policy_url:flags.0?<a href='/type/string'>string</a> = <a href='/type/account.AuthorizationForm'>account.AuthorizationForm</a>;
|
||||
|
||||
|
@ -575,7 +575,7 @@ tg://resolve?domain=telegrampassport&bot_id=<bot_user_id>&scope=&l
|
|||
<p>Then, the client app passes the bot ID, scope and public key from the <a href="#receiving-requests">passport authorization request</a> to the Telegram servers using the <a href="/method/account.getAuthorizationForm">account.getAuthorizationForm</a> method.</p>
|
||||
<p>The response will be an <a href="/constructor/account.authorizationForm">account.authorizationForm</a> constructor, with info about the required document types, the URL of the service's privacy policy, as well as info about the bot to which the form should be sent.
|
||||
If the form was already submitted at least once, the constructor will also contain a list of already submitted data, along with eventual errors. </p>
|
||||
<p>The user should accept the privacy policy and proceed to fill in the required data, and the client should encrypt and upload it as described in the <a href="/passport/encryption">Encryption article »</a>.</p>
|
||||
<p>The user should accept the privacy policy and proceed to fill in the required data, and the client should encrypt and upload it as described in the <a href="/passport/encryption">Encryption article »</a>.</p>
|
||||
<h4><a class="anchor" href="#submitting-the-passport-form" id="submitting-the-passport-form" name="submitting-the-passport-form"><i class="anchor-icon"></i></a>Submitting the passport form</h4>
|
||||
<pre><code><a href='/constructor/secureCredentialsEncrypted'>secureCredentialsEncrypted</a>#33f0ea47 data:<a href='/type/bytes'>bytes</a> hash:<a href='/type/bytes'>bytes</a> secret:<a href='/type/bytes'>bytes</a> = <a href='/type/SecureCredentialsEncrypted'>SecureCredentialsEncrypted</a>;
|
||||
|
||||
|
@ -587,8 +587,8 @@ If the form was already submitted at least once, the constructor will also conta
|
|||
<p>Once the user finishes uploading the required documents and clicks on the submit button, the client calls <a href="/method/account.acceptAuthorization">account.acceptAuthorization</a>, submitting the documents to the bot associated to the service.</p>
|
||||
<ul>
|
||||
<li>As before, <code>bot_id</code>, <code>scope</code> and <code>public_key</code> are taken from the authorization request URI.</li>
|
||||
<li><code>value_hashes</code> is used by the server to choose which document of which type to send to the bot: the <code>type</code> field should be set to the document type, and the <code>hash</code> field should be set to the <code>data_hash</code>/<code>file_hash</code> generated when <a href="/passport/encryption#encryption">uploading encrypting the data »</a>.</li>
|
||||
<li><code>credentials</code> contains the encrypted credentials required by the service to decrypt the sent E2E encrypted secure values: it is generated as described in <a href="/passport/encryption#passport-credentials">Passport Credentials »</a>.</li>
|
||||
<li><code>value_hashes</code> is used by the server to choose which document of which type to send to the bot: the <code>type</code> field should be set to the document type, and the <code>hash</code> field should be set to the <code>data_hash</code>/<code>file_hash</code> generated when <a href="/passport/encryption#encryption">uploading encrypting the data »</a>.</li>
|
||||
<li><code>credentials</code> contains the encrypted credentials required by the service to decrypt the sent E2E encrypted secure values: it is generated as described in <a href="/passport/encryption#passport-credentials">Passport Credentials »</a>.</li>
|
||||
</ul>
|
||||
<p>Finally, the client opens the callback URL (if present).</p>
|
||||
<h4><a class="anchor" href="#handling-invalid-forms" id="handling-invalid-forms" name="handling-invalid-forms"><i class="anchor-icon"></i></a>Handling invalid forms</h4>
|
||||
|
|
|
@ -55,7 +55,7 @@ For more info on how payments work, check out the <a href="https://telegram.org/
|
|||
<blockquote>
|
||||
<p>A simplified version of the process is available only for bots using the <a href="/bots/payments">bot API</a>.</p>
|
||||
</blockquote>
|
||||
<p>The first step for bots is <a href="/bots/payments#the-payments-api">enable payments as described here »</a>.</p>
|
||||
<p>The first step for bots is <a href="/bots/payments#the-payments-api">enable payments as described here »</a>.</p>
|
||||
<p>Then, we work with payments as follows.</p>
|
||||
<h3><a class="anchor" href="#1-create-invoice" id="1-create-invoice" name="1-create-invoice"><i class="anchor-icon"></i></a>1. Create Invoice</h3>
|
||||
<h4><a class="anchor" href="#11-create-invoice-message" id="11-create-invoice-message" name="11-create-invoice-message"><i class="anchor-icon"></i></a>1.1 Create Invoice Message</h4>
|
||||
|
@ -132,7 +132,7 @@ The first button of the keyboard will always be a <a href="/constructor/keyboard
|
|||
<ul>
|
||||
<li><a href="/constructor/inputInvoiceMessage">inputInvoiceMessage</a>, used:<ul>
|
||||
<li>If the user clicks on the <a href="/constructor/keyboardButtonBuy">keyboardButtonBuy</a> button, contains the message ID of the invoice preview message. </li>
|
||||
<li>When <a href="/api/paid-media">purchasing paid media »</a>.</li>
|
||||
<li>When <a href="/api/paid-media">purchasing paid media »</a>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="/constructor/inputInvoiceSlug">inputInvoiceSlug</a><ul>
|
||||
|
@ -144,13 +144,13 @@ The first button of the keyboard will always be a <a href="/constructor/keyboard
|
|||
<li>Used if the user wishes to start a channel <a href="/api/giveaways">giveaway</a> or send some <a href="/api/giveaways">giftcodes</a> to members of a channel, in exchange for <a href="/api/boost">boosts</a>.<br>
|
||||
The <code>purpose</code> field should be populated with <a href="/constructor/inputStorePaymentPremiumGiveaway">inputStorePaymentPremiumGiveaway</a> for <a href="/api/giveaways">giveaways</a> and <a href="/constructor/inputStorePaymentPremiumGiftCode">inputStorePaymentPremiumGiftCode</a> for <a href="/api/giveaways">gifts</a>.<br>
|
||||
The <code>option</code> field should be populated with one of the giveaway options returned by <a href="/method/payments.getPremiumGiftCodeOptions">payments.getPremiumGiftCodeOptions</a>.<br>
|
||||
See the <a href="/api/giveaways">giveaways »</a> documentation for more info. </li>
|
||||
See the <a href="/api/giveaways">giveaways »</a> documentation for more info. </li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="/constructor/inputInvoiceStars">inputInvoiceStars</a><ul>
|
||||
<li>Used to <a href="/api/stars#buying-or-gifting-stars">purchase Telegram Stars</a>.
|
||||
The <code>option</code> field should be populated with one of the star topup options returned by <a href="/method/payments.getStarsTopupOptions">payments.getStarsTopupOptions</a>.<br>
|
||||
See the <a href="/api/stars#buying-or-gifting-stars">stars »</a> documentation for more info. </li>
|
||||
See the <a href="/api/stars#buying-or-gifting-stars">stars »</a> documentation for more info. </li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -158,7 +158,7 @@ See the <a href="/api/stars#buying-or-gifting-stars">stars »</a> documentation
|
|||
The payment form also contains info about previously saved payment credentials and order information (name, phone number, email, shipping address & so on).</p>
|
||||
<p>The full <a href="/constructor/invoice">invoice</a> contains info about the information required for the order, the price and the currency, and whether this is a <code>test</code> order.
|
||||
The <code>recurring</code> flag will be set for recurring payments, and <code>recurring_terms_url</code> will link to the terms of service of the recurring payment: the user must read and accept them before continuing. </p>
|
||||
<p>A <a href="/constructor/payments.paymentFormStars">payments.paymentFormStars</a> will be returned if the payment is to be made using <a href="/api/stars">Telegram Stars, see here »</a> for more info (note that this constructor is used for payments in Telegram Stars to bots and peers, it will <strong>not</strong> be returned when <em>topping up</em> the Telegram Star balance of the current account using <a href="/constructor/inputInvoiceStars">inputInvoiceStars</a>): the associated invoice will use <code>XTR</code> as <code>currency</code>. </p>
|
||||
<p>A <a href="/constructor/payments.paymentFormStars">payments.paymentFormStars</a> will be returned if the payment is to be made using <a href="/api/stars">Telegram Stars, see here »</a> for more info (note that this constructor is used for payments in Telegram Stars to bots and peers, it will <strong>not</strong> be returned when <em>topping up</em> the Telegram Star balance of the current account using <a href="/constructor/inputInvoiceStars">inputInvoiceStars</a>): the associated invoice will use <code>XTR</code> as <code>currency</code>. </p>
|
||||
<h4><a class="anchor" href="#23-verifying-information" id="23-verifying-information" name="23-verifying-information"><i class="anchor-icon"></i></a>2.3 Verifying information</h4>
|
||||
<pre><code><a href='/constructor/invoice'>invoice</a>#5db95a15 flags:<a href='/type/%23'>#</a> test:flags.0?<a href='/constructor/true'>true</a> name_requested:flags.1?<a href='/constructor/true'>true</a> phone_requested:flags.2?<a href='/constructor/true'>true</a> email_requested:flags.3?<a href='/constructor/true'>true</a> shipping_address_requested:flags.4?<a href='/constructor/true'>true</a> flexible:flags.5?<a href='/constructor/true'>true</a> phone_to_provider:flags.6?<a href='/constructor/true'>true</a> email_to_provider:flags.7?<a href='/constructor/true'>true</a> recurring:flags.9?<a href='/constructor/true'>true</a> currency:<a href='/type/string'>string</a> prices:<a href='/type/Vector%20t'>Vector</a><<a href='/type/LabeledPrice'>LabeledPrice</a>> max_tip_amount:flags.8?<a href='/type/long'>long</a> suggested_tip_amounts:flags.8?<a href='/type/Vector%20t'>Vector</a><<a href='/type/long'>long</a>> terms_url:flags.10?<a href='/type/string'>string</a> = <a href='/type/Invoice'>Invoice</a>;
|
||||
|
||||
|
@ -175,7 +175,7 @@ The <code>recurring</code> flag will be set for recurring payments, and <code>re
|
|||
The user can choose to save order information for future use by setting the <code>save</code> flag.
|
||||
Data can be autofilled as described in <a href="#231-autofill">autofill</a>.</p>
|
||||
<p>If no errors are found in the submitted info, the <a href="/constructor/payments.ValidatedRequestedInfo">response</a> of the method will contain an <code>id</code> flag, to be used later to complete the payment.</p>
|
||||
<p>If the <code>flexible</code> flag of the invoice is set, calling the <a href="/method/payments.validateRequestedInfo">payments.validateRequestedInfo</a> method will send a <a href="/constructor/updateBotShippingQuery">shipping query update</a> to the bot, to which the bot will reply with the available shipping options for the specified address <a href="#24-select-delivery-option">as described here »</a>.
|
||||
<p>If the <code>flexible</code> flag of the invoice is set, calling the <a href="/method/payments.validateRequestedInfo">payments.validateRequestedInfo</a> method will send a <a href="/constructor/updateBotShippingQuery">shipping query update</a> to the bot, to which the bot will reply with the available shipping options for the specified address <a href="#24-select-delivery-option">as described here »</a>.
|
||||
The return value in this case will also contain a <code>shipping_options</code> field with the available shipping options.</p>
|
||||
<p>If any errors are found in the submitted data, a <a href="/constructor/updateServiceNotification">service notification</a> will be sent to the user, with a description of the error from the bot.</p>
|
||||
<h4><a class="anchor" href="#231-autofill" id="231-autofill" name="231-autofill"><i class="anchor-icon"></i></a>2.3.1 Autofill</h4>
|
||||
|
@ -216,11 +216,11 @@ The bot must respond using <a href="/method/messages.setBotShippingResults">mess
|
|||
---functions---
|
||||
|
||||
<a href='/method/payments.sendStarsForm'>payments.sendStarsForm</a>#02bb731d flags:<a href='/type/%23'>#</a> form_id:<a href='/type/long'>long</a> invoice:<a href='/type/InputInvoice'>InputInvoice</a> = <a href='/type/payments.PaymentResult'>payments.PaymentResult</a>;</code></pre>
|
||||
<p>A <a href="/constructor/payments.paymentFormStars">payments.paymentFormStars</a> will be returned if the payment should be made using <a href="/api/stars">Telegram Stars</a>, invoking <a href="/method/payments.sendStarsForm">payments.sendStarsForm</a> instead of <a href="/method/payments.sendPaymentForm">payments.sendPaymentForm</a> at <a href="#4-pre-checkout">step 4 »</a>. </p>
|
||||
<p>A <a href="/constructor/payments.paymentFormStars">payments.paymentFormStars</a> will be returned if the payment should be made using <a href="/api/stars">Telegram Stars</a>, invoking <a href="/method/payments.sendStarsForm">payments.sendStarsForm</a> instead of <a href="/method/payments.sendPaymentForm">payments.sendPaymentForm</a> at <a href="#4-pre-checkout">step 4 »</a>. </p>
|
||||
<p>Calling <a href="/method/payments.sendStarsForm">payments.sendStarsForm</a> twice with the same <code>form_id</code> will <strong>not</strong> repeat the transaction. </p>
|
||||
<p>Note that the returned form is only valid for 10 minutes, after which a call to <a href="/method/payments.sendStarsForm">payments.sendStarsForm</a> will return a <code>400</code> <code>FORM_EXPIRED</code> error.<br>
|
||||
When receiving this error, simply re-generate the form as specified in <a href="#22-getting-invoice-info-about-the-product">step 2.2 »</a> and re-call <a href="/method/payments.sendStarsForm">payments.sendStarsForm</a>. </p>
|
||||
<p>A <code>400</code> <code>BALANCE_TOO_LOW</code> error will be emitted by <a href="/method/payments.sendStarsForm">payments.sendStarsForm</a> if the current Telegram Stars balance is not enough to complete the transaction: when receiving this error, the client should invite the user to <a href="/api/stars#buying-or-gifting-stars">topup their Telegram Stars balance »</a>, before re-invoking <a href="/method/payments.sendStarsForm">payments.sendStarsForm</a>.</p>
|
||||
When receiving this error, simply re-generate the form as specified in <a href="#22-getting-invoice-info-about-the-product">step 2.2 »</a> and re-call <a href="/method/payments.sendStarsForm">payments.sendStarsForm</a>. </p>
|
||||
<p>A <code>400</code> <code>BALANCE_TOO_LOW</code> error will be emitted by <a href="/method/payments.sendStarsForm">payments.sendStarsForm</a> if the current Telegram Stars balance is not enough to complete the transaction: when receiving this error, the client should invite the user to <a href="/api/stars#buying-or-gifting-stars">topup their Telegram Stars balance »</a>, before re-invoking <a href="/method/payments.sendStarsForm">payments.sendStarsForm</a>.</p>
|
||||
<h4><a class="anchor" href="#32-web-payment" id="32-web-payment" name="32-web-payment"><i class="anchor-icon"></i></a>3.2 Web payment</h4>
|
||||
<pre><code><a href='/constructor/inputPaymentCredentials'>inputPaymentCredentials</a>#3417d728 flags:<a href='/type/%23'>#</a> save:flags.0?<a href='/constructor/true'>true</a> data:<a href='/type/DataJSON'>DataJSON</a> = <a href='/type/InputPaymentCredentials'>InputPaymentCredentials</a>;
|
||||
|
||||
|
@ -306,7 +306,7 @@ Full credit card info <strong>is not</strong> saved on Telegram Servers, and can
|
|||
<a href='/method/payments.sendPaymentForm'>payments.sendPaymentForm</a>#2d03522f flags:<a href='/type/%23'>#</a> form_id:<a href='/type/long'>long</a> invoice:<a href='/type/InputInvoice'>InputInvoice</a> requested_info_id:flags.0?<a href='/type/string'>string</a> shipping_option_id:flags.1?<a href='/type/string'>string</a> credentials:<a href='/type/InputPaymentCredentials'>InputPaymentCredentials</a> tip_amount:flags.2?<a href='/type/long'>long</a> = <a href='/type/payments.PaymentResult'>payments.PaymentResult</a>;
|
||||
|
||||
<a href='/method/payments.sendStarsForm'>payments.sendStarsForm</a>#02bb731d flags:<a href='/type/%23'>#</a> form_id:<a href='/type/long'>long</a> invoice:<a href='/type/InputInvoice'>InputInvoice</a> = <a href='/type/payments.PaymentResult'>payments.PaymentResult</a>;</code></pre>
|
||||
<p>After <a href="#23-verifying-information">verifying order information</a>, the final step for the client is to call <a href="/method/payments.sendPaymentForm">payments.sendPaymentForm</a> or <a href="/method/payments.sendStarsForm">payments.sendStarsForm</a> for <a href="#31-star-payment">payments using Telegram Stars »</a>, with the following parameters:</p>
|
||||
<p>After <a href="#23-verifying-information">verifying order information</a>, the final step for the client is to call <a href="/method/payments.sendPaymentForm">payments.sendPaymentForm</a> or <a href="/method/payments.sendStarsForm">payments.sendStarsForm</a> for <a href="#31-star-payment">payments using Telegram Stars »</a>, with the following parameters:</p>
|
||||
<ul>
|
||||
<li>The <code>form_id</code> is set to the ID of the form</li>
|
||||
<li>The <code>invoice</code> is set to the previously passed invoice</li>
|
||||
|
@ -373,7 +373,7 @@ Further recurring payments will automatically send <a href="/constructor/message
|
|||
---functions---
|
||||
|
||||
<a href='/method/payments.refundStarsCharge'>payments.refundStarsCharge</a>#25ae8f4a user_id:<a href='/type/InputUser'>InputUser</a> charge_id:<a href='/type/string'>string</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||
<p>Payments made using <a href="/api/stars">Telegram Stars »</a> may be refunded <em>by the user/bot that received them</em> by invoking <a href="/method/payments.refundStarsCharge">payments.refundStarsCharge</a>, passing to <code>user_id</code> the ID of the user that did the payment, and to <code>charge_id</code> the <code>provider_charge_id</code> from the <a href="/constructor/messageActionPaymentSentMe">messageActionPaymentSentMe</a> service message action of the incoming payment. </p>
|
||||
<p>Payments made using <a href="/api/stars">Telegram Stars »</a> may be refunded <em>by the user/bot that received them</em> by invoking <a href="/method/payments.refundStarsCharge">payments.refundStarsCharge</a>, passing to <code>user_id</code> the ID of the user that did the payment, and to <code>charge_id</code> the <code>provider_charge_id</code> from the <a href="/constructor/messageActionPaymentSentMe">messageActionPaymentSentMe</a> service message action of the incoming payment. </p>
|
||||
<p>This will emit a <a href="/constructor/messageActionPaymentRefunded">messageActionPaymentRefunded</a> service message.</p></div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -87,15 +87,15 @@
|
|||
<a href='/method/channels.getChannels'>channels.getChannels</a>#a7f6bbb id:<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputChannel'>InputChannel</a>> = <a href='/type/messages.Chats'>messages.Chats</a>;</code></pre>
|
||||
<p>The peer info database contains the following information: </p>
|
||||
<ul>
|
||||
<li>The <a href="#peer-id">peer ID »</a></li>
|
||||
<li>The <a href="#access-hash">access hash »</a></li>
|
||||
<li><a href="#other-info">Other info »</a></li>
|
||||
<li>The <a href="#peer-id">peer ID »</a></li>
|
||||
<li>The <a href="#access-hash">access hash »</a></li>
|
||||
<li><a href="#other-info">Other info »</a></li>
|
||||
</ul>
|
||||
<p>And it must be populated as follows:</p>
|
||||
<ul>
|
||||
<li><a href="#saving-constructors">By saving received user, chat, channel constructors »</a></li>
|
||||
<li><a href="#handling-certain-updates">By handling certain updates »</a></li>
|
||||
<li><a href="#manual-refreshes">By manual refreshes »</a></li>
|
||||
<li><a href="#saving-constructors">By saving received user, chat, channel constructors »</a></li>
|
||||
<li><a href="#handling-certain-updates">By handling certain updates »</a></li>
|
||||
<li><a href="#manual-refreshes">By manual refreshes »</a></li>
|
||||
</ul>
|
||||
<p>Example implementation: <a href="https://github.com/tdlib/td/">tdlib</a>.</p>
|
||||
<h4><a class="anchor" href="#saving-constructors" id="saving-constructors" name="saving-constructors"><i class="anchor-icon"></i></a>Saving constructors</h4>
|
||||
|
@ -170,18 +170,18 @@ If a <a href="/method/contacts.getStatuses">contacts.getStatuses</a> query fails
|
|||
<p>Note that the ID sequences of users, chats and channels <strong>overlap</strong>, so you must either:</p>
|
||||
<ul>
|
||||
<li>Use separate tables/hashmaps for <a href="/constructor/user">user</a>s, <a href="/constructor/chat">chat</a>s and <a href="/constructor/channel">channel</a>s OR</li>
|
||||
<li>Transform the peer IDs to bot API IDs as specified <a href="/api/bots/ids">here »</a>, which will allow you to use a single ID sequence (and database) for all three peer types, maintaining uniqueness.<br>
|
||||
<li>Transform the peer IDs to bot API IDs as specified <a href="/api/bots/ids">here »</a>, which will allow you to use a single ID sequence (and database) for all three peer types, maintaining uniqueness.<br>
|
||||
In this case, a single table <em>can</em> be used for all peer types, but since the structures of the constructors are different, to avoid useless typechecks it might be a good idea to use three tables, as with the first approach. </li>
|
||||
</ul>
|
||||
<p>It's a good idea to transform peer IDs to <a href="/api/bots/ids">bot API IDs</a> even if you do decide to use separate databases, as it will make IDs more visually recognizable both for you and your users, as well as guarantee compatibility with the bot API.</p>
|
||||
<h4><a class="anchor" href="#access-hash" id="access-hash" name="access-hash"><i class="anchor-icon"></i></a>Access hash</h4>
|
||||
<p>The <code>access_hash</code> is the second most important field stored in the <a href="#peer-info-database">peer database</a>, used to generate <a href="/type/InputPeer">InputPeer</a>, <a href="/type/InputUser">inputUser</a>, <a href="/type/InputChannel">inputChannel</a> constructors used to interact with peers in the API.<br>
|
||||
Note that <a href="/constructor/chat">chat</a>s (<a href="/api/channel">basic groups »</a>) do not have or need an access hash.<br>
|
||||
<a href="/constructor/user">user</a>s and <a href="/constructor/channel">channel</a>s (<a href="/api/channel">supergroups and channels »</a>) have an access hash, and it can come in various flavors:</p>
|
||||
Note that <a href="/constructor/chat">chat</a>s (<a href="/api/channel">basic groups »</a>) do not have or need an access hash.<br>
|
||||
<a href="/constructor/user">user</a>s and <a href="/constructor/channel">channel</a>s (<a href="/api/channel">supergroups and channels »</a>) have an access hash, and it can come in various flavors:</p>
|
||||
<ul>
|
||||
<li>Full access hash: can be used everywhere in the API.</li>
|
||||
<li>Min access hash: received from <a href="/api/min">min constructors »</a>, can only be used to fetch profile pictures using <a href="/constructor/inputPeerPhotoFileLocation"><code>inputPeerPhotoFileLocation</code> »</a>. </li>
|
||||
<li>From-message access hash: not a real access hash, constructed as specified <a href="/api/min">here »</a>, must be used when only a min access hash is available locally, but a full access hash is required. </li>
|
||||
<li>Min access hash: received from <a href="/api/min">min constructors »</a>, can only be used to fetch profile pictures using <a href="/constructor/inputPeerPhotoFileLocation"><code>inputPeerPhotoFileLocation</code> »</a>. </li>
|
||||
<li>From-message access hash: not a real access hash, constructed as specified <a href="/api/min">here »</a>, must be used when only a min access hash is available locally, but a full access hash is required. </li>
|
||||
<li>Zero access hash: equal to <code>0</code>, must be used by bots when only a min access hash (or no access hash) is available locally, but a full access hash is required. </li>
|
||||
</ul>
|
||||
<p>The access hash versions listed above are listed in descending priority, and if a version with higher priority is currently cached, it must not be overwritten with a lower priority version. </p>
|
||||
|
@ -192,7 +192,7 @@ This is a core spam prevention feature of Telegram. </p>
|
|||
<p>Note: some other, non-peer-related constructors (i.e. not <a href="/constructor/user">user</a>, <a href="/constructor/chat">chat</a> or <a href="/constructor/channel">channel</a>) may also contain access hashes, which should be stored in a different database. </p>
|
||||
<h4><a class="anchor" href="#other-info" id="other-info" name="other-info"><i class="anchor-icon"></i></a>Other info</h4>
|
||||
<p>Various other fields commonly used by the client, as specified in the constructor pages (<a href="/constructor/user">user</a>, <a href="/constructor/chat">chat</a> and <a href="/constructor/channel">channel</a>).<br>
|
||||
As specified in the constructor docs, some of the fields must not be overwritten if a <a href="/api/min">min constructor</a> is received, and a change in some other fields must trigger invalidation of the <a href="#full-info-database">full info database »</a>. </p>
|
||||
As specified in the constructor docs, some of the fields must not be overwritten if a <a href="/api/min">min constructor</a> is received, and a change in some other fields must trigger invalidation of the <a href="#full-info-database">full info database »</a>. </p>
|
||||
<h3><a class="anchor" href="#full-info-database" id="full-info-database" name="full-info-database"><i class="anchor-icon"></i></a>Full info database</h3>
|
||||
<pre><code><a href='/constructor/users.userFull'>users.userFull</a>#3b6d152e full_user:<a href='/type/UserFull'>UserFull</a> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/users.UserFull'>users.UserFull</a>;
|
||||
<a href='/constructor/messages.chatFull'>messages.chatFull</a>#e5d7d19c full_chat:<a href='/type/ChatFull'>ChatFull</a> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/messages.ChatFull'>messages.ChatFull</a>;
|
||||
|
@ -208,13 +208,13 @@ As specified in the constructor docs, some of the fields must not be overwritten
|
|||
<a href='/method/channels.getFullChannel'>channels.getFullChannel</a>#8736a09 channel:<a href='/type/InputChannel'>InputChannel</a> = <a href='/type/messages.ChatFull'>messages.ChatFull</a>;</code></pre>
|
||||
<p>Example implementation: <a href="https://github.com/tdlib/td/">tdlib</a>.</p>
|
||||
<p>The full info database contains info from the <a href="/constructor/userFull">userFull</a>, <a href="/constructor/chatFull">chatFull</a> and <a href="/constructor/channelFull">channelFull</a> constructors. </p>
|
||||
<p>To populate the full info database for a peer, invoke <a href="/method/users.getFullUser">users.getFullUser</a>, <a href="/method/messages.getFullChat">messages.getFullChat</a>, <a href="/method/channels.getFullChannel">channels.getFullChannel</a>, all requiring the previously cached <a href="#access-hash">access_hash »</a>. </p>
|
||||
<p>To populate the full info database for a peer, invoke <a href="/method/users.getFullUser">users.getFullUser</a>, <a href="/method/messages.getFullChat">messages.getFullChat</a>, <a href="/method/channels.getFullChannel">channels.getFullChannel</a>, all requiring the previously cached <a href="#access-hash">access_hash »</a>. </p>
|
||||
<p>Invalidate only <a href="/constructor/userFull">userFull</a> and <a href="/constructor/channelFull">channelFull</a> entries 60 seconds after they are stored.</p>
|
||||
<p>Refresh the full info database when the client needs some data from a full constructor, <strong>and</strong> there is no entry already in the database, or the required entry was invalidated by the TTL, or if:</p>
|
||||
<ul>
|
||||
<li>Some event (specified <a href="#peer-info-database">here »</a>) changes the value of a very specific subset of fields of an entry in the (non-full!) <a href="#peer-info-database">peer info database »</a>.<br>
|
||||
<li>Some event (specified <a href="#peer-info-database">here »</a>) changes the value of a very specific subset of fields of an entry in the (non-full!) <a href="#peer-info-database">peer info database »</a>.<br>
|
||||
See the documentation in the <a href="/constructor/user">user</a> and <a href="/constructor/channel">channel</a> constructor pages for more info (search for the keyword "invalidate"). </li>
|
||||
<li>When receiving an <a href="/constructor/updateUser">updateUser</a>, <a href="/constructor/updateChat">updateChat</a>, <a href="/constructor/updateChannel">updateChannel</a>, and some other updates, as specified <a href="/type/Update">here »</a></li>
|
||||
<li>When receiving an <a href="/constructor/updateUser">updateUser</a>, <a href="/constructor/updateChat">updateChat</a>, <a href="/constructor/updateChannel">updateChannel</a>, and some other updates, as specified <a href="/type/Update">here »</a></li>
|
||||
<li>After invoking <a href="/method/bots.setBotInfo">bots.setBotInfo</a> (even on error) after changing <code>about</code> or <code>description</code> (but <strong>not</strong> <code>name</code>), for the bot whose info we changed.</li>
|
||||
<li>After invoking <a href="/method/messages.setChatWallPaper">messages.setChatWallPaper</a> to <em>remove</em> the wallpaper and receiving an error, for the peer whose wallpapers we tried to change, to fetch the correct and updated wallpaper settings. </li>
|
||||
<li>After invoking <a href="/method/messages.setChatAvailableReactions">messages.setChatAvailableReactions</a> and getting an error different from <code>CHAT_NOT_MODIFIED</code>, for the peer whose reaction settings we tried to change. </li>
|
||||
|
@ -223,7 +223,7 @@ See the documentation in the <a href="/constructor/user">user</a> and <a href="/
|
|||
<li>The <a href="/constructor/channelFull">channelFull</a>.<code>linked_chat_id</code> of channnel/supergroup A is updated to point to channel/supergroup B, but the <a href="/constructor/channelFull">channelFull</a>.<code>linked_chat_id</code> of channel/supergroup B does not point to channel/supergroup A, refresh the <a href="/constructor/channelFull">channelFull</a> of channel/supergroup B.</li>
|
||||
<li>Info about a bot that is a participant to the channel/supergroup is fetched by other means, but the bot is not contained in <a href="/constructor/channelFull">channelFull</a>.<code>bot_info</code>. </li>
|
||||
<li>If <a href="/constructor/channelFull">channelFull</a>.<code>participants_count</code> is less than <a href="/constructor/channelFull">channelFull</a>.<code>admins_count</code> after a local update of the admin list by other means.</li>
|
||||
<li>If the currently logged in user's <a href="/constructor/inputPrivacyKeyStatusTimestamp">inputPrivacyKeyStatusTimestamp</a> <a href="/api/privacy">privacy setting »</a> was changed, refresh the entire <a href="/constructor/userFull">userFull</a> cache for all users. </li>
|
||||
<li>If the currently logged in user's <a href="/constructor/inputPrivacyKeyStatusTimestamp">inputPrivacyKeyStatusTimestamp</a> <a href="/api/privacy">privacy setting »</a> was changed, refresh the entire <a href="/constructor/userFull">userFull</a> cache for all users. </li>
|
||||
<li>After receiving an error different from <code>USER_NOT_PARTICIPANT</code> when calling <a href="/method/channels.leaveChannel">channels.leaveChannel</a></li>
|
||||
<li>If the profile picture is updated or removed</li>
|
||||
<li>After successfully invoking any of the following methods, for the bot in question:<ul>
|
||||
|
|
|
@ -80,22 +80,22 @@ Clicking on this button in the settings, clicking on the <a href="#badge">badge<
|
|||
<li>
|
||||
<p><code>stories</code> - Premium users have various <a href="/api/stories">Story</a>-related improvements:</p>
|
||||
<ul>
|
||||
<li>Stories posted by Premium users are shown first to users when fetching the list of active stories with <a href="/method/stories.getAllStories">stories.getAllStories »</a>. </li>
|
||||
<li>Premium users can activate <a href="/api/stories#stealth-mode">stealth mode »</a></li>
|
||||
<li>Premium users can <a href="/api/stories#fetching-the-interaction-list">fetch the full viewer list of stories, even after they expire »</a></li>
|
||||
<li>Premium users can set <a href="/api/stories">custom expiration options when posting stories »</a></li>
|
||||
<li>Premium users can post stories with longer captions, as specified by the <a href="/api/config#story-caption-length-limit-default"><code>story_caption_length_limit_*</code> »</a> config keys.</li>
|
||||
<li>Premium users can add more <a href="/api/stories#media-areas">story reaction media areas »</a> to a story, as specified by the <a href="/api/config#stories-suggested-reactions-limit-default"><code>stories_suggested_reactions_limit_*</code> »</a> config keys.</li>
|
||||
<li>Premium users can <a href="/api/entities">styled text entities</a> and links in story captions, as specified by the <a href="/api/config#stories-entities">stories_entities »</a> config key.</li>
|
||||
<li>Stories posted by Premium users are shown first to users when fetching the list of active stories with <a href="/method/stories.getAllStories">stories.getAllStories »</a>. </li>
|
||||
<li>Premium users can activate <a href="/api/stories#stealth-mode">stealth mode »</a></li>
|
||||
<li>Premium users can <a href="/api/stories#fetching-the-interaction-list">fetch the full viewer list of stories, even after they expire »</a></li>
|
||||
<li>Premium users can set <a href="/api/stories">custom expiration options when posting stories »</a></li>
|
||||
<li>Premium users can post stories with longer captions, as specified by the <a href="/api/config#story-caption-length-limit-default"><code>story_caption_length_limit_*</code> »</a> config keys.</li>
|
||||
<li>Premium users can add more <a href="/api/stories#media-areas">story reaction media areas »</a> to a story, as specified by the <a href="/api/config#stories-suggested-reactions-limit-default"><code>stories_suggested_reactions_limit_*</code> »</a> config keys.</li>
|
||||
<li>Premium users can <a href="/api/entities">styled text entities</a> and links in story captions, as specified by the <a href="/api/config#stories-entities">stories_entities »</a> config key.</li>
|
||||
<li>Premium users can download non-protected stories.</li>
|
||||
</ul>
|
||||
<p>See the <a href="/api/stories">stories documentation »</a> for more information on stories.</p>
|
||||
<p>See the <a href="/api/stories">stories documentation »</a> for more information on stories.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>double_limits</code> - Clicking on this entry should open a secondary popup with a list of the <a href="#premium-limits">improved Premium limits »</a>.</p>
|
||||
<p><code>double_limits</code> - Clicking on this entry should open a secondary popup with a list of the <a href="#premium-limits">improved Premium limits »</a>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>business</code> - Premium users currently have access to <a href="/api/business">Telegram Business features »</a>. </p>
|
||||
<p><code>business</code> - Premium users currently have access to <a href="/api/business">Telegram Business features »</a>. </p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>last_seen</code> - Premium users can view the last seen and message read times of other users even they can't view the last seen or read time for the current user. </p>
|
||||
|
@ -107,7 +107,7 @@ Clicking on this button in the settings, clicking on the <a href="#badge">badge<
|
|||
<p><code>more_upload</code> - Premium users can upload bigger files, as specified by the <a href="/api/config#upload-max-fileparts-default">upload_max_fileparts_default</a> vs <a href="/api/config#upload-max-fileparts-premium">upload_max_fileparts_premium</a> config keys.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>faster_download</code> - Premium users have no download speed limits (i.e. they can't receive <code>FLOOD_PREMIUM_WAIT_X</code> errors when downloading files, see <a href="/api/files">here »</a> for more info).</p>
|
||||
<p><code>faster_download</code> - Premium users have no download speed limits (i.e. they can't receive <code>FLOOD_PREMIUM_WAIT_X</code> errors when downloading files, see <a href="/api/files">here »</a> for more info).</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>wallpapers</code> - Premium users <a href="/api/wallpapers#installing-wallpapers-in-a-specific-chat-or-channel">can set custom chat wallpapers both for them and the other user in the chat</a>.</p>
|
||||
|
@ -190,7 +190,7 @@ Clicking on this button in the settings, clicking on the <a href="#badge">badge<
|
|||
<h4><a class="anchor" href="#animated-profile-pictures" id="animated-profile-pictures" name="animated-profile-pictures"><i class="anchor-icon"></i></a>Animated profile pictures</h4>
|
||||
<p>The <a href="/api/files#animated-profile-pictures">animated profile pictures</a> of Premium users should play inside of chats and dialog lists, and not just when opening the profile page.</p>
|
||||
<h4><a class="anchor" href="#sticker-suggestions" id="sticker-suggestions" name="sticker-suggestions"><i class="anchor-icon"></i></a>Sticker suggestions</h4>
|
||||
<p>The suggested sticker selection logic is slightly different for Premium users, see <a href="/api/stickers#sticker-suggestions">here for more info »</a>.</p>
|
||||
<p>The suggested sticker selection logic is slightly different for Premium users, see <a href="/api/stickers#sticker-suggestions">here for more info »</a>.</p>
|
||||
<h3><a class="anchor" href="#subscribing-to-telegram-premium" id="subscribing-to-telegram-premium" name="subscribing-to-telegram-premium"><i class="anchor-icon"></i></a>Subscribing to Telegram Premium</h3>
|
||||
<p>Here's how to activate a Telegram Premium subscription, when the user clicks on the subscribe button:</p>
|
||||
<ul>
|
||||
|
@ -210,7 +210,7 @@ Then, when the user clicks on the subscribe button in the sent invoice, follow t
|
|||
</ul>
|
||||
<p>There is also a store-based subscription flow based on <a href="/method/payments.assignAppStoreTransaction">payments.assignAppStoreTransaction</a>/<a href="/method/payments.assignPlayMarketTransaction">payments.assignPlayMarketTransaction</a>, but it's currently not available to third-party apps (unlike the flow described above, which can be used by all clients).</p>
|
||||
<h3><a class="anchor" href="#gifting-telegram-premium" id="gifting-telegram-premium" name="gifting-telegram-premium"><i class="anchor-icon"></i></a>Gifting Telegram Premium</h3>
|
||||
<p>Note: to gift a Premium subscriptions to multiple friends, the alternative payment flow <a href="/api/giveaways">described here »</a> (<a href="/constructor/inputStorePaymentPremiumGiftCode">inputStorePaymentPremiumGiftCode</a> without setting <code>boost_peer</code>) must be used, instead. </p>
|
||||
<p>Note: to gift a Premium subscriptions to multiple friends, the alternative payment flow <a href="/api/giveaways">described here »</a> (<a href="/constructor/inputStorePaymentPremiumGiftCode">inputStorePaymentPremiumGiftCode</a> without setting <code>boost_peer</code>) must be used, instead. </p>
|
||||
<pre><code><a href='/constructor/userFull'>userFull</a>#cc997720 flags:<a href='/type/%23'>#</a> blocked:flags.0?<a href='/constructor/true'>true</a> phone_calls_available:flags.4?<a href='/constructor/true'>true</a> phone_calls_private:flags.5?<a href='/constructor/true'>true</a> can_pin_message:flags.7?<a href='/constructor/true'>true</a> has_scheduled:flags.12?<a href='/constructor/true'>true</a> video_calls_available:flags.13?<a href='/constructor/true'>true</a> voice_messages_forbidden:flags.20?<a href='/constructor/true'>true</a> translations_disabled:flags.23?<a href='/constructor/true'>true</a> stories_pinned_available:flags.26?<a href='/constructor/true'>true</a> blocked_my_stories_from:flags.27?<a href='/constructor/true'>true</a> wallpaper_overridden:flags.28?<a href='/constructor/true'>true</a> contact_require_premium:flags.29?<a href='/constructor/true'>true</a> read_dates_private:flags.30?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> sponsored_enabled:flags2.7?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:flags.1?<a href='/type/string'>string</a> settings:<a href='/type/PeerSettings'>PeerSettings</a> personal_photo:flags.21?<a href='/type/Photo'>Photo</a> profile_photo:flags.2?<a href='/type/Photo'>Photo</a> fallback_photo:flags.22?<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> bot_info:flags.3?<a href='/type/BotInfo'>BotInfo</a> pinned_msg_id:flags.6?<a href='/type/int'>int</a> common_chats_count:<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> ttl_period:flags.14?<a href='/type/int'>int</a> theme_emoticon:flags.15?<a href='/type/string'>string</a> private_forward_name:flags.16?<a href='/type/string'>string</a> bot_group_admin_rights:flags.17?<a href='/type/ChatAdminRights'>ChatAdminRights</a> bot_broadcast_admin_rights:flags.18?<a href='/type/ChatAdminRights'>ChatAdminRights</a> premium_gifts:flags.19?<a href='/type/Vector%20t'>Vector</a><<a href='/type/PremiumGiftOption'>PremiumGiftOption</a>> wallpaper:flags.24?<a href='/type/WallPaper'>WallPaper</a> stories:flags.25?<a href='/type/PeerStories'>PeerStories</a> business_work_hours:flags2.0?<a href='/type/BusinessWorkHours'>BusinessWorkHours</a> business_location:flags2.1?<a href='/type/BusinessLocation'>BusinessLocation</a> business_greeting_message:flags2.2?<a href='/type/BusinessGreetingMessage'>BusinessGreetingMessage</a> business_away_message:flags2.3?<a href='/type/BusinessAwayMessage'>BusinessAwayMessage</a> business_intro:flags2.4?<a href='/type/BusinessIntro'>BusinessIntro</a> birthday:flags2.5?<a href='/type/Birthday'>Birthday</a> personal_channel_id:flags2.6?<a href='/type/long'>long</a> personal_channel_message:flags2.6?<a href='/type/int'>int</a> = <a href='/type/UserFull'>UserFull</a>;
|
||||
|
||||
<a href='/constructor/premiumGiftOption'>premiumGiftOption</a>#74c34319 flags:<a href='/type/%23'>#</a> months:<a href='/type/int'>int</a> currency:<a href='/type/string'>string</a> amount:<a href='/type/long'>long</a> bot_url:<a href='/type/string'>string</a> store_product:flags.0?<a href='/type/string'>string</a> = <a href='/type/PremiumGiftOption'>PremiumGiftOption</a>;
|
||||
|
@ -228,8 +228,8 @@ Then, when the user clicks on the subscribe button in the sent invoice, follow t
|
|||
Clients should display this message, along with a sticker from the <a href="/constructor/inputStickerSetPremiumGifts">inputStickerSetPremiumGifts</a> <a href="/api/stickers">stickerset</a>: here's an <a href="https://telegram.org/blog/custom-emoji#gifting-telegram-premium">example</a>. </p>
|
||||
<p>Note that if the <code>premium_gift_attach_menu_icon</code> <a href="/api/config#client-configuration">app configuration parameter</a> is <code>true</code>, a gift icon should be shown in the attachment menu in private chats with users, offering the current user to gift a <a href="/api/premium">Telegram Premium</a> subscription to the other user in the chat. </p>
|
||||
<p>If the <code>premium_gift_text_field_icon</code> parameter is also set, a gift icon should be shown in the text bar in private chats with users (ie like the <code>/</code> icon in chats with bots), offering the current user to gift a <a href="/api/premium">Telegram Premium</a> subscription to the other user in the chat. Can only be true if <code>premium_gift_attach_menu_icon</code> is also true.</p>
|
||||
<p>Note that even if the <code>premium_gifts</code> field is not set, we can still gift one (or more!) Premium subscriptions using the alternative payment flow <a href="/api/giveaways">described here »</a> (<a href="/constructor/inputStorePaymentPremiumGiftCode">inputStorePaymentPremiumGiftCode</a> without setting <code>boost_peer</code>). </p>
|
||||
<p>Gifting a <a href="/api/premium">Telegram Premium</a> subscription to another user will create <a href="/api/config#boosts-per-sent-gift">boosts_per_sent_gift</a> <a href="/api/boost">boost slots »</a> for us, and one boost slot for the destination user. </p>
|
||||
<p>Note that even if the <code>premium_gifts</code> field is not set, we can still gift one (or more!) Premium subscriptions using the alternative payment flow <a href="/api/giveaways">described here »</a> (<a href="/constructor/inputStorePaymentPremiumGiftCode">inputStorePaymentPremiumGiftCode</a> without setting <code>boost_peer</code>). </p>
|
||||
<p>Gifting a <a href="/api/premium">Telegram Premium</a> subscription to another user will create <a href="/api/config#boosts-per-sent-gift">boosts_per_sent_gift</a> <a href="/api/boost">boost slots »</a> for us, and one boost slot for the destination user. </p>
|
||||
<h3><a class="anchor" href="#blocked-telegram-premium" id="blocked-telegram-premium" name="blocked-telegram-premium"><i class="anchor-icon"></i></a>Blocked Telegram Premium</h3>
|
||||
<p>If the <code>premium_purchase_blocked</code> <a href="/api/config#client-configuration">app configuration parameter</a> is set, the user can't purchase a Premium account, and all Telegram Premium features must be hidden (like the <a href="#badge">badges</a> of Premium users, Telegram Premium purchase buttons, and so on).</p></div>
|
||||
|
||||
|
|
|
@ -76,9 +76,9 @@
|
|||
<a href='/method/contacts.editCloseFriends'>contacts.editCloseFriends</a>#ba6705f0 id:<a href='/type/Vector%20t'>Vector</a><<a href='/type/long'>long</a>> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>Privacy <strong>rules</strong> indicate <em>who</em> can or can't do something and are specified by a <a href="/type/PrivacyRule">PrivacyRule</a>, and its input counterpart <a href="/type/InputPrivacyRule">InputPrivacyRule</a>.<br>
|
||||
<a href="/type/InputPrivacyRule">InputPrivacyRule</a> constructors are <em>passed</em> as input to methods that accept privacy rules, while <a href="/type/PrivacyRule">PrivacyRule</a>s are contained in constructors <em>returned</em> by the API. </p>
|
||||
<p>See <a href="/type/InputPrivacyRule">the type page »</a> for a full list of privacy rules and their descriptions. </p>
|
||||
<p>One privacy rule in particular should be mentioned separately, (input)<a href="/constructor/privacyValueAllowCloseFriends">privacyValueAllowCloseFriends</a>: this privacy rule, which can be used only when <a href="/api/stories">posting stories</a>, refers exclusively to a list of "close friends", that can be modified using <a href="/method/contacts.editCloseFriends">contacts.editCloseFriends</a>, passing the full close friend list as a list of user IDs: note that only users <a href="/api/contacts">in the contact list (even without a phone number) »</a> can be added to the close friends list. </p>
|
||||
<p>The current list of close friends can be checking which users in our contact list have the <code>close_friend</code> flag set in the associated <a href="/constructor/user">user</a> constructor, see <a href="/api/contacts#fetching-the-contact-list">here »</a> for more info on how to fetch the contact list.</p>
|
||||
<p>See <a href="/type/InputPrivacyRule">the type page »</a> for a full list of privacy rules and their descriptions. </p>
|
||||
<p>One privacy rule in particular should be mentioned separately, (input)<a href="/constructor/privacyValueAllowCloseFriends">privacyValueAllowCloseFriends</a>: this privacy rule, which can be used only when <a href="/api/stories">posting stories</a>, refers exclusively to a list of "close friends", that can be modified using <a href="/method/contacts.editCloseFriends">contacts.editCloseFriends</a>, passing the full close friend list as a list of user IDs: note that only users <a href="/api/contacts">in the contact list (even without a phone number) »</a> can be added to the close friends list. </p>
|
||||
<p>The current list of close friends can be checking which users in our contact list have the <code>close_friend</code> flag set in the associated <a href="/constructor/user">user</a> constructor, see <a href="/api/contacts#fetching-the-contact-list">here »</a> for more info on how to fetch the contact list.</p>
|
||||
<h3><a class="anchor" href="#privacy-keys" id="privacy-keys" name="privacy-keys"><i class="anchor-icon"></i></a>Privacy keys</h3>
|
||||
<p>Schema:</p>
|
||||
<pre><code><a href='/constructor/inputPrivacyKeyStatusTimestamp'>inputPrivacyKeyStatusTimestamp</a>#4f96cb18 = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
|
||||
|
@ -112,9 +112,9 @@
|
|||
|
||||
<a href='/method/account.getPrivacy'>account.getPrivacy</a>#dadbc950 key:<a href='/type/InputPrivacyKey'>InputPrivacyKey</a> = <a href='/type/account.PrivacyRules'>account.PrivacyRules</a>;
|
||||
<a href='/method/account.setPrivacy'>account.setPrivacy</a>#c9f81ce8 key:<a href='/type/InputPrivacyKey'>InputPrivacyKey</a> rules:<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputPrivacyRule'>InputPrivacyRule</a>> = <a href='/type/account.PrivacyRules'>account.PrivacyRules</a>;</code></pre>
|
||||
<p>Privacy <strong>keys</strong> together with <a href="#privacy-rules">privacy rules »</a> indicate <em>what</em> can or can't someone do and are specified by a <a href="/type/PrivacyKey">PrivacyKey</a> constructor, and its input counterpart <a href="/type/InputPrivacyKey">InputPrivacyKey</a>.<br>
|
||||
<p>Privacy <strong>keys</strong> together with <a href="#privacy-rules">privacy rules »</a> indicate <em>what</em> can or can't someone do and are specified by a <a href="/type/PrivacyKey">PrivacyKey</a> constructor, and its input counterpart <a href="/type/InputPrivacyKey">InputPrivacyKey</a>.<br>
|
||||
<a href="/type/InputPrivacyKey">InputPrivacyKey</a> constructors are <em>passed</em> as input to methods that accept privacy keys, while <a href="/type/PrivacyKey">PrivacyKey</a>s are contained in constructors <em>returned</em> by the API. </p>
|
||||
<p>See <a href="/type/InputPrivacyKey">the type page »</a> for a full list of privacy keys and their descriptions. </p>
|
||||
<p>See <a href="/type/InputPrivacyKey">the type page »</a> for a full list of privacy keys and their descriptions. </p>
|
||||
<p>Use <a href="/method/account.getPrivacy">account.getPrivacy</a> to obtain the current set of <a href="#privacy-rules">rules</a> associated to a key, and <a href="/method/account.setPrivacy">account.setPrivacy</a> to change it.</p>
|
||||
<p>Changing the privacy settings will trigger an <a href="/constructor/updatePrivacy">updatePrivacy</a>, sent to all currently logged in sessions of the current account.</p>
|
||||
<h3><a class="anchor" href="#global-privacy-settings" id="global-privacy-settings" name="global-privacy-settings"><i class="anchor-icon"></i></a>Global privacy settings</h3>
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
<a href='/method/photos.uploadProfilePhoto'>photos.uploadProfilePhoto</a>#388a3b5 flags:<a href='/type/%23'>#</a> fallback:flags.3?<a href='/constructor/true'>true</a> bot:flags.5?<a href='/type/InputUser'>InputUser</a> file:flags.0?<a href='/type/InputFile'>InputFile</a> video:flags.1?<a href='/type/InputFile'>InputFile</a> video_start_ts:flags.2?<a href='/type/double'>double</a> video_emoji_markup:flags.4?<a href='/type/VideoSize'>VideoSize</a> = <a href='/type/photos.Photo'>photos.Photo</a>;</code></pre>
|
||||
<p>Use <a href="/method/photos.updateProfilePhoto">photos.updateProfilePhoto</a> or <a href="/method/photos.uploadProfilePhoto">photos.uploadProfilePhoto</a> to set a profile (optionally animated) picture, emitting an <a href="/constructor/updateUser">updateUser</a>. </p>
|
||||
<p>The photo will be contained in <a href="/constructor/user">user</a>.<code>photo</code>. </p>
|
||||
<p>See <a href="/api/files#uploading-profile-or-chat-pictures">here »</a> for full info on profile pictures and how to work with them. </p>
|
||||
<p>See <a href="/api/files#uploading-profile-or-chat-pictures">here »</a> for full info on profile pictures and how to work with them. </p>
|
||||
<h3><a class="anchor" href="#introduction" id="introduction" name="introduction"><i class="anchor-icon"></i></a>Introduction</h3>
|
||||
<pre><code><a href='/constructor/messages.stickersNotModified'>messages.stickersNotModified</a>#f1749a22 = <a href='/type/messages.Stickers'>messages.Stickers</a>;
|
||||
<a href='/constructor/messages.stickers'>messages.stickers</a>#30a6ec7e hash:<a href='/type/long'>long</a> stickers:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Document'>Document</a>> = <a href='/type/messages.Stickers'>messages.Stickers</a>;
|
||||
|
@ -83,7 +83,7 @@
|
|||
<a href='/method/messages.getStickers'>messages.getStickers</a>#d5a5d3a1 emoticon:<a href='/type/string'>string</a> hash:<a href='/type/long'>long</a> = <a href='/type/messages.Stickers'>messages.Stickers</a>;</code></pre>
|
||||
<p>When the user opens a private chat with a user they don't have a history with, the UI should display a randomly chosen greeting sticker+invitation to send a message. </p>
|
||||
<p>To fetch this special list of greeting stickers, invoke <a href="/method/messages.getStickers">messages.getStickers</a> with <code>emoticon=<img class="emoji" src="//telegram.org/img/emoji/40/F09F918B.png" width="20" height="20" alt="👋" /><img class="emoji" src="//telegram.org/img/emoji/40/E2AD90.png" width="20" height="20" alt="⭐️" /></code>. </p>
|
||||
<p>Note that if a custom <a href="/api/business#business-introduction">Telegram Business introduction »</a> is enabled, the message+sticker specified in <a href="/constructor/userFull">userFull</a>.<code>intro</code> must be used, instead. </p>
|
||||
<p>Note that if a custom <a href="/api/business#business-introduction">Telegram Business introduction »</a> is enabled, the message+sticker specified in <a href="/constructor/userFull">userFull</a>.<code>intro</code> must be used, instead. </p>
|
||||
<h3><a class="anchor" href="#emoji-status" id="emoji-status" name="emoji-status"><i class="anchor-icon"></i></a>Emoji status</h3>
|
||||
<pre><code><a href='/constructor/user'>user</a>#83314fca flags:<a href='/type/%23'>#</a> self:flags.10?<a href='/constructor/true'>true</a> contact:flags.11?<a href='/constructor/true'>true</a> mutual_contact:flags.12?<a href='/constructor/true'>true</a> deleted:flags.13?<a href='/constructor/true'>true</a> bot:flags.14?<a href='/constructor/true'>true</a> bot_chat_history:flags.15?<a href='/constructor/true'>true</a> bot_nochats:flags.16?<a href='/constructor/true'>true</a> verified:flags.17?<a href='/constructor/true'>true</a> restricted:flags.18?<a href='/constructor/true'>true</a> min:flags.20?<a href='/constructor/true'>true</a> bot_inline_geo:flags.21?<a href='/constructor/true'>true</a> support:flags.23?<a href='/constructor/true'>true</a> scam:flags.24?<a href='/constructor/true'>true</a> apply_min_photo:flags.25?<a href='/constructor/true'>true</a> fake:flags.26?<a href='/constructor/true'>true</a> bot_attach_menu:flags.27?<a href='/constructor/true'>true</a> premium:flags.28?<a href='/constructor/true'>true</a> attach_menu_enabled:flags.29?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> bot_can_edit:flags2.1?<a href='/constructor/true'>true</a> close_friend:flags2.2?<a href='/constructor/true'>true</a> stories_hidden:flags2.3?<a href='/constructor/true'>true</a> stories_unavailable:flags2.4?<a href='/constructor/true'>true</a> contact_require_premium:flags2.10?<a href='/constructor/true'>true</a> bot_business:flags2.11?<a href='/constructor/true'>true</a> bot_has_main_app:flags2.13?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> access_hash:flags.0?<a href='/type/long'>long</a> first_name:flags.1?<a href='/type/string'>string</a> last_name:flags.2?<a href='/type/string'>string</a> username:flags.3?<a href='/type/string'>string</a> phone:flags.4?<a href='/type/string'>string</a> photo:flags.5?<a href='/type/UserProfilePhoto'>UserProfilePhoto</a> status:flags.6?<a href='/type/UserStatus'>UserStatus</a> bot_info_version:flags.14?<a href='/type/int'>int</a> restriction_reason:flags.18?<a href='/type/Vector%20t'>Vector</a><<a href='/type/RestrictionReason'>RestrictionReason</a>> bot_inline_placeholder:flags.19?<a href='/type/string'>string</a> lang_code:flags.22?<a href='/type/string'>string</a> emoji_status:flags.30?<a href='/type/EmojiStatus'>EmojiStatus</a> usernames:flags2.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/Username'>Username</a>> stories_max_id:flags2.5?<a href='/type/int'>int</a> color:flags2.8?<a href='/type/PeerColor'>PeerColor</a> profile_color:flags2.9?<a href='/type/PeerColor'>PeerColor</a> bot_active_users:flags2.12?<a href='/type/int'>int</a> = <a href='/type/User'>User</a>;
|
||||
|
||||
|
@ -92,9 +92,9 @@
|
|||
---functions---
|
||||
|
||||
<a href='/method/account.updateEmojiStatus'>account.updateEmojiStatus</a>#fbd3de6b emoji_status:<a href='/type/EmojiStatus'>EmojiStatus</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p><a href="/method/account.updateEmojiStatus">account.updateEmojiStatus</a> may be used to update the <a href="/api/emoji-status">emoji status »</a> of the current account, which is displayed next to the name. </p>
|
||||
<p><a href="/method/account.updateEmojiStatus">account.updateEmojiStatus</a> may be used to update the <a href="/api/emoji-status">emoji status »</a> of the current account, which is displayed next to the name. </p>
|
||||
<p>The emoji status will be contained in <a href="/constructor/user">user</a>.<code>emoji_status</code>, and changing it will emit an <a href="/constructor/updateUserEmojiStatus">updateUserEmojiStatus</a> update.</p>
|
||||
<p>See <a href="/api/emoji-status">here »</a> for more info on emoji statuses.</p>
|
||||
<p>See <a href="/api/emoji-status">here »</a> for more info on emoji statuses.</p>
|
||||
<h3><a class="anchor" href="#username" id="username" name="username"><i class="anchor-icon"></i></a>Username</h3>
|
||||
<pre><code><a href='/constructor/user'>user</a>#83314fca flags:<a href='/type/%23'>#</a> self:flags.10?<a href='/constructor/true'>true</a> contact:flags.11?<a href='/constructor/true'>true</a> mutual_contact:flags.12?<a href='/constructor/true'>true</a> deleted:flags.13?<a href='/constructor/true'>true</a> bot:flags.14?<a href='/constructor/true'>true</a> bot_chat_history:flags.15?<a href='/constructor/true'>true</a> bot_nochats:flags.16?<a href='/constructor/true'>true</a> verified:flags.17?<a href='/constructor/true'>true</a> restricted:flags.18?<a href='/constructor/true'>true</a> min:flags.20?<a href='/constructor/true'>true</a> bot_inline_geo:flags.21?<a href='/constructor/true'>true</a> support:flags.23?<a href='/constructor/true'>true</a> scam:flags.24?<a href='/constructor/true'>true</a> apply_min_photo:flags.25?<a href='/constructor/true'>true</a> fake:flags.26?<a href='/constructor/true'>true</a> bot_attach_menu:flags.27?<a href='/constructor/true'>true</a> premium:flags.28?<a href='/constructor/true'>true</a> attach_menu_enabled:flags.29?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> bot_can_edit:flags2.1?<a href='/constructor/true'>true</a> close_friend:flags2.2?<a href='/constructor/true'>true</a> stories_hidden:flags2.3?<a href='/constructor/true'>true</a> stories_unavailable:flags2.4?<a href='/constructor/true'>true</a> contact_require_premium:flags2.10?<a href='/constructor/true'>true</a> bot_business:flags2.11?<a href='/constructor/true'>true</a> bot_has_main_app:flags2.13?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> access_hash:flags.0?<a href='/type/long'>long</a> first_name:flags.1?<a href='/type/string'>string</a> last_name:flags.2?<a href='/type/string'>string</a> username:flags.3?<a href='/type/string'>string</a> phone:flags.4?<a href='/type/string'>string</a> photo:flags.5?<a href='/type/UserProfilePhoto'>UserProfilePhoto</a> status:flags.6?<a href='/type/UserStatus'>UserStatus</a> bot_info_version:flags.14?<a href='/type/int'>int</a> restriction_reason:flags.18?<a href='/type/Vector%20t'>Vector</a><<a href='/type/RestrictionReason'>RestrictionReason</a>> bot_inline_placeholder:flags.19?<a href='/type/string'>string</a> lang_code:flags.22?<a href='/type/string'>string</a> emoji_status:flags.30?<a href='/type/EmojiStatus'>EmojiStatus</a> usernames:flags2.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/Username'>Username</a>> stories_max_id:flags2.5?<a href='/type/int'>int</a> color:flags2.8?<a href='/type/PeerColor'>PeerColor</a> profile_color:flags2.9?<a href='/type/PeerColor'>PeerColor</a> bot_active_users:flags2.12?<a href='/type/int'>int</a> = <a href='/type/User'>User</a>;
|
||||
|
||||
|
@ -113,7 +113,7 @@
|
|||
<p>Multiple <a href="/api/fragment">collectible usernames</a> may also be configured, using <a href="/method/account.toggleUsername">account.toggleUsername</a> and <a href="/method/account.reorderUsernames">account.reorderUsernames</a>. </p>
|
||||
<p>The main username will be contained in <a href="/constructor/user">user</a>.<code>username</code>, any extra usernames will be contained in <a href="/constructor/user">user</a>.<code>usernames</code>.<br>
|
||||
Updating/reordering usernames will emit an <a href="/constructor/updateUserName">updateUserName</a>. </p>
|
||||
<p>See <a href="/api/links#public-username-links">here »</a> for more info on public username links.</p>
|
||||
<p>See <a href="/api/links#public-username-links">here »</a> for more info on public username links.</p>
|
||||
<h3><a class="anchor" href="#accent-colors" id="accent-colors" name="accent-colors"><i class="anchor-icon"></i></a>Accent colors</h3>
|
||||
<pre><code><a href='/constructor/user'>user</a>#83314fca flags:<a href='/type/%23'>#</a> self:flags.10?<a href='/constructor/true'>true</a> contact:flags.11?<a href='/constructor/true'>true</a> mutual_contact:flags.12?<a href='/constructor/true'>true</a> deleted:flags.13?<a href='/constructor/true'>true</a> bot:flags.14?<a href='/constructor/true'>true</a> bot_chat_history:flags.15?<a href='/constructor/true'>true</a> bot_nochats:flags.16?<a href='/constructor/true'>true</a> verified:flags.17?<a href='/constructor/true'>true</a> restricted:flags.18?<a href='/constructor/true'>true</a> min:flags.20?<a href='/constructor/true'>true</a> bot_inline_geo:flags.21?<a href='/constructor/true'>true</a> support:flags.23?<a href='/constructor/true'>true</a> scam:flags.24?<a href='/constructor/true'>true</a> apply_min_photo:flags.25?<a href='/constructor/true'>true</a> fake:flags.26?<a href='/constructor/true'>true</a> bot_attach_menu:flags.27?<a href='/constructor/true'>true</a> premium:flags.28?<a href='/constructor/true'>true</a> attach_menu_enabled:flags.29?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> bot_can_edit:flags2.1?<a href='/constructor/true'>true</a> close_friend:flags2.2?<a href='/constructor/true'>true</a> stories_hidden:flags2.3?<a href='/constructor/true'>true</a> stories_unavailable:flags2.4?<a href='/constructor/true'>true</a> contact_require_premium:flags2.10?<a href='/constructor/true'>true</a> bot_business:flags2.11?<a href='/constructor/true'>true</a> bot_has_main_app:flags2.13?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> access_hash:flags.0?<a href='/type/long'>long</a> first_name:flags.1?<a href='/type/string'>string</a> last_name:flags.2?<a href='/type/string'>string</a> username:flags.3?<a href='/type/string'>string</a> phone:flags.4?<a href='/type/string'>string</a> photo:flags.5?<a href='/type/UserProfilePhoto'>UserProfilePhoto</a> status:flags.6?<a href='/type/UserStatus'>UserStatus</a> bot_info_version:flags.14?<a href='/type/int'>int</a> restriction_reason:flags.18?<a href='/type/Vector%20t'>Vector</a><<a href='/type/RestrictionReason'>RestrictionReason</a>> bot_inline_placeholder:flags.19?<a href='/type/string'>string</a> lang_code:flags.22?<a href='/type/string'>string</a> emoji_status:flags.30?<a href='/type/EmojiStatus'>EmojiStatus</a> usernames:flags2.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/Username'>Username</a>> stories_max_id:flags2.5?<a href='/type/int'>int</a> color:flags2.8?<a href='/type/PeerColor'>PeerColor</a> profile_color:flags2.9?<a href='/type/PeerColor'>PeerColor</a> bot_active_users:flags2.12?<a href='/type/int'>int</a> = <a href='/type/User'>User</a>;
|
||||
|
||||
|
@ -124,7 +124,7 @@ Updating/reordering usernames will emit an <a href="/constructor/updateUserName"
|
|||
<a href='/method/account.updateColor'>account.updateColor</a>#7cefa15d flags:<a href='/type/%23'>#</a> for_profile:flags.1?<a href='/constructor/true'>true</a> color:flags.2?<a href='/type/int'>int</a> background_emoji_id:flags.0?<a href='/type/long'>long</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>Use <a href="/method/account.updateColor">account.updateColor</a> to update the accent color and background emoji of the current profile, present in <a href="/constructor/user">user</a>.<code>color</code>/<a href="/constructor/user">user</a>.<code>profile_color</code>. </p>
|
||||
<p>Changing it will emit an <a href="/constructor/updateUser">updateUser</a> update. </p>
|
||||
<p>See <a href="/api/colors">here »</a> for more info on accent colors.</p>
|
||||
<p>See <a href="/api/colors">here »</a> for more info on accent colors.</p>
|
||||
<h3><a class="anchor" href="#birthday" id="birthday" name="birthday"><i class="anchor-icon"></i></a>Birthday</h3>
|
||||
<pre><code><a href='/constructor/birthday'>birthday</a>#6c8e1e06 flags:<a href='/type/%23'>#</a> day:<a href='/type/int'>int</a> month:<a href='/type/int'>int</a> year:flags.0?<a href='/type/int'>int</a> = <a href='/type/Birthday'>Birthday</a>;
|
||||
|
||||
|
@ -147,17 +147,17 @@ Updating/reordering usernames will emit an <a href="/constructor/updateUserName"
|
|||
<a href='/method/contacts.getBirthdays'>contacts.getBirthdays</a>#daeda864 = <a href='/type/contacts.ContactBirthdays'>contacts.ContactBirthdays</a>;
|
||||
|
||||
<a href='/method/help.dismissSuggestion'>help.dismissSuggestion</a>#f50dbaa1 peer:<a href='/type/InputPeer'>InputPeer</a> suggestion:<a href='/type/string'>string</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>Use <a href="/method/account.updateBirthday">account.updateBirthday</a> to set a birthday date that will be displayed to the users specified in the <a href="/api/privacy">privacy settings »</a>, according to the current privacy setting of <a href="/constructor/inputPrivacyKeyBirthday">inputPrivacyKeyBirthday</a> (only contacts by default). </p>
|
||||
<p>Use <a href="/method/account.updateBirthday">account.updateBirthday</a> to set a birthday date that will be displayed to the users specified in the <a href="/api/privacy">privacy settings »</a>, according to the current privacy setting of <a href="/constructor/inputPrivacyKeyBirthday">inputPrivacyKeyBirthday</a> (only contacts by default). </p>
|
||||
<p>The birthday (if accessible to the current user) will be present in <a href="/constructor/user">user</a>.<code>birthday</code>, changing it will emit an <a href="/constructor/updateUser">updateUser</a> update. </p>
|
||||
<p>Setting the actual birth <code>year</code> is optional, and if set, the allowed age range is currently <code>0 <= years <= 150</code> (checked only when updating the birthday); a <code>400 BIRTHDAY_INVALID</code> error will be emitted otherwise. </p>
|
||||
<p>To remove the birthday, call the method without setting the <code>birthday</code> flag. </p>
|
||||
<p>The client should display a tooltip to set a birthday; this tooltip may be dismissed by the user, triggering a call to <a href="/method/help.dismissSuggestion">help.dismissSuggestion</a> with suggestion=<code>BIRTHDAY_SETUP</code> to sync the state on all currently logged-in clients through the <code>dismissed_suggestions</code> <a href="/api/config#dismissed-suggestions">client configuration field »</a>. </p>
|
||||
<p>The client should display a tooltip to set a birthday; this tooltip may be dismissed by the user, triggering a call to <a href="/method/help.dismissSuggestion">help.dismissSuggestion</a> with suggestion=<code>BIRTHDAY_SETUP</code> to sync the state on all currently logged-in clients through the <code>dismissed_suggestions</code> <a href="/api/config#dismissed-suggestions">client configuration field »</a>. </p>
|
||||
<p><a href="/method/contacts.getBirthdays">contacts.getBirthdays</a> returns all users with birthdays that fall within +1/-1 days, relative to the current day: this method should be invoked by clients every 6-8 hours, and if the result is non-empty, it should be used to appropriately update locally cached birthday information in <a href="/constructor/user">user</a>.<code>birthday</code>. </p>
|
||||
<p>If and only if the <code>BIRTHDAY_CONTACTS_TODAY</code> <a href="/api/config#suggestions">suggestion »</a> is <strong>not</strong> set, all <em>contacts</em> whose <a href="/constructor/user">user</a>.<code>birthday</code> fields (updated through <a href="/method/contacts.getBirthdays">contacts.getBirthdays</a> and in other ways, i.e. through <a href="/constructor/updateUser">updateUser</a> updates) fall within +1/-1 days relative to today should be always listed in an action bar shown in the global dialog list (<em>not</em> the user-specific <a href="/api/action-bar">action bar »</a>), inviting the user to make a birthday <a href="/api/premium#gifting-telegram-premium">gift to those users, in the form of one or more Telegram Premium subscriptions »</a>. </p>
|
||||
<p>If and only if the <code>BIRTHDAY_CONTACTS_TODAY</code> <a href="/api/config#suggestions">suggestion »</a> is <strong>not</strong> set, all <em>contacts</em> whose <a href="/constructor/user">user</a>.<code>birthday</code> fields (updated through <a href="/method/contacts.getBirthdays">contacts.getBirthdays</a> and in other ways, i.e. through <a href="/constructor/updateUser">updateUser</a> updates) fall within +1/-1 days relative to today should be always listed in an action bar shown in the global dialog list (<em>not</em> the user-specific <a href="/api/action-bar">action bar »</a>), inviting the user to make a birthday <a href="/api/premium#gifting-telegram-premium">gift to those users, in the form of one or more Telegram Premium subscriptions »</a>. </p>
|
||||
<p>The birthday action bar may be dismissed by the user, syncing its state to other currently logged-in sessions by invoking <a href="/method/help.dismissSuggestion">help.dismissSuggestion</a> with suggestion=<code>BIRTHDAY_CONTACTS_TODAY</code>.<br>
|
||||
Since <code>BIRTHDAY_CONTACTS_TODAY</code> is an <em>inverted</em> suggestion, dismissing it will actually <em>enable</em> it in the <a href="/api/config#client-configuration">client configuration</a> on all currently logged-in sessions, notified by an <a href="/constructor/updateConfig">updateConfig</a>, and its <em>presence</em> should be treated as a signal to <em>not</em> display the birthday action bar. </p>
|
||||
<p>The suggestion is also automatically enabled by the server if the user gifts one or more Telegram Premium subscriptions to friends with birthdays falling within the next/previous 24 hours, thus hiding the birthday action bar to other logged-in sessions. </p>
|
||||
<p>Additionally, if a user has a birthday falling within the specified time range (+1/-1 days) as specified in <a href="/constructor/user">user</a>.<code>birthday</code>, a gift icon tooltip should be shown in the text input bar in private chats with them, leading to the <a href="/api/premium#gifting-telegram-premium">Telegram Premium gift flow »</a> (this also applies to non-contacts that have allowed us to see their birthday date), regardless of the presence or absence of <code>BIRTHDAY_CONTACTS_TODAY</code>. </p>
|
||||
<p>Additionally, if a user has a birthday falling within the specified time range (+1/-1 days) as specified in <a href="/constructor/user">user</a>.<code>birthday</code>, a gift icon tooltip should be shown in the text input bar in private chats with them, leading to the <a href="/api/premium#gifting-telegram-premium">Telegram Premium gift flow »</a> (this also applies to non-contacts that have allowed us to see their birthday date), regardless of the presence or absence of <code>BIRTHDAY_CONTACTS_TODAY</code>. </p>
|
||||
<h3><a class="anchor" href="#personal-channel" id="personal-channel" name="personal-channel"><i class="anchor-icon"></i></a>Personal channel</h3>
|
||||
<pre><code><a href='/constructor/inputChannel'>inputChannel</a>#f35aec28 channel_id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputChannel'>InputChannel</a>;
|
||||
<a href='/constructor/inputChannelEmpty'>inputChannelEmpty</a>#ee8c1e86 = <a href='/type/InputChannel'>InputChannel</a>;
|
||||
|
@ -171,7 +171,7 @@ Since <code>BIRTHDAY_CONTACTS_TODAY</code> is an <em>inverted</em> suggestion, d
|
|||
<a href='/method/channels.getAdminedPublicChannels'>channels.getAdminedPublicChannels</a>#f8b036af flags:<a href='/type/%23'>#</a> by_location:flags.0?<a href='/constructor/true'>true</a> check_limit:flags.1?<a href='/constructor/true'>true</a> for_personal:flags.2?<a href='/constructor/true'>true</a> = <a href='/type/messages.Chats'>messages.Chats</a>;
|
||||
|
||||
<a href='/method/account.updatePersonalChannel'>account.updatePersonalChannel</a>#d94305e0 channel:<a href='/type/InputChannel'>InputChannel</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>Use <a href="/method/account.updatePersonalChannel">account.updatePersonalChannel</a> to associate (or remove via <a href="/constructor/inputChannelEmpty">inputChannelEmpty</a>) a personal <a href="/api/channel">channel »</a>, that will be listed on our personal profile page. </p>
|
||||
<p>Use <a href="/method/account.updatePersonalChannel">account.updatePersonalChannel</a> to associate (or remove via <a href="/constructor/inputChannelEmpty">inputChannelEmpty</a>) a personal <a href="/api/channel">channel »</a>, that will be listed on our personal profile page. </p>
|
||||
<p>To fetch the full list of channels that may be passed to <a href="/method/account.updatePersonalChannel">account.updatePersonalChannel</a>, invoke <a href="/method/channels.getAdminedPublicChannels">channels.getAdminedPublicChannels</a>, setting the <code>for_personal</code> flag. </p>
|
||||
<p>The ID of the associated channel will be present in <a href="/constructor/user">user</a>.<code>personal_channel_id</code>, and the ID of the latest message that should be shown in the UI preview is contained in <a href="/constructor/user">user</a>.<code>personal_channel_message</code>. </p>
|
||||
<p>Changing it will emit an <a href="/constructor/updateUser">updateUser</a> update. </p>
|
||||
|
@ -183,7 +183,7 @@ Since <code>BIRTHDAY_CONTACTS_TODAY</code> is an <em>inverted</em> suggestion, d
|
|||
<a href='/method/account.updateBusinessGreetingMessage'>account.updateBusinessGreetingMessage</a>#66cdafc4 flags:<a href='/type/%23'>#</a> message:flags.0?<a href='/type/InputBusinessGreetingMessage'>InputBusinessGreetingMessage</a> = <a href='/type/Bool'>Bool</a>;
|
||||
<a href='/method/account.updateBusinessAwayMessage'>account.updateBusinessAwayMessage</a>#a26a7fa5 flags:<a href='/type/%23'>#</a> message:flags.0?<a href='/type/InputBusinessAwayMessage'>InputBusinessAwayMessage</a> = <a href='/type/Bool'>Bool</a>;
|
||||
<a href='/method/account.updateBusinessIntro'>account.updateBusinessIntro</a>#a614d034 flags:<a href='/type/%23'>#</a> intro:flags.0?<a href='/type/InputBusinessIntro'>InputBusinessIntro</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>A large number of various <a href="/api/business">Telegram Business-related</a> information should be displayed on the profile page, see <a href="/api/business">here »</a> for the full list of fields and how they can be changed. </p>
|
||||
<p>A large number of various <a href="/api/business">Telegram Business-related</a> information should be displayed on the profile page, see <a href="/api/business">here »</a> for the full list of fields and how they can be changed. </p>
|
||||
<h3><a class="anchor" href="#online-status" id="online-status" name="online-status"><i class="anchor-icon"></i></a>Online status</h3>
|
||||
<pre><code><a href='/constructor/userStatusEmpty'>userStatusEmpty</a>#9d05049 = <a href='/type/UserStatus'>UserStatus</a>;
|
||||
<a href='/constructor/userStatusOnline'>userStatusOnline</a>#edb93949 expires:<a href='/type/int'>int</a> = <a href='/type/UserStatus'>UserStatus</a>;
|
||||
|
|
|
@ -78,7 +78,7 @@ The <a href="/api/config#reactions-uniq-max">reactions_uniq_max</a> configuratio
|
|||
<p>Chats and channels may also configure a custom limit of unique reactions; this info will be available to users in <a href="/constructor/channelFull">channelFull</a>.<code>reactions_limit</code> and <a href="/constructor/chatFull">chatFull</a>.<code>reactions_limit</code>. </p>
|
||||
<p>The <code>big</code> flag can be optionally set to elicit a bigger reaction.<br>
|
||||
Send a <a href="/constructor/reactionEmoji">reactionEmoji</a> to react using a normal emoji, and a <a href="/constructor/reactionCustomEmoji">reactionCustomEmoji</a> to react using a <a href="/api/custom-emoji">custom emoji</a>.<br>
|
||||
Message authors will receive an <a href="/constructor/updateMessageReactions">updateMessageReactions</a> update when a user reacts to their message, if enabled as specified <a href="#notifications-about-reactions">here »</a>. </p>
|
||||
Message authors will receive an <a href="/constructor/updateMessageReactions">updateMessageReactions</a> update when a user reacts to their message, if enabled as specified <a href="#notifications-about-reactions">here »</a>. </p>
|
||||
<p><a href="/method/messages.getMessagesReactions">messages.getMessagesReactions</a> can be used to fetch a full list of reactions for one or more messages.<br>
|
||||
Apps should short-poll reactions for visible messages (that weren't sent by the user) once every 15-30 seconds, but only if <code>message.reactions</code> is set. </p>
|
||||
<p>In groups, <a href="/method/messages.getMessageReactionsList">messages.getMessageReactionsList</a> can be used to fetch the reaction list, along with the sender of each reaction.<br>
|
||||
|
@ -87,7 +87,7 @@ In groups, <a href="/method/messages.reportReaction">messages.reportReaction</a>
|
|||
Use <a href="/method/messages.readReactions">messages.readReactions</a> to mark all reactions as read in a certain chat.</p>
|
||||
<p>For <a href="/api/saved-messages">saved messages</a>, if the <code>reactions_as_tags</code> flag of <a href="/constructor/messageReactions">messageReactions</a> is set, or if there are no reactions, all present and future reactions should be treated as <a href="/api/saved-messages#tags">message tags, see here » for more info</a>.</p>
|
||||
<h3><a class="anchor" href="#react-to-a-story" id="react-to-a-story" name="react-to-a-story"><i class="anchor-icon"></i></a>React to a story</h3>
|
||||
<p>See <a href="/api/stories#reactions">here »</a> for more info on how to react to a story.</p>
|
||||
<p>See <a href="/api/stories#reactions">here »</a> for more info on how to react to a story.</p>
|
||||
<h3><a class="anchor" href="#notifications-about-reactions" id="notifications-about-reactions" name="notifications-about-reactions"><i class="anchor-icon"></i></a>Notifications about reactions</h3>
|
||||
<pre><code><a href='/constructor/reactionNotificationsFromContacts'>reactionNotificationsFromContacts</a>#bac3a61a = <a href='/type/ReactionNotificationsFrom'>ReactionNotificationsFrom</a>;
|
||||
<a href='/constructor/reactionNotificationsFromAll'>reactionNotificationsFromAll</a>#4b9e22a0 = <a href='/type/ReactionNotificationsFrom'>ReactionNotificationsFrom</a>;
|
||||
|
@ -103,8 +103,8 @@ Use <a href="/method/messages.readReactions">messages.readReactions</a> to mark
|
|||
<a href='/method/account.getReactionsNotifySettings'>account.getReactionsNotifySettings</a>#6dd654c = <a href='/type/ReactionsNotifySettings'>ReactionsNotifySettings</a>;</code></pre>
|
||||
<p>Users may choose to receive notifications about reactions sent to their messages and stories by any user, only by contacts, or completely disable them. </p>
|
||||
<p>These reaction notification settings may be changed using <a href="/method/account.setReactionsNotifySettings">account.setReactionsNotifySettings</a>, and fetched using <a href="/method/account.getReactionsNotifySettings">account.getReactionsNotifySettings</a>. </p>
|
||||
<p>A custom <a href="/api/ringtones">notification sound »</a> may also be set for reactions in the <code>sound</code> field of the <a href="/constructor/reactionsNotifySettings">reactionsNotifySettings</a>. </p>
|
||||
<p>If <code>show_previews=false</code>, <a href="/api/push-updates">push notifications »</a> about message/story reactions will only be of type <code>REACT_HIDDEN</code>/<code>REACT_STORY_HIDDEN</code>, without any information about the reacted-to story or the reaction itself. </p>
|
||||
<p>A custom <a href="/api/ringtones">notification sound »</a> may also be set for reactions in the <code>sound</code> field of the <a href="/constructor/reactionsNotifySettings">reactionsNotifySettings</a>. </p>
|
||||
<p>If <code>show_previews=false</code>, <a href="/api/push-updates">push notifications »</a> about message/story reactions will only be of type <code>REACT_HIDDEN</code>/<code>REACT_STORY_HIDDEN</code>, without any information about the reacted-to story or the reaction itself. </p>
|
||||
<h3><a class="anchor" href="#animated-normal-emojis" id="animated-normal-emojis" name="animated-normal-emojis"><i class="anchor-icon"></i></a>Animated normal emojis</h3>
|
||||
<pre><code><a href='/constructor/reactionEmoji'>reactionEmoji</a>#1b2286b8 emoticon:<a href='/type/string'>string</a> = <a href='/type/Reaction'>Reaction</a>;
|
||||
|
||||
|
@ -119,9 +119,9 @@ Use <a href="/method/messages.readReactions">messages.readReactions</a> to mark
|
|||
|
||||
<a href='/method/messages.getAvailableReactions'>messages.getAvailableReactions</a>#18dea0ac hash:<a href='/type/int'>int</a> = <a href='/type/messages.AvailableReactions'>messages.AvailableReactions</a>;</code></pre>
|
||||
<p><a href="/method/messages.getAvailableReactions">messages.getAvailableReactions</a> can be used to fetch a list of animations to play when reacting with a normal <a href="/constructor/reactionEmoji">reactionEmoji</a>.<br>
|
||||
The returned vector of <a href="/constructor/availableReaction">availableReaction</a> constructors contains multiple fields with lottie <a href="/api/stickers">animated stickers</a> and simple images that should be positioned, displayed and played appropriately in the UI, as described in the <a href="/constructor/availableReaction">constructor page »</a>. </p>
|
||||
<p>Users can also react using <a href="/api/custom-emoji">custom emojis »</a>, in which case the <code>appear_animation</code> and <code>select_animation</code> are equal to the custom emoji itself that can be fetched <a href="/api/custom-emoji">as described here »</a>.<br>
|
||||
For custom emojis, the <code>effect_animation</code> must be equal to the <code>effect_animation</code> of the associated normal emoji: if no effect animation is present for the normal emoji associated to a custom emoji, a random <a href="/api/stickers">animated sticker</a> should be played from the <a href="/constructor/inputStickerSetEmojiGenericAnimations">inputStickerSetEmojiGenericAnimations</a> stickerset, fetched using <a href="/method/messages.getStickerSet">messages.getStickerSet</a> as described <a href="/api/stickers#stickersets">here »</a>.</p>
|
||||
The returned vector of <a href="/constructor/availableReaction">availableReaction</a> constructors contains multiple fields with lottie <a href="/api/stickers">animated stickers</a> and simple images that should be positioned, displayed and played appropriately in the UI, as described in the <a href="/constructor/availableReaction">constructor page »</a>. </p>
|
||||
<p>Users can also react using <a href="/api/custom-emoji">custom emojis »</a>, in which case the <code>appear_animation</code> and <code>select_animation</code> are equal to the custom emoji itself that can be fetched <a href="/api/custom-emoji">as described here »</a>.<br>
|
||||
For custom emojis, the <code>effect_animation</code> must be equal to the <code>effect_animation</code> of the associated normal emoji: if no effect animation is present for the normal emoji associated to a custom emoji, a random <a href="/api/stickers">animated sticker</a> should be played from the <a href="/constructor/inputStickerSetEmojiGenericAnimations">inputStickerSetEmojiGenericAnimations</a> stickerset, fetched using <a href="/method/messages.getStickerSet">messages.getStickerSet</a> as described <a href="/api/stickers#stickersets">here »</a>.</p>
|
||||
<h3><a class="anchor" href="#available-reactions-in-group-or-channel" id="available-reactions-in-group-or-channel" name="available-reactions-in-group-or-channel"><i class="anchor-icon"></i></a>Available reactions in group or channel</h3>
|
||||
<pre><code><a href='/constructor/reactionEmoji'>reactionEmoji</a>#1b2286b8 emoticon:<a href='/type/string'>string</a> = <a href='/type/Reaction'>Reaction</a>;
|
||||
<a href='/constructor/reactionCustomEmoji'>reactionCustomEmoji</a>#8935fc73 document_id:<a href='/type/long'>long</a> = <a href='/type/Reaction'>Reaction</a>;
|
||||
|
@ -138,7 +138,7 @@ For custom emojis, the <code>effect_animation</code> must be equal to the <code>
|
|||
---functions---
|
||||
|
||||
<a href='/method/messages.setChatAvailableReactions'>messages.setChatAvailableReactions</a>#5a150bd4 flags:<a href='/type/%23'>#</a> peer:<a href='/type/InputPeer'>InputPeer</a> available_reactions:<a href='/type/ChatReactions'>ChatReactions</a> reactions_limit:flags.0?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||
<p>Chat and channel administrators can use <a href="/method/messages.setChatAvailableReactions">messages.setChatAvailableReactions</a> to restrict the set of reactions that can be used in a chat or channel, see <a href="/type/ChatReactions">here »</a> for a list of possible configuration values.<br>
|
||||
<p>Chat and channel administrators can use <a href="/method/messages.setChatAvailableReactions">messages.setChatAvailableReactions</a> to restrict the set of reactions that can be used in a chat or channel, see <a href="/type/ChatReactions">here »</a> for a list of possible configuration values.<br>
|
||||
The set <a href="/type/ChatReactions">ChatReactions</a> constructor can then be fetched by users using <a href="/method/messages.getFullChat">messages.getFullChat</a>, and will be contained in the <code>available_reactions</code> field of the returned full info constructor. </p>
|
||||
<p>The <code>reactions_limit</code> limit flag may be used to impose a custom limit of unique reactions (i.e. a customizable version of <a href="/api/config#reactions-uniq-max">appConfig.reactions_uniq_max</a>); this field and the other info set by the method will then be available to users in <a href="/constructor/channelFull">channelFull</a> and <a href="/constructor/chatFull">chatFull</a>. </p>
|
||||
<p>The <a href="/api/config#reactions-in-chat-max">reactions_in_chat_max</a> configuration field indicates the maximum number of reactions that can be specified in <a href="/constructor/chatReactionsSome">chatReactionsSome</a>.</p>
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<a href='/method/channels.getChannelRecommendations'>channels.getChannelRecommendations</a>#25a71742 flags:<a href='/type/%23'>#</a> channel:flags.0?<a href='/type/InputChannel'>InputChannel</a> = <a href='/type/messages.Chats'>messages.Chats</a>;</code></pre>
|
||||
<p>Clients should invoke <a href="/method/channels.getChannelRecommendations">channels.getChannelRecommendations</a> after joining a <a href="/api/channel">channel</a> (passing the channel's peer in <code>channel</code>), automatically displaying a popup with a list of similarly themed channels. </p>
|
||||
<p>The same method should also be invoked when opening a special "Similar channels" tab in the channel's profile (similar to the Media/Links/Gifs/etc tabs). </p>
|
||||
<p>The method should also be called <em>without</em> setting the <code>channel</code> flag in the "Similar channels" section of the "Channels" tab of global search, to return a <em>global</em> list of recommended channels, similar to the ones the current user has already joined, see <a href="/api/search#global-search">here »</a> for more info. </p>
|
||||
<p>The method should also be called <em>without</em> setting the <code>channel</code> flag in the "Similar channels" section of the "Channels" tab of global search, to return a <em>global</em> list of recommended channels, similar to the ones the current user has already joined, see <a href="/api/search#global-search">here »</a> for more info. </p>
|
||||
<p>The maximum number of similar channels that can be recommended by <a href="/method/channels.getChannelRecommendations">channels.getChannelRecommendations»</a> to <a href="/api/premium">Premium</a>/non-<a href="/api/premium">Premium</a> users is contained in the <a href="/api/config#recommended-channels-limit-premium">recommended_channels_limit_premium</a>/<a href="/api/config#recommended-channels-limit-default">recommended_channels_limit_default</a> app configuration keys.</p></div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
<p>Telegram has one of the <strong>most generous reward systems</strong> in the history of social media. Telegram channel owners can now receive <strong>50%</strong> of the revenue from ads displayed in their channels.</p>
|
||||
<p>This page describes the methods used to withdraw channel ad revenue, as well as view detailed revenue stats. </p>
|
||||
<p>See <a href="/api/sponsored-messages">here »</a> for more info on how to display the ads in the client UI. </p>
|
||||
<p>See <a href="/api/sponsored-messages">here »</a> for more info on how to display the ads in the client UI. </p>
|
||||
<h3><a class="anchor" href="#balance-and-transaction-history" id="balance-and-transaction-history" name="balance-and-transaction-history"><i class="anchor-icon"></i></a>Balance and transaction history</h3>
|
||||
<pre><code><a href='/constructor/broadcastRevenueTransactionProceeds'>broadcastRevenueTransactionProceeds</a>#557e2cc4 amount:<a href='/type/long'>long</a> from_date:<a href='/type/int'>int</a> to_date:<a href='/type/int'>int</a> = <a href='/type/BroadcastRevenueTransaction'>BroadcastRevenueTransaction</a>;
|
||||
<a href='/constructor/broadcastRevenueTransactionWithdrawal'>broadcastRevenueTransactionWithdrawal</a>#5a590978 flags:<a href='/type/%23'>#</a> pending:flags.0?<a href='/constructor/true'>true</a> failed:flags.2?<a href='/constructor/true'>true</a> amount:<a href='/type/long'>long</a> date:<a href='/type/int'>int</a> provider:<a href='/type/string'>string</a> transaction_date:flags.1?<a href='/type/int'>int</a> transaction_url:flags.1?<a href='/type/string'>string</a> = <a href='/type/BroadcastRevenueTransaction'>BroadcastRevenueTransaction</a>;
|
||||
|
@ -61,7 +61,7 @@
|
|||
---functions---
|
||||
|
||||
<a href='/method/stats.getBroadcastRevenueTransactions'>stats.getBroadcastRevenueTransactions</a>#69280f channel:<a href='/type/InputChannel'>InputChannel</a> offset:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> = <a href='/type/stats.BroadcastRevenueTransactions'>stats.BroadcastRevenueTransactions</a>;</code></pre>
|
||||
<p>The channel ad revenue transaction history and balance may be fetched by channel admins if the <a href="/constructor/channelFull">channelFull</a>.<code>can_view_revenue</code> flag is set and the <a href="/api/config#channel-revenue-withdrawal-enabled">channel_revenue_withdrawal_enabled field is equal to <code>true</code> »</a>. </p>
|
||||
<p>The channel ad revenue transaction history and balance may be fetched by channel admins if the <a href="/constructor/channelFull">channelFull</a>.<code>can_view_revenue</code> flag is set and the <a href="/api/config#channel-revenue-withdrawal-enabled">channel_revenue_withdrawal_enabled field is equal to <code>true</code> »</a>. </p>
|
||||
<p>The transaction history may be fetched using <a href="/method/stats.getBroadcastRevenueTransactions">stats.getBroadcastRevenueTransactions</a>, which will return a vector of <a href="/type/BroadcastRevenueTransaction">BroadcastRevenueTransaction</a> constructors, one of:</p>
|
||||
<ul>
|
||||
<li><a href="/constructor/broadcastRevenueTransactionProceeds">broadcastRevenueTransactionProceeds</a> - Describes earnings from sponsored messages in a channel in some time frame</li>
|
||||
|
@ -80,8 +80,8 @@
|
|||
---functions---
|
||||
|
||||
<a href='/method/stats.getBroadcastRevenueStats'>stats.getBroadcastRevenueStats</a>#75dfb671 flags:<a href='/type/%23'>#</a> dark:flags.0?<a href='/constructor/true'>true</a> channel:<a href='/type/InputChannel'>InputChannel</a> = <a href='/type/stats.BroadcastRevenueStats'>stats.BroadcastRevenueStats</a>;</code></pre>
|
||||
<p>Channel ad revenue statistics may be fetched by channel admins if the <a href="/constructor/channelFull">channelFull</a>.<code>can_view_revenue</code> flag is set and the <a href="/api/config#channel-revenue-withdrawal-enabled">channel_revenue_withdrawal_enabled field is equal to <code>true</code> »</a>. </p>
|
||||
<p>Use <a href="/method/stats.getBroadcastRevenueStats">stats.getBroadcastRevenueStats</a> to fetch statistics about the revenue earned from sponsored messages in a channel; the returned <a href="/type/StatsGraph">StatsGraph</a> graphs can be rendered <a href="/api/stats#graph-visualization">as described here »</a>. </p>
|
||||
<p>Channel ad revenue statistics may be fetched by channel admins if the <a href="/constructor/channelFull">channelFull</a>.<code>can_view_revenue</code> flag is set and the <a href="/api/config#channel-revenue-withdrawal-enabled">channel_revenue_withdrawal_enabled field is equal to <code>true</code> »</a>. </p>
|
||||
<p>Use <a href="/method/stats.getBroadcastRevenueStats">stats.getBroadcastRevenueStats</a> to fetch statistics about the revenue earned from sponsored messages in a channel; the returned <a href="/type/StatsGraph">StatsGraph</a> graphs can be rendered <a href="/api/stats#graph-visualization">as described here »</a>. </p>
|
||||
<p>Specifically:</p>
|
||||
<ul>
|
||||
<li><code>top_hours_graph</code> - Ad impressions graph</li>
|
||||
|
@ -96,8 +96,8 @@
|
|||
---functions---
|
||||
|
||||
<a href='/method/stats.getBroadcastRevenueWithdrawalUrl'>stats.getBroadcastRevenueWithdrawalUrl</a>#2a65ef73 channel:<a href='/type/InputChannel'>InputChannel</a> password:<a href='/type/InputCheckPasswordSRP'>InputCheckPasswordSRP</a> = <a href='/type/stats.BroadcastRevenueWithdrawalUrl'>stats.BroadcastRevenueWithdrawalUrl</a>;</code></pre>
|
||||
<p>To withdraw a channel's ad revenue, invoke <a href="/method/stats.getBroadcastRevenueWithdrawalUrl">stats.getBroadcastRevenueWithdrawalUrl</a>, passing the current account's <a href="/api/srp">2FA password</a> as an <a href="/type/InputCheckPasswordSRP">InputCheckPasswordSRP</a> constructor, generated <a href="/api/srp">as specified here »</a>. </p>
|
||||
<p>Only the channel owner can invoke this method, and only if the <a href="/api/config#channel-revenue-withdrawal-enabled">channel_revenue_withdrawal_enabled field is equal to <code>true</code> »</a>. </p>
|
||||
<p>To withdraw a channel's ad revenue, invoke <a href="/method/stats.getBroadcastRevenueWithdrawalUrl">stats.getBroadcastRevenueWithdrawalUrl</a>, passing the current account's <a href="/api/srp">2FA password</a> as an <a href="/type/InputCheckPasswordSRP">InputCheckPasswordSRP</a> constructor, generated <a href="/api/srp">as specified here »</a>. </p>
|
||||
<p>Only the channel owner can invoke this method, and only if the <a href="/api/config#channel-revenue-withdrawal-enabled">channel_revenue_withdrawal_enabled field is equal to <code>true</code> »</a>. </p>
|
||||
<p>The method will return a unique URL to a <a href="https://fragment.com/ads">Fragment</a> page where the user will be able to specify and submit the address of the TON wallet where the funds will be sent. </p>
|
||||
<h4><a class="anchor" href="#disable-ads-on-the-channel" id="disable-ads-on-the-channel" name="disable-ads-on-the-channel"><i class="anchor-icon"></i></a>Disable ads on the channel</h4>
|
||||
<pre><code><a href='/constructor/channelFull'>channelFull</a>#bbab348d flags:<a href='/type/%23'>#</a> can_view_participants:flags.3?<a href='/constructor/true'>true</a> can_set_username:flags.6?<a href='/constructor/true'>true</a> can_set_stickers:flags.7?<a href='/constructor/true'>true</a> hidden_prehistory:flags.10?<a href='/constructor/true'>true</a> can_set_location:flags.16?<a href='/constructor/true'>true</a> has_scheduled:flags.19?<a href='/constructor/true'>true</a> can_view_stats:flags.20?<a href='/constructor/true'>true</a> blocked:flags.22?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> can_delete_channel:flags2.0?<a href='/constructor/true'>true</a> antispam:flags2.1?<a href='/constructor/true'>true</a> participants_hidden:flags2.2?<a href='/constructor/true'>true</a> translations_disabled:flags2.3?<a href='/constructor/true'>true</a> stories_pinned_available:flags2.5?<a href='/constructor/true'>true</a> view_forum_as_messages:flags2.6?<a href='/constructor/true'>true</a> restricted_sponsored:flags2.11?<a href='/constructor/true'>true</a> can_view_revenue:flags2.12?<a href='/constructor/true'>true</a> paid_media_allowed:flags2.14?<a href='/constructor/true'>true</a> can_view_stars_revenue:flags2.15?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:<a href='/type/string'>string</a> participants_count:flags.0?<a href='/type/int'>int</a> admins_count:flags.1?<a href='/type/int'>int</a> kicked_count:flags.2?<a href='/type/int'>int</a> banned_count:flags.2?<a href='/type/int'>int</a> online_count:flags.13?<a href='/type/int'>int</a> read_inbox_max_id:<a href='/type/int'>int</a> read_outbox_max_id:<a href='/type/int'>int</a> unread_count:<a href='/type/int'>int</a> chat_photo:<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> exported_invite:flags.23?<a href='/type/ExportedChatInvite'>ExportedChatInvite</a> bot_info:<a href='/type/Vector%20t'>Vector</a><<a href='/type/BotInfo'>BotInfo</a>> migrated_from_chat_id:flags.4?<a href='/type/long'>long</a> migrated_from_max_id:flags.4?<a href='/type/int'>int</a> pinned_msg_id:flags.5?<a href='/type/int'>int</a> stickerset:flags.8?<a href='/type/StickerSet'>StickerSet</a> available_min_id:flags.9?<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> linked_chat_id:flags.14?<a href='/type/long'>long</a> location:flags.15?<a href='/type/ChannelLocation'>ChannelLocation</a> slowmode_seconds:flags.17?<a href='/type/int'>int</a> slowmode_next_send_date:flags.18?<a href='/type/int'>int</a> stats_dc:flags.12?<a href='/type/int'>int</a> pts:<a href='/type/int'>int</a> call:flags.21?<a href='/type/InputGroupCall'>InputGroupCall</a> ttl_period:flags.24?<a href='/type/int'>int</a> pending_suggestions:flags.25?<a href='/type/Vector%20t'>Vector</a><<a href='/type/string'>string</a>> groupcall_default_join_as:flags.26?<a href='/type/Peer'>Peer</a> theme_emoticon:flags.27?<a href='/type/string'>string</a> requests_pending:flags.28?<a href='/type/int'>int</a> recent_requesters:flags.28?<a href='/type/Vector%20t'>Vector</a><<a href='/type/long'>long</a>> default_send_as:flags.29?<a href='/type/Peer'>Peer</a> available_reactions:flags.30?<a href='/type/ChatReactions'>ChatReactions</a> reactions_limit:flags2.13?<a href='/type/int'>int</a> stories:flags2.4?<a href='/type/PeerStories'>PeerStories</a> wallpaper:flags2.7?<a href='/type/WallPaper'>WallPaper</a> boosts_applied:flags2.8?<a href='/type/int'>int</a> boosts_unrestrict:flags2.9?<a href='/type/int'>int</a> emojiset:flags2.10?<a href='/type/StickerSet'>StickerSet</a> = <a href='/type/ChatFull'>ChatFull</a>;
|
||||
|
@ -105,7 +105,7 @@
|
|||
---functions---
|
||||
|
||||
<a href='/method/channels.restrictSponsoredMessages'>channels.restrictSponsoredMessages</a>#9ae91519 channel:<a href='/type/InputChannel'>InputChannel</a> restricted:<a href='/type/Bool'>Bool</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||
<p>After reaching at least the boost level specified in the <a href="/api/config#channel-restrict-sponsored-level-min"><code>channel_restrict_sponsored_level_min</code> »</a> config parameter, channel owners may disable ads on the channel for all users using <a href="/method/channels.restrictSponsoredMessages">channels.restrictSponsoredMessages</a>. </p>
|
||||
<p>After reaching at least the boost level specified in the <a href="/api/config#channel-restrict-sponsored-level-min"><code>channel_restrict_sponsored_level_min</code> »</a> config parameter, channel owners may disable ads on the channel for all users using <a href="/method/channels.restrictSponsoredMessages">channels.restrictSponsoredMessages</a>. </p>
|
||||
<p>If ads are disabled on the channel, the <a href="/constructor/channelFull">channelFull</a>.<code>restricted_sponsored</code> flag will be set (owners only).</p></div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<p>Permissions are defined by the <a href="/constructor/chatBannedRights">chatBannedRights</a> constructor: all flags can be used except for <code>view_messages</code>, for more info see the constructor page.</p>
|
||||
<h3><a class="anchor" href="#suggested-bot-rights" id="suggested-bot-rights" name="suggested-bot-rights"><i class="anchor-icon"></i></a>Suggested bot rights</h3>
|
||||
<p><a href="/api/bots">Bots</a> can suggest a set of admin rights when being added to groups and channels. </p>
|
||||
<p>Bots can use <a href="/method/bots.setBotBroadcastDefaultAdminRights">bots.setBotBroadcastDefaultAdminRights</a> to indicate a suggested set of <a href="/api/rights">admin rights »</a> to use when adding the bot to a <a href="/api/channel">channel</a>, and <a href="/method/bots.setBotGroupDefaultAdminRights">bots.setBotGroupDefaultAdminRights</a> when adding the bot to a <a href="/api/channel">group</a>. </p>
|
||||
<p>Bots can use <a href="/method/bots.setBotBroadcastDefaultAdminRights">bots.setBotBroadcastDefaultAdminRights</a> to indicate a suggested set of <a href="/api/rights">admin rights »</a> to use when adding the bot to a <a href="/api/channel">channel</a>, and <a href="/method/bots.setBotGroupDefaultAdminRights">bots.setBotGroupDefaultAdminRights</a> when adding the bot to a <a href="/api/channel">group</a>. </p>
|
||||
<p>These suggested admin rights are contained in the <code>bot_broadcast_admin_rights</code> and <code>bot_group_admin_rights</code> paremeters of <a href="/constructor/userFull">userFull</a>, obtainable using <a href="/method/users.getFullUser">users.getFullUser</a>. </p>
|
||||
<p>A client application trying to add a bot as admin should fetch the default rights and present them as editable defaults to the user: the rights can then be modified before <a href="#admin-rights">setting the bot as admin</a>.</p>
|
||||
<p>Note that admin rights suggested by a <a href="/api/links#group-channel-bot-links">bot deep link</a> take priority over the suggested rights specified by <code>bot_broadcast_admin_rights</code> and <code>bot_group_admin_rights</code>: they can still be modified by the user before setting the bot as admin.</p></div>
|
||||
|
|
|
@ -150,7 +150,7 @@ if (message.peer_id == user_id) {
|
|||
|
||||
<a href='/method/messages.updateSavedReactionTag'>messages.updateSavedReactionTag</a>#60297dec flags:<a href='/type/%23'>#</a> reaction:<a href='/type/Reaction'>Reaction</a> title:flags.0?<a href='/type/string'>string</a> = <a href='/type/Bool'>Bool</a>;
|
||||
<a href='/method/messages.getSavedReactionTags'>messages.getSavedReactionTags</a>#3637e05b flags:<a href='/type/%23'>#</a> peer:flags.0?<a href='/type/InputPeer'>InputPeer</a> hash:<a href='/type/long'>long</a> = <a href='/type/messages.SavedReactionTags'>messages.SavedReactionTags</a>;</code></pre>
|
||||
<p>Tags are based on <a href="/api/reactions">reactions »</a>: adding a tag to a saved message is as easy as <a href="/api/reactions">reacting to it »</a> using <a href="/method/messages.sendReaction">messages.sendReaction</a>. </p>
|
||||
<p>Tags are based on <a href="/api/reactions">reactions »</a>: adding a tag to a saved message is as easy as <a href="/api/reactions">reacting to it »</a> using <a href="/method/messages.sendReaction">messages.sendReaction</a>. </p>
|
||||
<p>Reactions are considered as tags only for saved messages, if the following conditions are met:</p>
|
||||
<ul>
|
||||
<li>The saved message did not previously have any reaction,</li>
|
||||
|
|
|
@ -137,8 +137,8 @@ For example, when displaying the chat photo gallery, we could display a <code>ph
|
|||
<a href='/method/messages.searchGlobal'>messages.searchGlobal</a>#4bc6589a flags:<a href='/type/%23'>#</a> broadcasts_only:flags.1?<a href='/constructor/true'>true</a> folder_id:flags.0?<a href='/type/int'>int</a> q:<a href='/type/string'>string</a> filter:<a href='/type/MessagesFilter'>MessagesFilter</a> min_date:<a href='/type/int'>int</a> max_date:<a href='/type/int'>int</a> offset_rate:<a href='/type/int'>int</a> offset_peer:<a href='/type/InputPeer'>InputPeer</a> offset_id:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> = <a href='/type/messages.Messages'>messages.Messages</a>;</code></pre>
|
||||
<p>Contains results (peers and messages) from all private/secret chats, private/public groups, private/public channels, split in the following sections:</p>
|
||||
<ul>
|
||||
<li><code>Frequent contacts</code>: Contains avatars and names of the most frequently used users, sorted <a href="/api/top-rating">as specified here »</a> (<a href="/constructor/topPeerCategoryCorrespondents">topPeerCategoryCorrespondents</a> category). </li>
|
||||
<li><code>Recent</code>: Contains avatars and names of the most frequently used peers (users+chats+channels), sorted <a href="/api/top-rating">as specified here »</a> (<a href="/constructor/topPeerCategoryCorrespondents">topPeerCategoryCorrespondents</a>, <a href="/constructor/topPeerCategoryBotsPM">topPeerCategoryBotsPM</a>, <a href="/constructor/topPeerCategoryGroups">topPeerCategoryGroups</a>, <a href="/constructor/topPeerCategoryChannels">topPeerCategoryChannels</a> categories). </li>
|
||||
<li><code>Frequent contacts</code>: Contains avatars and names of the most frequently used users, sorted <a href="/api/top-rating">as specified here »</a> (<a href="/constructor/topPeerCategoryCorrespondents">topPeerCategoryCorrespondents</a> category). </li>
|
||||
<li><code>Recent</code>: Contains avatars and names of the most frequently used peers (users+chats+channels), sorted <a href="/api/top-rating">as specified here »</a> (<a href="/constructor/topPeerCategoryCorrespondents">topPeerCategoryCorrespondents</a>, <a href="/constructor/topPeerCategoryBotsPM">topPeerCategoryBotsPM</a>, <a href="/constructor/topPeerCategoryGroups">topPeerCategoryGroups</a>, <a href="/constructor/topPeerCategoryChannels">topPeerCategoryChannels</a> categories). </li>
|
||||
</ul>
|
||||
<p>Searching when in the "Chats" tab should invoke <a href="/method/messages.searchGlobal">messages.searchGlobal</a>, replacing the previously mentioned sections with a list of peers (avatar+name) and messages (max one message per peer). </p>
|
||||
<h4><a class="anchor" href="#channels-tab" id="channels-tab" name="channels-tab"><i class="anchor-icon"></i></a>Channels tab</h4>
|
||||
|
@ -164,8 +164,8 @@ For example, when displaying the chat photo gallery, we could display a <code>ph
|
|||
<a href='/method/bots.getPopularAppBots'>bots.getPopularAppBots</a>#c2510192 offset:<a href='/type/string'>string</a> limit:<a href='/type/int'>int</a> = <a href='/type/bots.PopularAppBots'>bots.PopularAppBots</a>;</code></pre>
|
||||
<p>Contains results from private/public channels only, split in the following sections:</p>
|
||||
<ul>
|
||||
<li><code>Channels you joined</code>: Contains avatars and names of the most frequently used channels, sorted <a href="/api/top-rating">as specified here »</a> (<a href="/constructor/topPeerCategoryChannels">topPeerCategoryChannels</a> category).</li>
|
||||
<li><code>Similar channels</code>: Contains avatars and names of recommended public channels, similar to the ones the current user has already joined, fetched using <a href="/method/channels.getChannelRecommendations">channels.getChannelRecommendations</a> without setting the <code>channel</code> flag, see <a href="/api/recommend">here »</a> for more info. </li>
|
||||
<li><code>Channels you joined</code>: Contains avatars and names of the most frequently used channels, sorted <a href="/api/top-rating">as specified here »</a> (<a href="/constructor/topPeerCategoryChannels">topPeerCategoryChannels</a> category).</li>
|
||||
<li><code>Similar channels</code>: Contains avatars and names of recommended public channels, similar to the ones the current user has already joined, fetched using <a href="/method/channels.getChannelRecommendations">channels.getChannelRecommendations</a> without setting the <code>channel</code> flag, see <a href="/api/recommend">here »</a> for more info. </li>
|
||||
</ul>
|
||||
<p>Searching when in the "Channels" tab should invoke <a href="/method/messages.searchGlobal">messages.searchGlobal</a> with the <code>broadcasts_only</code> flag set, replacing the previously mentioned sections with a list of peers (avatar+name+returned message, max one row per peer). </p>
|
||||
<h4><a class="anchor" href="#apps-tab" id="apps-tab" name="apps-tab"><i class="anchor-icon"></i></a>Apps tab</h4>
|
||||
|
@ -191,7 +191,7 @@ For example, when displaying the chat photo gallery, we could display a <code>ph
|
|||
<p>Used to implement the <a href="https://telegram.org/blog/w3-browser-mini-app-store#mini-app-store">Mini App Store</a>. </p>
|
||||
<p>Only contains bots with an associated <a href="/api/bots/webapps#main-mini-apps">Main Mini App</a> (i.e. those with the <a href="/constructor/user">user</a>.<code>bot_has_main_app</code> flag set), split in the following sections:</p>
|
||||
<ul>
|
||||
<li><code>Apps you use</code>: Contains avatars, names and MAU counters (from <a href="/constructor/user">user</a>.<code>bot_active_users</code>) for <a href="/api/bots/webapps#main-mini-apps">Main Mini Apps</a> of bots most frequently used by the user, sorted <a href="/api/top-rating">as specified here »</a> (<a href="/constructor/topPeerCategoryBotsApp">topPeerCategoryBotsApp</a> category). </li>
|
||||
<li><code>Apps you use</code>: Contains avatars, names and MAU counters (from <a href="/constructor/user">user</a>.<code>bot_active_users</code>) for <a href="/api/bots/webapps#main-mini-apps">Main Mini Apps</a> of bots most frequently used by the user, sorted <a href="/api/top-rating">as specified here »</a> (<a href="/constructor/topPeerCategoryBotsApp">topPeerCategoryBotsApp</a> category). </li>
|
||||
<li><code>Popular apps</code>: Contains avatars, names and MAU counters of the <a href="/api/bots/webapps#main-mini-apps">Main Mini Apps</a> of the bots returned by <a href="/method/bots.getPopularAppBots">bots.getPopularAppBots</a>. </li>
|
||||
</ul>
|
||||
<p>Searching when in the "Apps" tab should invoke <a href="/method/messages.searchGlobal">messages.searchGlobal</a>, replacing the previously mentioned sections with a list of avatars, names and MAU counters (from <a href="/constructor/user">user</a>.<code>bot_active_users</code>) for <a href="/api/bots/webapps#main-mini-apps">Main Mini Apps</a> of the returned bots (clients should only use the returned <code>users</code> field, filtering for bots with the <a href="/constructor/user">user</a>.<code>bot_has_main_app</code> flag set). </p>
|
||||
|
@ -223,7 +223,7 @@ For example, when displaying the chat photo gallery, we could display a <code>ph
|
|||
|
||||
<a href='/method/channels.searchPosts'>channels.searchPosts</a>#d19f987b hashtag:<a href='/type/string'>string</a> offset_rate:<a href='/type/int'>int</a> offset_peer:<a href='/type/InputPeer'>InputPeer</a> offset_id:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> = <a href='/type/messages.Messages'>messages.Messages</a>;</code></pre>
|
||||
<p>The special <a href="/method/channels.searchPosts">channels.searchPosts</a> method may be used to globally search for posts from public channels (<em>including</em> those we aren't a member of) and stories from public users, channels and groups (<em>including</em> non-contacts and peers we've never seen before), containing a specific hashtag (which should be passed in the <code>hashtag</code> field without the <code>#</code>). </p>
|
||||
<p>See <a href="/api/stories#searching-stories">here »</a> for more info on global search for <em>stories</em> (which should <em>not</em> be triggered when using the global search bar, but rather only when clicking on story hashtags and location tags).</p></div>
|
||||
<p>See <a href="/api/stories#searching-stories">here »</a> for more info on global search for <em>stories</em> (which should <em>not</em> be triggered when using the global search bar, but rather only when clicking on story hashtags and location tags).</p></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -68,12 +68,12 @@ sponsoredMessage#bdedf566 flags:# recommended:flags.5?true can_report:flags.12?t
|
|||
<li>A title (contained in <code>title</code>)</li>
|
||||
<li>A text (contained in <code>message</code>+<code>entities</code>)</li>
|
||||
<li>A button at the button (label in <code>button_text</code>) that when clicked, opens the URL in <code>url</code>.<br>
|
||||
A confirmation prompt should be shown before opening the URL, unless the host part of the URL matches the following regex: <code>(^|\\.)(telegram\.(org|me|dog)|t\.me|te\.?legra\.ph|graph\.org|fragment\.com|telesco\.pe)$</code>, in which case the URL should be opened without confirmation (and if it's a <a href="/api/links">deep link »</a>, it should be opened directly in-app, without passing through the browser). </li>
|
||||
A confirmation prompt should be shown before opening the URL, unless the host part of the URL matches the following regex: <code>(^|\\.)(telegram\.(org|me|dog)|t\.me|te\.?legra\.ph|graph\.org|fragment\.com|telesco\.pe)$</code>, in which case the URL should be opened without confirmation (and if it's a <a href="/api/links">deep link »</a>, it should be opened directly in-app, without passing through the browser). </li>
|
||||
</ul>
|
||||
<p>The message should be marked as "Recommended" instead of "Sponsored" if the <code>recommended</code> flag is set. </p>
|
||||
<p>If the <code>photo</code> flag is set, it should be used to display a profile photo bubble for the sponsored message, like for messages sent in groups. </p>
|
||||
<p>If the <code>sponsor_info</code> or <code>additional_info</code> flags are set, an additional "Sponsor info" menu item must be present in the message context menu (the menu that pops up when clicking on a button), that when clicked, displays the contents of the flags. </p>
|
||||
<p>If set, the sponsored message should use the <a href="/api/colors">message accent color »</a> specified in <code>color</code>.</p>
|
||||
<p>If set, the sponsored message should use the <a href="/api/colors">message accent color »</a> specified in <code>color</code>.</p>
|
||||
<h4><a class="anchor" href="#counting-sponsored-message-views" id="counting-sponsored-message-views" name="counting-sponsored-message-views"><i class="anchor-icon"></i></a>Counting sponsored message views</h4>
|
||||
<pre><code>---functions---
|
||||
|
||||
|
@ -120,7 +120,7 @@ The <code>title</code> field of <a href="/constructor/channels.sponsoredMessageR
|
|||
<p>For the channel <a href="https://t.me/SecretAdTestChannel">https://t.me/SecretAdTestChannel</a> the system will <strong>always</strong> return a sponsored message: promoting either a channel, a particular message in a channel, or a bot with a start parameter.</p>
|
||||
<h4><a class="anchor" href="#withdrawing-ad-revenue-as-a-channel-owner" id="withdrawing-ad-revenue-as-a-channel-owner" name="withdrawing-ad-revenue-as-a-channel-owner"><i class="anchor-icon"></i></a>Withdrawing ad revenue as a channel owner</h4>
|
||||
<p>Telegram has one of the <strong>most generous reward systems</strong> in the history of social media. Telegram channel owners can now receive <strong>50%</strong> of the revenue from ads displayed in their channels.</p>
|
||||
<p><a href="/api/revenue">See here »</a> for more info on how to withdraw channel ad revenue, as well as view detailed revenue stats. </p>
|
||||
<p><a href="/api/revenue">See here »</a> for more info on how to withdraw channel ad revenue, as well as view detailed revenue stats. </p>
|
||||
<hr>
|
||||
<h4><a class="anchor" href="#sponsored-messages-in-third-party-apps" id="sponsored-messages-in-third-party-apps" name="sponsored-messages-in-third-party-apps"><i class="anchor-icon"></i></a>Sponsored messages in third-party apps</h4>
|
||||
<p>Telegram continues to grow worldwide, in part thanks to third-party apps using the Telegram API. To cover the increasing costs that come with this growth, Telegram added <a href="https://promote.telegram.org">sponsored messages</a> – a paid <a href="https://t.me/durov/172">privacy-friendly way</a> to promote <strong>bots and channels</strong>. </p>
|
||||
|
|
|
@ -215,9 +215,9 @@ Use <a href="/method/account.cancelPasswordEmail">account.cancelPasswordEmail</a
|
|||
<h3><a class="anchor" href="#password-recovery" id="password-recovery" name="password-recovery"><i class="anchor-icon"></i></a>Password recovery</h3>
|
||||
<p>If the user has forgotten their 2FA password, the following recovery options are available: </p>
|
||||
<ul>
|
||||
<li>Logged-in sessions only: <a href="#password-reset">password reset »</a></li>
|
||||
<li>Logged-in and not logged-in sessions: <a href="#email-recovery">email recovery »</a></li>
|
||||
<li>Not logged-in sessions: <a href="#account-deletion">account deletion »</a></li>
|
||||
<li>Logged-in sessions only: <a href="#password-reset">password reset »</a></li>
|
||||
<li>Logged-in and not logged-in sessions: <a href="#email-recovery">email recovery »</a></li>
|
||||
<li>Not logged-in sessions: <a href="#account-deletion">account deletion »</a></li>
|
||||
</ul>
|
||||
<h4><a class="anchor" href="#password-reset" id="password-reset" name="password-reset"><i class="anchor-icon"></i></a>Password reset</h4>
|
||||
<p>Password reset can be requested from logged-in sessions only. </p>
|
||||
|
@ -234,15 +234,15 @@ Use <a href="/method/account.cancelPasswordEmail">account.cancelPasswordEmail</a
|
|||
On success, the call will initially return a <a href="/constructor/account.resetPasswordRequestedWait">account.resetPasswordRequestedWait</a> constructor and start a 7-day server-side timer, during which the user can abort the reset process using a button sent by the Telegram service account or directly in-UI using <a href="/method/account.declinePasswordReset">account.declinePasswordReset</a>. </p>
|
||||
<p>When the time comes, <a href="/method/account.resetPassword">account.resetPassword</a> is invoked once more, returning a <a href="/constructor/account.resetPasswordOk">account.resetPasswordOk</a> to indicate that the password was successfully reset. </p>
|
||||
<p>If the user recently requested a password reset that was canceled, <a href="/constructor/account.resetPasswordFailedWait">account.resetPasswordFailedWait</a> will be returned by the initial <a href="/method/account.resetPassword">account.resetPassword</a> call, and they must wait until the specified date before requesting another reset. </p>
|
||||
<p>Note that if the user already knows their 2FA password and simply wants to disable 2FA, <a href="#setting-a-new-2fa-password">the same process used to enable the password must also be used to disable it »</a>.</p>
|
||||
<p>Note that if the user already knows their 2FA password and simply wants to disable 2FA, <a href="#setting-a-new-2fa-password">the same process used to enable the password must also be used to disable it »</a>.</p>
|
||||
<h4><a class="anchor" href="#email-recovery" id="email-recovery" name="email-recovery"><i class="anchor-icon"></i></a>Email recovery</h4>
|
||||
<p>Email recovery can be requested from logged in sessions, and from non-logged in sessions if the user has successfully provided the login code.<br>
|
||||
In both cases, the account must have an associated <a href="#email-verification">recovery email »</a>. </p>
|
||||
In both cases, the account must have an associated <a href="#email-verification">recovery email »</a>. </p>
|
||||
<p>In order to recover a forgotten 2FA password, an email must be sent to the <a href="#email-verification">previously specified address</a> using the <a href="/method/auth.requestPasswordRecovery">auth.requestPasswordRecovery</a> method.<br>
|
||||
Use <a href="/method/auth.checkRecoveryPassword">auth.checkRecoveryPassword</a> to make sure that the user provided a valid code.<br>
|
||||
Then use <a href="/method/auth.recoverPassword">auth.recoverPassword</a> with the received code to delete the current 2FA password, to set a new one follow <a href="/api/srp">these instructions »</a>.</p>
|
||||
Then use <a href="/method/auth.recoverPassword">auth.recoverPassword</a> with the received code to delete the current 2FA password, to set a new one follow <a href="/api/srp">these instructions »</a>.</p>
|
||||
<h4><a class="anchor" href="#account-deletion" id="account-deletion" name="account-deletion"><i class="anchor-icon"></i></a>Account deletion</h4>
|
||||
<p>If the user has successfully provided the login code, but they forgot their <a href="/api/srp">2FA</a> password and they don't have access to any other logged-in session, the account can be deleted following <a href="/api/account-deletion">these instructions »</a>. </p>
|
||||
<p>If the user has successfully provided the login code, but they forgot their <a href="/api/srp">2FA</a> password and they don't have access to any other logged-in session, the account can be deleted following <a href="/api/account-deletion">these instructions »</a>. </p>
|
||||
<h3><a class="anchor" href="#using-the-2fa-password" id="using-the-2fa-password" name="using-the-2fa-password"><i class="anchor-icon"></i></a>Using the 2FA password</h3>
|
||||
<p>Multiple methods in the API such as those used to make <a href="/api/payments">payments</a>, <a href="/method/channels.editCreator">transfer channel ownership</a> and others require the user to authenticate using the 2FA password passed as an <a href="/type/InputCheckPasswordSRP">InputCheckPasswordSRP</a> constructor, generated as specified <a href="#checking-the-password-with-srp">above</a>. </p>
|
||||
<p>All such methods where a password verification is required <em>after login</em> may emit the following RPC errors: </p>
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
<p>Telegram Stars are virtual items that allow users to purchase digital goods and services from bots and mini apps inside the Telegram ecosystem, send gifts to content creators on the Telegram platform, and more. </p>
|
||||
<p>This page describes the methods used to buy, use and withdraw <a href="https://telegram.org/blog/mini-app-bar-paid-media-and-more#rewards-for-content-creators-and-developers">Telegram Stars</a>, as well as view detailed revenue stats and make purchases using Telegram Stars. </p>
|
||||
<p>Clients should disable Telegram Stars support for the current user if the <a href="/api/config#stars-purchase-blocked">stars_purchase_blocked field is equal to <code>true</code> »</a> due to regional limitations. </p>
|
||||
<p>Clients should disable Telegram Stars support for the current user if the <a href="/api/config#stars-purchase-blocked">stars_purchase_blocked field is equal to <code>true</code> »</a> due to regional limitations. </p>
|
||||
<h3><a class="anchor" href="#balance-and-transaction-history" id="balance-and-transaction-history" name="balance-and-transaction-history"><i class="anchor-icon"></i></a>Balance and transaction history</h3>
|
||||
<pre><code><a href='/constructor/inputStarsTransaction'>inputStarsTransaction</a>#206ae6d1 flags:<a href='/type/%23'>#</a> refund:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/string'>string</a> = <a href='/type/InputStarsTransaction'>InputStarsTransaction</a>;
|
||||
|
||||
|
@ -72,8 +72,8 @@
|
|||
|
||||
<a href='/method/payments.getStarsTransactionsByID'>payments.getStarsTransactionsByID</a>#27842d2e peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputStarsTransaction'>InputStarsTransaction</a>> = <a href='/type/payments.StarsStatus'>payments.StarsStatus</a>;</code></pre>
|
||||
<p>Use <a href="/method/payments.getStarsStatus">payments.getStarsStatus</a> to get the current stars balance of the current account (with peer=<a href="/constructor/inputPeerSelf">inputPeerSelf</a>), or the stars balance of the bot or channel specified in <code>peer</code>.<br>
|
||||
The method will also return the last 5 <a href="/constructor/starsTransaction">star transactions »</a>.<br>
|
||||
To return all <a href="/constructor/starsTransaction">star transactions »</a> (and optionally search using filters), use <a href="/method/payments.getStarsTransactions">payments.getStarsTransactions</a>, paginating through the transactions passing the returned <code>next_offset</code> (if set) to <code>offset</code> <a href="/api/offsets">as usual</a>. </p>
|
||||
The method will also return the last 5 <a href="/constructor/starsTransaction">star transactions »</a>.<br>
|
||||
To return all <a href="/constructor/starsTransaction">star transactions »</a> (and optionally search using filters), use <a href="/method/payments.getStarsTransactions">payments.getStarsTransactions</a>, paginating through the transactions passing the returned <code>next_offset</code> (if set) to <code>offset</code> <a href="/api/offsets">as usual</a>. </p>
|
||||
<p><a href="/method/payments.getStarsTransactionsByID">payments.getStarsTransactionsByID</a> may be used to fetch info about specific Telegram Star transactions (or refunds) using their IDs, passed as <a href="/constructor/inputStarsTransaction">inputStarsTransaction</a> constructors. </p>
|
||||
<p>Changes in the star balance (through <a href="#buying-or-gifting-stars">topups</a> or <a href="#using-stars">purchases</a>) will be notified by the server via an <a href="/constructor/updateStarsBalance">updateStarsBalance</a> update.</p>
|
||||
<h3><a class="anchor" href="#revenue-statistics" id="revenue-statistics" name="revenue-statistics"><i class="anchor-icon"></i></a>Revenue statistics</h3>
|
||||
|
@ -87,14 +87,14 @@ To return all <a href="/constructor/starsTransaction">star transactions »</a> (
|
|||
|
||||
<a href='/method/payments.getStarsRevenueStats'>payments.getStarsRevenueStats</a>#d91ffad6 flags:<a href='/type/%23'>#</a> dark:flags.0?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/payments.StarsRevenueStats'>payments.StarsRevenueStats</a>;</code></pre>
|
||||
<p>Telegram Star revenue statistics may be fetched by bot owners, and by channel admins if the <a href="/constructor/channelFull">channelFull</a>.<code>can_view_stars_revenue</code> flag is set. </p>
|
||||
<p>Use <a href="/method/payments.getStarsRevenueStats">payments.getStarsRevenueStats</a> to fetch statistics about earned Telegram Stars; the returned <a href="/type/StatsGraph">StatsGraph</a> graphs can be rendered <a href="/api/stats#graph-visualization">as described here »</a>. </p>
|
||||
<p>Use <a href="/method/payments.getStarsRevenueStats">payments.getStarsRevenueStats</a> to fetch statistics about earned Telegram Stars; the returned <a href="/type/StatsGraph">StatsGraph</a> graphs can be rendered <a href="/api/stats#graph-visualization">as described here »</a>. </p>
|
||||
<p>Specifically:</p>
|
||||
<ul>
|
||||
<li><code>revenue_graph</code> - Star revenue graph (number of earned stars)</li>
|
||||
<li><code>status</code> - Current balance, current withdrawable balance and overall earned Telegram Stars</li>
|
||||
<li><code>usd_rate</code> - Current conversion rate of Telegram Stars to USD</li>
|
||||
</ul>
|
||||
<p>The server will emit an <a href="/constructor/updateStarsRevenueStatus">updateStarsRevenueStatus</a> every time the balance changes; if the client is currently in the Monetization tab of the channel or bot, this update should apply the new balances (contained in the update), and refresh the transaction list using <a href="/method/payments.getStarsTransactions">payments.getStarsTransactions</a> as specified <a href="#balance-and-transaction-history">here »</a>. </p>
|
||||
<p>The server will emit an <a href="/constructor/updateStarsRevenueStatus">updateStarsRevenueStatus</a> every time the balance changes; if the client is currently in the Monetization tab of the channel or bot, this update should apply the new balances (contained in the update), and refresh the transaction list using <a href="/method/payments.getStarsTransactions">payments.getStarsTransactions</a> as specified <a href="#balance-and-transaction-history">here »</a>. </p>
|
||||
<h3><a class="anchor" href="#buying-or-gifting-stars" id="buying-or-gifting-stars" name="buying-or-gifting-stars"><i class="anchor-icon"></i></a>Buying or gifting stars</h3>
|
||||
<pre><code><a href='/constructor/starsTopupOption'>starsTopupOption</a>#bd915c0 flags:<a href='/type/%23'>#</a> extended:flags.1?<a href='/constructor/true'>true</a> stars:<a href='/type/long'>long</a> store_product:flags.0?<a href='/type/string'>string</a> currency:<a href='/type/string'>string</a> amount:<a href='/type/long'>long</a> = <a href='/type/StarsTopupOption'>StarsTopupOption</a>;
|
||||
|
||||
|
@ -112,9 +112,9 @@ To return all <a href="/constructor/starsTransaction">star transactions »</a> (
|
|||
<a href='/method/payments.getStarsGiftOptions'>payments.getStarsGiftOptions</a>#d3c96bc8 flags:<a href='/type/%23'>#</a> user_id:flags.0?<a href='/type/InputUser'>InputUser</a> = <a href='/type/Vector%20t'>Vector</a><<a href='/type/StarsGiftOption'>StarsGiftOption</a>>;</code></pre>
|
||||
<p>To purchase telegram stars for ourselves, first invoke the <a href="/method/payments.getStarsTopupOptions">payments.getStarsTopupOptions</a> method, to obtain a list of topup options as <a href="/constructor/starsTopupOption">starsTopupOption</a> constructors. </p>
|
||||
<p>To purchase telegram stars for a friend, first invoke the <a href="/method/payments.getStarsGiftOptions">payments.getStarsGiftOptions</a> method, to obtain a list of gift options as <a href="/constructor/starsGiftOption">starsGiftOption</a> constructors. </p>
|
||||
<p><strong>Note</strong>: Star gifting functionality should only be enabled if the <a href="/api/config#stars-gifts-enabled">stars_gifts_enabled »</a> flag is equal to true. </p>
|
||||
<p><strong>Note</strong>: Star gifting functionality should only be enabled if the <a href="/api/config#stars-gifts-enabled">stars_gifts_enabled »</a> flag is equal to true. </p>
|
||||
<p>Once the user has chosen a specific star topup/gift option, invoke <a href="/method/payments.getPaymentForm">payments.getPaymentForm</a>, passing an <a href="/constructor/inputInvoiceStars">inputInvoiceStars</a>, with either <a href="/constructor/inputStorePaymentStarsTopup">inputStorePaymentStarsTopup</a> or <a href="/constructor/inputStorePaymentStarsGift">inputStorePaymentStarsGift</a>, populated with the values from the chosen <a href="/constructor/starsTopupOption">starsTopupOption</a>/<a href="/constructor/starsGiftOption">starsGiftOption</a>.</p>
|
||||
<p>Then, follow the <a href="/api/payments#22-getting-invoice-info-about-the-product">invoice payment flow as described in the payments documentation »</a>. </p>
|
||||
<p>Then, follow the <a href="/api/payments#22-getting-invoice-info-about-the-product">invoice payment flow as described in the payments documentation »</a>. </p>
|
||||
<p>More alternative payment flows are also available:</p>
|
||||
<ul>
|
||||
<li>Payment via <a href="https://fragment.com">Fragment</a>, which also allows making larger purchases.</li>
|
||||
|
@ -132,16 +132,16 @@ Clients should display this message, along with a sticker from the <a href="/con
|
|||
<a href='/method/payments.sendStarsForm'>payments.sendStarsForm</a>#02bb731d flags:<a href='/type/%23'>#</a> form_id:<a href='/type/long'>long</a> invoice:<a href='/type/InputInvoice'>InputInvoice</a> = <a href='/type/payments.PaymentResult'>payments.PaymentResult</a>;
|
||||
|
||||
<a href='/method/payments.refundStarsCharge'>payments.refundStarsCharge</a>#25ae8f4a user_id:<a href='/type/InputUser'>InputUser</a> charge_id:<a href='/type/string'>string</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||
<p>The full flow to follow to make purchases using Telegram Stars is described along the traditional payment flow in the <a href="/api/payments">payments documentation »</a>: all invoices and constructors working with currency amounts will use the currency code <code>XTR</code>, and the amounts will be in Telegram Stars. </p>
|
||||
<p>The full flow to follow to make purchases using Telegram Stars is described along the traditional payment flow in the <a href="/api/payments">payments documentation »</a>: all invoices and constructors working with currency amounts will use the currency code <code>XTR</code>, and the amounts will be in Telegram Stars. </p>
|
||||
<h4><a class="anchor" href="#paid-media" id="paid-media" name="paid-media"><i class="anchor-icon"></i></a>Paid media</h4>
|
||||
<p>Telegram Stars are used to pay for <a href="/api/paid-media">paid media</a>, which may be posted on channels by administrators as specified <a href="/api/paid-media">here »</a>. </p>
|
||||
<p>Purchasing paid media will transfer Telegram Stars to the channel's balance.<br>
|
||||
Channel owners can then <a href="#withdrawing-revenue">withdraw Stars as Toncoin »</a>, or <a href="#paying-for-ads">use Stars to place ads for the channel »</a>. </p>
|
||||
Channel owners can then <a href="#withdrawing-revenue">withdraw Stars as Toncoin »</a>, or <a href="#paying-for-ads">use Stars to place ads for the channel »</a>. </p>
|
||||
<p><a href="#revenue-statistics">Star revenue statistics</a> and <a href="#balance-and-transaction-history">balance information</a> is also available to channel owners. </p>
|
||||
<h4><a class="anchor" href="#bot-payments" id="bot-payments" name="bot-payments"><i class="anchor-icon"></i></a>Bot payments</h4>
|
||||
<p>Telegram Stars are also used to pay for digital services in bots, using <a href="/constructor/keyboardButtonBuy">keyboardButtonBuy</a> and <a href="/api/payments">the usual payment flow »</a>, with <code>currency="XTR"</code>. </p>
|
||||
<p>Telegram Stars are also used to pay for digital services in bots, using <a href="/constructor/keyboardButtonBuy">keyboardButtonBuy</a> and <a href="/api/payments">the usual payment flow »</a>, with <code>currency="XTR"</code>. </p>
|
||||
<p>Purchasing paid media will transfer Telegram Stars to the bot's balance.<br>
|
||||
Bot owners can then <a href="#withdrawing-revenue">withdraw Stars as Toncoin »</a>, or <a href="#paying-for-ads">use Stars to place ads for the channel »</a>. </p>
|
||||
Bot owners can then <a href="#withdrawing-revenue">withdraw Stars as Toncoin »</a>, or <a href="#paying-for-ads">use Stars to place ads for the channel »</a>. </p>
|
||||
<p><a href="#revenue-statistics">Star revenue statistics</a> and <a href="#balance-and-transaction-history">balance information</a> is also available to bot owners. </p>
|
||||
<h3><a class="anchor" href="#withdrawing-revenue" id="withdrawing-revenue" name="withdrawing-revenue"><i class="anchor-icon"></i></a>Withdrawing revenue</h3>
|
||||
<pre><code><a href='/constructor/payments.starsRevenueWithdrawalUrl'>payments.starsRevenueWithdrawalUrl</a>#1dab80b7 url:<a href='/type/string'>string</a> = <a href='/type/payments.StarsRevenueWithdrawalUrl'>payments.StarsRevenueWithdrawalUrl</a>;
|
||||
|
@ -149,8 +149,8 @@ Bot owners can then <a href="#withdrawing-revenue">withdraw Stars as Toncoin »<
|
|||
---functions---
|
||||
|
||||
<a href='/method/payments.getStarsRevenueWithdrawalUrl'>payments.getStarsRevenueWithdrawalUrl</a>#13bbe8b3 peer:<a href='/type/InputPeer'>InputPeer</a> stars:<a href='/type/long'>long</a> password:<a href='/type/InputCheckPasswordSRP'>InputCheckPasswordSRP</a> = <a href='/type/payments.StarsRevenueWithdrawalUrl'>payments.StarsRevenueWithdrawalUrl</a>;</code></pre>
|
||||
<p>To withdraw funds from the star balance of a channel or bot we own, invoke <a href="/method/payments.getStarsRevenueWithdrawalUrl">payments.getStarsRevenueWithdrawalUrl</a>, passing the current account's <a href="/api/srp">2FA password</a> as an <a href="/type/InputCheckPasswordSRP">InputCheckPasswordSRP</a> constructor, generated <a href="/api/srp">as specified here »</a>. </p>
|
||||
<p>Only the channel/bot owner can invoke this method, and only if the balance is bigger than or equal to <a href="/api/config#stars-revenue-withdrawal-min">stars_revenue_withdrawal_min »</a> and the <code>status.withdrawal_enabled</code> flag returned by <a href="/method/payments.getStarsRevenueStats">payments.getStarsRevenueStats</a> is set. </p>
|
||||
<p>To withdraw funds from the star balance of a channel or bot we own, invoke <a href="/method/payments.getStarsRevenueWithdrawalUrl">payments.getStarsRevenueWithdrawalUrl</a>, passing the current account's <a href="/api/srp">2FA password</a> as an <a href="/type/InputCheckPasswordSRP">InputCheckPasswordSRP</a> constructor, generated <a href="/api/srp">as specified here »</a>. </p>
|
||||
<p>Only the channel/bot owner can invoke this method, and only if the balance is bigger than or equal to <a href="/api/config#stars-revenue-withdrawal-min">stars_revenue_withdrawal_min »</a> and the <code>status.withdrawal_enabled</code> flag returned by <a href="/method/payments.getStarsRevenueStats">payments.getStarsRevenueStats</a> is set. </p>
|
||||
<p>The method will return a unique URL to a <a href="https://fragment.com/">Fragment</a> page where the user will be able to specify and submit the address of the TON wallet where the funds will be sent. </p>
|
||||
<h3><a class="anchor" href="#paying-for-ads" id="paying-for-ads" name="paying-for-ads"><i class="anchor-icon"></i></a>Paying for ads</h3>
|
||||
<pre><code><a href='/constructor/starsTransactionPeerAds'>starsTransactionPeerAds</a>#60682812 = <a href='/type/StarsTransactionPeer'>StarsTransactionPeer</a>;
|
||||
|
|
|
@ -87,7 +87,7 @@ Note that in this case, <code>current</code> refers to the <code>period</code> i
|
|||
<li>Percentage of subscribers with enabled notifications (<code>enabled_notifications</code>)</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Graphs: <a href="#graph-visualization">graphs are described below »</a>. </li>
|
||||
<li>Graphs: <a href="#graph-visualization">graphs are described below »</a>. </li>
|
||||
</ul>
|
||||
<h3><a class="anchor" href="#supergroup-statistics" id="supergroup-statistics" name="supergroup-statistics"><i class="anchor-icon"></i></a>Supergroup statistics</h3>
|
||||
<p>Schema:</p>
|
||||
|
@ -107,7 +107,7 @@ Note that in this case, <code>current</code> refers to the <code>period</code> i
|
|||
<a href='/method/channels.getFullChannel'>channels.getFullChannel</a>#8736a09 channel:<a href='/type/InputChannel'>InputChannel</a> = <a href='/type/messages.ChatFull'>messages.ChatFull</a>;</code></pre>
|
||||
<p>Administrators of <a href="/api/channel">supergroups</a> of a certain size (the exact limit is a server-side config, returned in the <code>can_view_stats</code> flag of <a href="/constructor/channelFull">channelFull</a>) can call <a href="/method/stats.getMegagroupStats">stats.getMegagroupStats</a> to get detailed supergroup statistics.<br>
|
||||
The query must be sent to the datacenter with ID <code>channelFull.stats_dc</code>, obtainable using <a href="/method/channels.getFullChannel">channels.getFullChannel</a>.<br>
|
||||
The returned <a href="/constructor/stats.broadcastStats">stats.broadcastStats</a> contains multiple statistics, see the <a href="/constructor/stats.broadcastStats">constructor page for more info »</a>. </p>
|
||||
The returned <a href="/constructor/stats.broadcastStats">stats.broadcastStats</a> contains multiple statistics, see the <a href="/constructor/stats.broadcastStats">constructor page for more info »</a>. </p>
|
||||
<h3><a class="anchor" href="#message-statistics" id="message-statistics" name="message-statistics"><i class="anchor-icon"></i></a>Message statistics</h3>
|
||||
<pre><code><a href='/constructor/stats.messageStats'>stats.messageStats</a>#7fe91c14 views_graph:<a href='/type/StatsGraph'>StatsGraph</a> reactions_by_emotion_graph:<a href='/type/StatsGraph'>StatsGraph</a> = <a href='/type/stats.MessageStats'>stats.MessageStats</a>;
|
||||
|
||||
|
|
|
@ -65,18 +65,18 @@
|
|||
<p>The <a href="/constructor/documentAttributeSticker">documentAttributeSticker</a> attribute contains information about the associated <a href="#stickersets">stickerset</a>, the emoji that represents the sticker, and more. </p>
|
||||
<p>There are multiple available sticker types:</p>
|
||||
<ul>
|
||||
<li><a href="#static-stickers">Static stickers »</a></li>
|
||||
<li><a href="#animated-stickers">Animated stickers »</a></li>
|
||||
<li><a href="#video-stickers">Video stickers »</a></li>
|
||||
<li><a href="#static-stickers">Static stickers »</a></li>
|
||||
<li><a href="#animated-stickers">Animated stickers »</a></li>
|
||||
<li><a href="#video-stickers">Video stickers »</a></li>
|
||||
</ul>
|
||||
<p>Like all files, stickers have a set of previews that should be handled as described <a href="/api/files#image-thumbnail-types">here »</a>.</p>
|
||||
<p>Stickers are organized in <a href="#stickersets">stickersets »</a>, and are also used in the following contexts:</p>
|
||||
<p>Like all files, stickers have a set of previews that should be handled as described <a href="/api/files#image-thumbnail-types">here »</a>.</p>
|
||||
<p>Stickers are organized in <a href="#stickersets">stickersets »</a>, and are also used in the following contexts:</p>
|
||||
<ul>
|
||||
<li><a href="/api/dice">Dice »</a></li>
|
||||
<li><a href="/api/animated-emojis">Animated emojis »</a></li>
|
||||
<li><a href="/api/custom-emoji">Custom emojis »</a></li>
|
||||
<li><a href="/api/reactions">Reactions »</a></li>
|
||||
<li><a href="#mask-stickers">Mask stickers »</a></li>
|
||||
<li><a href="/api/dice">Dice »</a></li>
|
||||
<li><a href="/api/animated-emojis">Animated emojis »</a></li>
|
||||
<li><a href="/api/custom-emoji">Custom emojis »</a></li>
|
||||
<li><a href="/api/reactions">Reactions »</a></li>
|
||||
<li><a href="#mask-stickers">Mask stickers »</a></li>
|
||||
</ul>
|
||||
<p>A single stickerset can contain a mix of <a href="#static-stickers">static</a>, <a href="#animated-stickers">animated</a> and <a href="#video-stickers">video</a> stickers.</p>
|
||||
<h4><a class="anchor" href="#static-stickers" id="static-stickers" name="static-stickers"><i class="anchor-icon"></i></a>Static stickers</h4>
|
||||
|
@ -87,9 +87,9 @@
|
|||
<li>Transparency is supported.</li>
|
||||
</ul>
|
||||
<p>They're identified by <code>mime_type</code> field of the associated <a href="/constructor/document">document</a>, always equal to <code>image/webp</code>.</p>
|
||||
<p>See <a href="/stickers#static-stickers-and-emoji">here »</a> for tips on how to create the perfect static sticker, and <a href="#creating-stickersets">here »</a> for info on how to upload it using the API.</p>
|
||||
<p>See <a href="/stickers#static-stickers-and-emoji">here »</a> for tips on how to create the perfect static sticker, and <a href="#creating-stickersets">here »</a> for info on how to upload it using the API.</p>
|
||||
<h4><a class="anchor" href="#animated-stickers" id="animated-stickers" name="animated-stickers"><i class="anchor-icon"></i></a>Animated stickers</h4>
|
||||
<p>Animated stickers are <a href="https://en.wikipedia.org/wiki/Lottie_(file_format)">Lottie vector animations »</a>. </p>
|
||||
<p>Animated stickers are <a href="https://en.wikipedia.org/wiki/Lottie_(file_format)">Lottie vector animations »</a>. </p>
|
||||
<p>Telegram uses a special <code>.tgs</code> file format for lottie animations, which consists in a gzipped bodymovin JSON file, playable using the <a href="https://github.com/Samsung/rlottie">rlottie</a> library. </p>
|
||||
<p>Lottie animation specs:</p>
|
||||
<ul>
|
||||
|
@ -100,7 +100,7 @@
|
|||
<li>All animations must run at 60 Frames Per Second.</li>
|
||||
</ul>
|
||||
<p>They're identified by <code>mime_type</code> field of the associated <a href="/constructor/document">document</a>, always equal to <code>application/x-tgsticker</code>.</p>
|
||||
<p>See <a href="/stickers#creating-animations">here »</a> for tips on how to create the perfect animated sticker, and <a href="#creating-stickersets">here »</a> for info on how to upload it using the API.</p>
|
||||
<p>See <a href="/stickers#creating-animations">here »</a> for tips on how to create the perfect animated sticker, and <a href="#creating-stickersets">here »</a> for info on how to upload it using the API.</p>
|
||||
<h5><a class="anchor" href="#premium-animated-sticker-effects" id="premium-animated-sticker-effects" name="premium-animated-sticker-effects"><i class="anchor-icon"></i></a>Premium animated sticker effects</h5>
|
||||
<pre><code><a href='/constructor/document'>document</a>#8fd4c4d8 flags:<a href='/type/%23'>#</a> id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> file_reference:<a href='/type/bytes'>bytes</a> date:<a href='/type/int'>int</a> mime_type:<a href='/type/string'>string</a> size:<a href='/type/long'>long</a> thumbs:flags.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/PhotoSize'>PhotoSize</a>> video_thumbs:flags.1?<a href='/type/Vector%20t'>Vector</a><<a href='/type/VideoSize'>VideoSize</a>> dc_id:<a href='/type/int'>int</a> attributes:<a href='/type/Vector%20t'>Vector</a><<a href='/type/DocumentAttribute'>DocumentAttribute</a>> = <a href='/type/Document'>Document</a>;
|
||||
|
||||
|
@ -112,9 +112,9 @@
|
|||
<p>It should be played the first time the sticker scrolls into view; it should be played again if the chat is closed and then opened again. </p>
|
||||
<p>Premium stickers may only be <em>sent</em> by users with a <a href="/api/premium">Premium</a> subscription, and the animated effect should be played by all users, including those without a Premium subscription. </p>
|
||||
<p>A premium sticker is identified by the presence of a <a href="/constructor/videoSize">videoSize</a> of <code>type=f</code> in the sticker's main <a href="/constructor/document">document</a>.<br>
|
||||
The TGS file of the animated effect (different from the TGS file of the sticker itself) may be fetched by using <a href="/constructor/inputDocumentFileLocation">inputDocumentFileLocation</a> with <code>thumb_size=f</code>, as specified <a href="/api/files#downloading-files">here »</a>. </p>
|
||||
<p>Note that <a href="/api/effects">animated message effects »</a> can also re-use the animated effect of a premium sticker. </p>
|
||||
<p>Also, premium animated stickers may be sent with an extra <a href="/api/effects">animated message effect »</a>, in which case both the effect of the sticker and the additional effect should be played simultaneously. </p>
|
||||
The TGS file of the animated effect (different from the TGS file of the sticker itself) may be fetched by using <a href="/constructor/inputDocumentFileLocation">inputDocumentFileLocation</a> with <code>thumb_size=f</code>, as specified <a href="/api/files#downloading-files">here »</a>. </p>
|
||||
<p>Note that <a href="/api/effects">animated message effects »</a> can also re-use the animated effect of a premium sticker. </p>
|
||||
<p>Also, premium animated stickers may be sent with an extra <a href="/api/effects">animated message effect »</a>, in which case both the effect of the sticker and the additional effect should be played simultaneously. </p>
|
||||
<h4><a class="anchor" href="#video-stickers" id="video-stickers" name="video-stickers"><i class="anchor-icon"></i></a>Video stickers</h4>
|
||||
<p>Video stickers are <a href="https://en.wikipedia.org/wiki/VP9">VP9</a> videos with the following specs:</p>
|
||||
<ul>
|
||||
|
@ -128,7 +128,7 @@ The TGS file of the animated effect (different from the TGS file of the sticker
|
|||
<li>The video should be looped for optimal user experience.</li>
|
||||
</ul>
|
||||
<p>They're identified by <code>mime_type</code> field of the associated <a href="/constructor/document">document</a>, always equal to <code>video/webm</code>.</p>
|
||||
<p>See <a href="/stickers#video-stickers-and-emoji">here »</a> for tips on how to create the perfect video sticker, and <a href="#creating-stickersets">here »</a> for info on how to upload it using the API.</p>
|
||||
<p>See <a href="/stickers#video-stickers-and-emoji">here »</a> for tips on how to create the perfect video sticker, and <a href="#creating-stickersets">here »</a> for info on how to upload it using the API.</p>
|
||||
<h3><a class="anchor" href="#stickersets" id="stickersets" name="stickersets"><i class="anchor-icon"></i></a>Stickersets</h3>
|
||||
<pre><code><a href='/constructor/inputStickerSetID'>inputStickerSetID</a>#9de7a269 id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputStickerSet'>InputStickerSet</a>;
|
||||
<a href='/constructor/inputStickerSetShortName'>inputStickerSetShortName</a>#861cc8a0 short_name:<a href='/type/string'>string</a> = <a href='/type/InputStickerSet'>InputStickerSet</a>;
|
||||
|
@ -154,7 +154,7 @@ The TGS file of the animated effect (different from the TGS file of the sticker
|
|||
<p>Stickers are grouped together in so-called sticker packs: however, in the API they're referred to as "sticker sets", and the name "sticker pack" is reserved for something else, read on for more info. </p>
|
||||
<p>Use <a href="/method/messages.getStickerSet">messages.getStickerSet</a> to fetch information about the stickerset, providing the following parameters:</p>
|
||||
<ul>
|
||||
<li><code>stickerset</code> - One of the constructors specified <a href="/type/InputStickerSet">here »</a>, choose the correct one, according to the stickerset that is being fetched. </li>
|
||||
<li><code>stickerset</code> - One of the constructors specified <a href="/type/InputStickerSet">here »</a>, choose the correct one, according to the stickerset that is being fetched. </li>
|
||||
<li><code>hash</code> - Initially 0, afterwards should contain the <code>hash</code> field from the returned <a href="/constructor/stickerSet">stickerSet</a>.</li>
|
||||
</ul>
|
||||
<p>The method will return a <a href="/constructor/messages.stickerSetNotModified">messages.stickerSetNotModified</a> if a non-zero <code>hash</code> is provided and the stickerset wasn't modified since the last time we fetched it.<br>
|
||||
|
@ -177,7 +177,7 @@ This field is actually used to allow associating more than one emoji to a sticke
|
|||
<li><a href="/constructor/stickerSetMultiCovered">stickerSetMultiCovered</a> - Contains generic info about a stickerset and multiple preview stickers: use <a href="/method/messages.getStickerSet">messages.getStickerSet</a> to fetch all the stickers in the stickerset.</li>
|
||||
<li><a href="/constructor/stickerSetFullCovered">stickerSetFullCovered</a> - Contains generic info about a stickerset and all stickers in the set (not just a preview): currently only used for <a href="/api/custom-emoji">custom emoji stickersets</a>, to avoid a further call to <a href="/method/messages.getStickerSet">messages.getStickerSet</a>.</li>
|
||||
</ul>
|
||||
<p>Also, like all files, sticker <a href="/constructor/document">documents</a> have a set of previews that should be handled as described <a href="/api/files#image-thumbnail-types">here »</a>.</p>
|
||||
<p>Also, like all files, sticker <a href="/constructor/document">documents</a> have a set of previews that should be handled as described <a href="/api/files#image-thumbnail-types">here »</a>.</p>
|
||||
<h3><a class="anchor" href="#installing-stickersets" id="installing-stickersets" name="installing-stickersets"><i class="anchor-icon"></i></a>Installing stickersets</h3>
|
||||
<pre><code><a href='/constructor/inputStickerSetID'>inputStickerSetID</a>#9de7a269 id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputStickerSet'>InputStickerSet</a>;
|
||||
<a href='/constructor/inputStickerSetShortName'>inputStickerSetShortName</a>#861cc8a0 short_name:<a href='/type/string'>string</a> = <a href='/type/InputStickerSet'>InputStickerSet</a>;
|
||||
|
@ -275,7 +275,7 @@ Use <a href="/method/stickers.removeStickerFromSet">stickers.removeStickerFromSe
|
|||
<a href='/method/messages.searchStickerSets'>messages.searchStickerSets</a>#35705b8a flags:<a href='/type/%23'>#</a> exclude_featured:flags.0?<a href='/constructor/true'>true</a> q:<a href='/type/string'>string</a> hash:<a href='/type/long'>long</a> = <a href='/type/messages.FoundStickerSets'>messages.FoundStickerSets</a>;
|
||||
|
||||
<a href='/method/messages.searchEmojiStickerSets'>messages.searchEmojiStickerSets</a>#92b4494c flags:<a href='/type/%23'>#</a> exclude_featured:flags.0?<a href='/constructor/true'>true</a> q:<a href='/type/string'>string</a> hash:<a href='/type/long'>long</a> = <a href='/type/messages.FoundStickerSets'>messages.FoundStickerSets</a>;</code></pre>
|
||||
<p>You can use <a href="/method/messages.searchStickerSets">messages.searchStickerSets</a> and <a href="/method/messages.searchEmojiStickerSets">messages.searchEmojiStickerSets</a> to search globally available normal stickersets and <a href="/api/custom-emoji">custom emoji stickersets »</a> by name: note that this method returns a set of <a href="#stickerset-previews">stickerset previews »</a>.</p>
|
||||
<p>You can use <a href="/method/messages.searchStickerSets">messages.searchStickerSets</a> and <a href="/method/messages.searchEmojiStickerSets">messages.searchEmojiStickerSets</a> to search globally available normal stickersets and <a href="/api/custom-emoji">custom emoji stickersets »</a> by name: note that this method returns a set of <a href="#stickerset-previews">stickerset previews »</a>.</p>
|
||||
<h3><a class="anchor" href="#featured-stickersets" id="featured-stickersets" name="featured-stickersets"><i class="anchor-icon"></i></a>Featured stickersets</h3>
|
||||
<pre><code><a href='/constructor/messages.featuredStickersNotModified'>messages.featuredStickersNotModified</a>#c6dc0c66 count:<a href='/type/int'>int</a> = <a href='/type/messages.FeaturedStickers'>messages.FeaturedStickers</a>;
|
||||
<a href='/constructor/messages.featuredStickers'>messages.featuredStickers</a>#be382906 flags:<a href='/type/%23'>#</a> premium:flags.0?<a href='/constructor/true'>true</a> hash:<a href='/type/long'>long</a> count:<a href='/type/int'>int</a> sets:<a href='/type/Vector%20t'>Vector</a><<a href='/type/StickerSetCovered'>StickerSetCovered</a>> unread:<a href='/type/Vector%20t'>Vector</a><<a href='/type/long'>long</a>> = <a href='/type/messages.FeaturedStickers'>messages.FeaturedStickers</a>;
|
||||
|
@ -307,7 +307,7 @@ This method will also emit an <a href="/constructor/updateReadFeaturedStickers">
|
|||
<a href='/method/messages.faveSticker'>messages.faveSticker</a>#b9ffc55b id:<a href='/type/InputDocument'>InputDocument</a> unfave:<a href='/type/Bool'>Bool</a> = <a href='/type/Bool'>Bool</a>;
|
||||
<a href='/method/messages.getFavedStickers'>messages.getFavedStickers</a>#4f1aaa9 hash:<a href='/type/long'>long</a> = <a href='/type/messages.FavedStickers'>messages.FavedStickers</a>;</code></pre>
|
||||
<p>A stickerset can be faved or unfaved using <a href="/method/messages.faveSticker">messages.faveSticker</a>.</p>
|
||||
<p>Favorited stickers can be fetched using <a href="/method/messages.getFavedStickers">messages.getFavedStickers</a>: note that this method returns a set of <a href="#stickerset-previews">stickerset previews »</a>.</p>
|
||||
<p>Favorited stickers can be fetched using <a href="/method/messages.getFavedStickers">messages.getFavedStickers</a>: note that this method returns a set of <a href="#stickerset-previews">stickerset previews »</a>.</p>
|
||||
<p>Users can fave only a certain number of stickersets, as specified by the following <a href="/api/config#client-configuration">configuration</a> parameters:</p>
|
||||
<ul>
|
||||
<li>Premium users can fave a total of <a href="/api/config#stickers-faved-limit-premium"><code>stickers_faved_limit_premium</code> stickersets</a>. </li>
|
||||
|
@ -328,7 +328,7 @@ This update should trigger a call to <a href="/method/messages.getFavedStickers"
|
|||
<a href='/method/messages.getArchivedStickers'>messages.getArchivedStickers</a>#57f17692 flags:<a href='/type/%23'>#</a> masks:flags.0?<a href='/constructor/true'>true</a> emojis:flags.1?<a href='/constructor/true'>true</a> offset_id:<a href='/type/long'>long</a> limit:<a href='/type/int'>int</a> = <a href='/type/messages.ArchivedStickers'>messages.ArchivedStickers</a>;</code></pre>
|
||||
<p>One or more stickersets can be archived (or unarchived) using <a href="/method/messages.installStickerSet">messages.installStickerSet</a> with <code>archived=true|false</code>, or <a href="/method/messages.toggleStickerSets">messages.toggleStickerSets</a> with either the <code>archive</code> or <code>unarchive</code> flag. </p>
|
||||
<p>An unused stickerset may also be automatically archived when <a href="#installing-stickersets">installing new stickersets</a>.</p>
|
||||
<p>Archived stickers are not returned by <a href="/method/messages.getAllStickers">messages.getAllStickers</a> and can only be fetched using <a href="/method/messages.getArchivedStickers">messages.getArchivedStickers</a>: note that this method returns a set of <a href="#stickerset-previews">stickerset previews »</a>.</p>
|
||||
<p>Archived stickers are not returned by <a href="/method/messages.getAllStickers">messages.getAllStickers</a> and can only be fetched using <a href="/method/messages.getArchivedStickers">messages.getArchivedStickers</a>: note that this method returns a set of <a href="#stickerset-previews">stickerset previews »</a>.</p>
|
||||
<p>An <a href="/constructor/updateStickerSets">updateStickerSets</a> update will be emitted to the other logged-in sessions when archiving or unarchiving stickersets.<br>
|
||||
This update should trigger a call to <a href="/method/messages.getArchivedStickers">messages.getArchivedStickers</a>. </p>
|
||||
<h3><a class="anchor" href="#recent-stickers" id="recent-stickers" name="recent-stickers"><i class="anchor-icon"></i></a>Recent stickers</h3>
|
||||
|
@ -359,9 +359,9 @@ This update should trigger a call to <a href="/method/messages.getRecentStickers
|
|||
<p>The <code>update_stickersets_order</code> flag should be set when manually choosing and using stickers, <a href="#mask-stickers">masks</a> and <a href="/api/custom-emoji">custom emojis</a> from a specific stickerset in the stickerset selection bar (not through suggested or recent stickersets UI views).<br>
|
||||
Note that for <a href="/api/custom-emoji">custom emojis</a>, the flag should only be set when manually choosing custom emojis from a single custom emoji stickerset (not multiple custom emoji stickersets). </p>
|
||||
<p>Setting this flag will trigger an <a href="/constructor/updateMoveStickerSetToTop">updateMoveStickerSetToTop</a> update (instead of the usual <a href="/constructor/updateStickerSetsOrder">updateStickerSetsOrder</a>/<a href="/constructor/updateStickerSetsOrder">updateStickerSets</a> updates), indicating that the installed stickerset list was reordered and the specified stickerset was moved to the top.</p>
|
||||
<p>Note that the API also offers a separate list of recent <em>stickers</em> (not stickersets), see <a href="#recent-stickers">here »</a> for more info. </p>
|
||||
<p>Note that the API also offers a separate list of recent <em>stickers</em> (not stickersets), see <a href="#recent-stickers">here »</a> for more info. </p>
|
||||
<h3><a class="anchor" href="#emoji-categories" id="emoji-categories" name="emoji-categories"><i class="anchor-icon"></i></a>Emoji categories</h3>
|
||||
<p>The sticker selection UI should offer a list of categories to quickly filter results by a (list of) emojis, or by some other criteria, see <a href="/api/emoji-categories">here »</a> for more info. </p>
|
||||
<p>The sticker selection UI should offer a list of categories to quickly filter results by a (list of) emojis, or by some other criteria, see <a href="/api/emoji-categories">here »</a> for more info. </p>
|
||||
<h3><a class="anchor" href="#sticker-suggestions" id="sticker-suggestions" name="sticker-suggestions"><i class="anchor-icon"></i></a>Sticker suggestions</h3>
|
||||
<pre><code><a href='/constructor/messages.stickersNotModified'>messages.stickersNotModified</a>#f1749a22 = <a href='/type/messages.Stickers'>messages.Stickers</a>;
|
||||
<a href='/constructor/messages.stickers'>messages.stickers</a>#30a6ec7e hash:<a href='/type/long'>long</a> stickers:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Document'>Document</a>> = <a href='/type/messages.Stickers'>messages.Stickers</a>;
|
||||
|
@ -403,7 +403,7 @@ The <a href="/api/config#stickers-emoji-cache-time">stickers_emoji_cache_time ap
|
|||
<h4><a class="anchor" href="#greeting-stickers" id="greeting-stickers" name="greeting-stickers"><i class="anchor-icon"></i></a>Greeting stickers</h4>
|
||||
<p>When the user opens a private chat with a user they don't have a history with, the UI should display a randomly chosen greeting sticker+invitation to send a message. </p>
|
||||
<p>To fetch this special list of greeting stickers, invoke <a href="/method/messages.getStickers">messages.getStickers</a> with <code>emoticon=<img class="emoji" src="//telegram.org/img/emoji/40/F09F918B.png" width="20" height="20" alt="👋" /><img class="emoji" src="//telegram.org/img/emoji/40/E2AD90.png" width="20" height="20" alt="⭐️" /></code>. </p>
|
||||
<p>Note that if a custom <a href="/api/business#business-introduction">Telegram Business introduction »</a> is enabled, the message+sticker specified in <a href="/constructor/userFull">userFull</a>.<code>intro</code> must be used, instead. </p>
|
||||
<p>Note that if a custom <a href="/api/business#business-introduction">Telegram Business introduction »</a> is enabled, the message+sticker specified in <a href="/constructor/userFull">userFull</a>.<code>intro</code> must be used, instead. </p>
|
||||
<h3><a class="anchor" href="#attached-stickers" id="attached-stickers" name="attached-stickers"><i class="anchor-icon"></i></a>Attached stickers</h3>
|
||||
<pre><code><a href='/constructor/inputMediaUploadedPhoto'>inputMediaUploadedPhoto</a>#1e287d04 flags:<a href='/type/%23'>#</a> spoiler:flags.2?<a href='/constructor/true'>true</a> file:<a href='/type/InputFile'>InputFile</a> stickers:flags.0?<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputDocument'>InputDocument</a>> ttl_seconds:flags.1?<a href='/type/int'>int</a> = <a href='/type/InputMedia'>InputMedia</a>;
|
||||
|
||||
|
@ -432,9 +432,9 @@ First, overlay the sticker on top of the media file locally (properly handling e
|
|||
Then, when sending the media file using <a href="/method/messages.sendMedia">messages.sendMedia</a>, indicate the stickers that were overlaid in the <code>stickers</code> field of <a href="/constructor/inputMediaUploadedPhoto">inputMediaUploadedPhoto</a> or <a href="/constructor/inputMediaUploadedPhoto">inputMediaUploadedDocument</a>. </p>
|
||||
<p>Sent stickered <a href="/constructor/photo">photos</a> will have the <code>has_stickers</code> flag set.<br>
|
||||
Sent stickered <a href="/constructor/document">video documents</a> will have a <a href="/constructor/documentAttributeHasStickers">documentAttributeHasStickers</a> attribute. </p>
|
||||
<p>When receiving such a media file, clients should call <a href="/method/messages.getAttachedStickers">messages.getAttachedStickers</a>, passing the media: the method will return a set of <a href="#stickerset-previews">stickerset previews »</a>, with info about the stickersets (not stickers) used in the media.</p>
|
||||
<p>When receiving such a media file, clients should call <a href="/method/messages.getAttachedStickers">messages.getAttachedStickers</a>, passing the media: the method will return a set of <a href="#stickerset-previews">stickerset previews »</a>, with info about the stickersets (not stickers) used in the media.</p>
|
||||
<h4><a class="anchor" href="#mask-stickers" id="mask-stickers" name="mask-stickers"><i class="anchor-icon"></i></a>Mask stickers</h4>
|
||||
<p>Mask stickers are a special kind of <a href="#static-stickers">static</a> stickers that are meant to be overlaid on top of photos and attached to media, as specified <a href="#attached-stickers">here »</a>.</p>
|
||||
<p>Mask stickers are a special kind of <a href="#static-stickers">static</a> stickers that are meant to be overlaid on top of photos and attached to media, as specified <a href="#attached-stickers">here »</a>.</p>
|
||||
<pre><code><a href='/constructor/maskCoords'>maskCoords</a>#aed6dbb2 n:<a href='/type/int'>int</a> x:<a href='/type/double'>double</a> y:<a href='/type/double'>double</a> zoom:<a href='/type/double'>double</a> = <a href='/type/MaskCoords'>MaskCoords</a>;
|
||||
|
||||
<a href='/constructor/documentAttributeSticker'>documentAttributeSticker</a>#6319d612 flags:<a href='/type/%23'>#</a> mask:flags.1?<a href='/constructor/true'>true</a> alt:<a href='/type/string'>string</a> stickerset:<a href='/type/InputStickerSet'>InputStickerSet</a> mask_coords:flags.0?<a href='/type/MaskCoords'>MaskCoords</a> = <a href='/type/DocumentAttribute'>DocumentAttribute</a>;
|
||||
|
|
|
@ -64,13 +64,13 @@
|
|||
|
||||
<a href='/method/stories.getChatsToSend'>stories.getChatsToSend</a>#a56a8b60 = <a href='/type/messages.Chats'>messages.Chats</a>;</code></pre>
|
||||
<p>Before posting a story, clients should invoke <a href="/method/stories.canSendStory">stories.canSendStory</a>, to make sure they can send stories to the specified <code>peer</code> (which can be <a href="/constructor/inputPeerSelf">inputPeerSelf</a> to send the story as a normal user and <a href="/constructor/inputPeerChannel">inputPeerChannel</a> to send a story as a channel or supergroup). </p>
|
||||
<p>Use <a href="/method/stories.getChatsToSend">stories.getChatsToSend</a> to obtain a list of channels/supergroups where the user can post stories; <a href="/method/stories.canSendStory">stories.canSendStory</a> must still be used before uploading a story to make sure no other limit was reached, as described in the <a href="/api/stories#posting-stories">main documentation »</a>.
|
||||
Note that in order to obtain permission to post stories as a channel/supergroup, it must be boosted, first, see <a href="/api/boost">here »</a> for more info. </p>
|
||||
<p>Use <a href="/method/stories.getChatsToSend">stories.getChatsToSend</a> to obtain a list of channels/supergroups where the user can post stories; <a href="/method/stories.canSendStory">stories.canSendStory</a> must still be used before uploading a story to make sure no other limit was reached, as described in the <a href="/api/stories#posting-stories">main documentation »</a>.
|
||||
Note that in order to obtain permission to post stories as a channel/supergroup, it must be boosted, first, see <a href="/api/boost">here »</a> for more info. </p>
|
||||
<p><a href="/method/stories.canSendStory">stories.canSendStory</a> returns <a href="/constructor/boolTrue">boolTrue</a> only if:</p>
|
||||
<ul>
|
||||
<li>If we're trying to send a story as a channel/supergroup:<ul>
|
||||
<li>The current user is an administrator of the channel/supergroup and has <a href="/constructor/chatAdminRights"><code>post_stories</code> admin rights</a>; otherwise, a <code>CHAT_ADMIN_REQUIRED</code> error is returned.</li>
|
||||
<li>AND the channel/supergroup has <a href="/api/boost">received enough boosts to post the story »</a>; otherwise, a <code>BOOSTS_REQUIRED</code> error is returned.</li>
|
||||
<li>AND the channel/supergroup has <a href="/api/boost">received enough boosts to post the story »</a>; otherwise, a <code>BOOSTS_REQUIRED</code> error is returned.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>If we're trying to send a story as the current user:<ul>
|
||||
|
@ -83,15 +83,15 @@ Note that in order to obtain permission to post stories as a channel/supergroup,
|
|||
</ul>
|
||||
<p>After checking if a story can be posted, the client may invoke <a href="/method/stories.sendStory">stories.sendStory</a> to upload the story.<br>
|
||||
Note that if any of the conditions changes in the period between the call to <a href="/method/stories.canSendStory">stories.canSendStory</a> and <a href="/method/stories.sendStory">stories.sendStory</a> (for example, the user uploads a story from another client, reaching the weekly limit), the same errors listed above for <a href="/method/stories.canSendStory">stories.canSendStory</a> will be emitted by <a href="/method/stories.sendStory">stories.sendStory</a>. </p>
|
||||
<p>The parameters of <a href="/method/stories.sendStory">stories.sendStory</a> are fully described on the <a href="/method/stories.sendStory">method page »</a>, here are some of the most important ones:</p>
|
||||
<p>The parameters of <a href="/method/stories.sendStory">stories.sendStory</a> are fully described on the <a href="/method/stories.sendStory">method page »</a>, here are some of the most important ones:</p>
|
||||
<ul>
|
||||
<li><code>peer</code>: The peer to send the story as.</li>
|
||||
<li><code>media</code>: The story media (a vertical photo or a vertical video, max 30 MB).</li>
|
||||
<li><code>media_areas</code>: <a href="/api/stories#media-areas">Media areas</a> associated to the story, see <a href="/api/stories#media-areas">here »</a> for more info.</li>
|
||||
<li><code>privacy_rules</code>: A set of <a href="/api/privacy#privacy-rules">privacy rules »</a> for the story as an array of <a href="/type/InputPrivacyRule">InputPrivacyRule</a> constructors, indicating who can or can't view the story.</li>
|
||||
<li><code>media_areas</code>: <a href="/api/stories#media-areas">Media areas</a> associated to the story, see <a href="/api/stories#media-areas">here »</a> for more info.</li>
|
||||
<li><code>privacy_rules</code>: A set of <a href="/api/privacy#privacy-rules">privacy rules »</a> for the story as an array of <a href="/type/InputPrivacyRule">InputPrivacyRule</a> constructors, indicating who can or can't view the story.</li>
|
||||
<li><code>expire</code>: Period after which the story is moved to <a href="#pinned-or-archived-stories">archive</a> (and <a href="#pinned-or-archived-stories">to the profile</a> if <code>pinned</code> is set), in seconds; must be one of <code>6 * 3600</code>, <code>12 * 3600</code>, <code>86400</code>, or <code>2 * 86400</code> for Telegram Premium users, and <code>86400</code> otherwise.</li>
|
||||
<li><code>pinned</code>: Whether to also <a href="#pinned-or-archived-stories">add the story to the profile</a> automatically upon expiration. If not set, the story will only be added to the <a href="#pinned-or-archived-stories">archive</a>. </li>
|
||||
<li><code>caption</code> and <code>entities</code>: The story caption, and related <a href="/api/entities">styled text entities</a>; note that the story caption length is limited by the <a href="/api/config#story-caption-length-limit-default"><code>story_caption_length_limit_*</code> »</a> config keys, and story entities should only be sent and displayed according to the value of the <a href="/api/config#stories-entities">stories_entities »</a> config key.</li>
|
||||
<li><code>caption</code> and <code>entities</code>: The story caption, and related <a href="/api/entities">styled text entities</a>; note that the story caption length is limited by the <a href="/api/config#story-caption-length-limit-default"><code>story_caption_length_limit_*</code> »</a> config keys, and story entities should only be sent and displayed according to the value of the <a href="/api/config#stories-entities">stories_entities »</a> config key.</li>
|
||||
</ul>
|
||||
<p>Once a story is successfully uploaded, an <a href="/constructor/updateStoryID">updateStoryID</a> will be returned, indicating the story ID (<code>id</code>) that was attributed to the story (like for messages, <code>random_id</code> indicates the <code>random_id</code> that was passed to <a href="/method/stories.sendStory">stories.sendStory</a>: this way, you can tell which story was assigned a specific <code>id</code> by checking which <a href="/method/stories.sendStory">stories.sendStory</a> call has the returned <code>random_id</code>). </p>
|
||||
<p>Also, posting a story will emit an <a href="/constructor/updateStory">updateStory</a> both for us, and for our subscribers/contacts (even if they have <a href="#hiding-stories-of-other-users">hidden</a> our stories). </p>
|
||||
|
@ -136,7 +136,7 @@ Stories pinned to the top of the profile will be returned first when invoking <a
|
|||
<a href='/method/stories.deleteStories'>stories.deleteStories</a>#ae59db5f peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/Vector%20t'>Vector</a><<a href='/type/int'>int</a>> = <a href='/type/Vector%20t'>Vector</a><<a href='/type/int'>int</a>>;</code></pre>
|
||||
<p>Use the <a href="/method/stories.deleteStories">stories.deleteStories</a> method to delete one or more active, pinned or archived stories by their IDs, passed in <code>id</code>. </p>
|
||||
<h4><a class="anchor" href="#preventing-users-from-seeing-your-stories" id="preventing-users-from-seeing-your-stories" name="preventing-users-from-seeing-your-stories"><i class="anchor-icon"></i></a>Preventing users from seeing your stories</h4>
|
||||
<p>Users may be individually blocked from seeing all of your stories by adding them to the <a href="/api/block">story blocklist »</a>. </p>
|
||||
<p>Users may be individually blocked from seeing all of your stories by adding them to the <a href="/api/block">story blocklist »</a>. </p>
|
||||
<h3><a class="anchor" href="#watching-stories" id="watching-stories" name="watching-stories"><i class="anchor-icon"></i></a>Watching stories</h3>
|
||||
<pre><code><a href='/constructor/storyItem'>storyItem</a>#79b26a24 flags:<a href='/type/%23'>#</a> pinned:flags.5?<a href='/constructor/true'>true</a> public:flags.7?<a href='/constructor/true'>true</a> close_friends:flags.8?<a href='/constructor/true'>true</a> min:flags.9?<a href='/constructor/true'>true</a> noforwards:flags.10?<a href='/constructor/true'>true</a> edited:flags.11?<a href='/constructor/true'>true</a> contacts:flags.12?<a href='/constructor/true'>true</a> selected_contacts:flags.13?<a href='/constructor/true'>true</a> out:flags.16?<a href='/constructor/true'>true</a> id:<a href='/type/int'>int</a> date:<a href='/type/int'>int</a> from_id:flags.18?<a href='/type/Peer'>Peer</a> fwd_from:flags.17?<a href='/type/StoryFwdHeader'>StoryFwdHeader</a> expire_date:<a href='/type/int'>int</a> caption:flags.0?<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a><<a href='/type/MessageEntity'>MessageEntity</a>> media:<a href='/type/MessageMedia'>MessageMedia</a> media_areas:flags.14?<a href='/type/Vector%20t'>Vector</a><<a href='/type/MediaArea'>MediaArea</a>> privacy:flags.2?<a href='/type/Vector%20t'>Vector</a><<a href='/type/PrivacyRule'>PrivacyRule</a>> views:flags.3?<a href='/type/StoryViews'>StoryViews</a> sent_reaction:flags.15?<a href='/type/Reaction'>Reaction</a> = <a href='/type/StoryItem'>StoryItem</a>;
|
||||
<a href='/constructor/storyItemSkipped'>storyItemSkipped</a>#ffadc913 flags:<a href='/type/%23'>#</a> close_friends:flags.8?<a href='/constructor/true'>true</a> id:<a href='/type/int'>int</a> date:<a href='/type/int'>int</a> expire_date:<a href='/type/int'>int</a> = <a href='/type/StoryItem'>StoryItem</a>;
|
||||
|
@ -195,7 +195,7 @@ Use <a href="/method/stories.getAllReadPeerStories">stories.getAllReadPeerStorie
|
|||
<a href='/method/stories.toggleAllStoriesHidden'>stories.toggleAllStoriesHidden</a>#7c2557c4 hidden:<a href='/type/Bool'>Bool</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>Use <a href="/method/stories.toggleAllStoriesHidden">stories.togglePeerStoriesHidden</a> to hide the active stories of a specific peer, preventing them from being displayed on the action bar on the homescreen.<br>
|
||||
When the stories of a user are marked as hidden, the <code>stories_hidden</code> flag is set on the related <a href="/constructor/user">user</a> constructor, and they should only be visible on the action bar when opening the <a href="/api/folders#peer-folders">archive folder</a>, by setting the <code>hidden</code> flag when calling <a href="/method/stories.getAllStories">stories.getAllStories</a>, see <a href="#watching-stories">here</a> for more info. </p>
|
||||
<p>Note that the <a href="/api/folders#peer-folders">archive folder is the peer folder used for archived chats</a>: hidden stories are displayed there purely due to a UI implementation detail, not because they're actually added to the <a href="/api/folders#peer-folders">archive peer folder »</a> or the <a href="#pinned-or-archived-stories">story archive »</a>, which are different things. </p>
|
||||
<p>Note that the <a href="/api/folders#peer-folders">archive folder is the peer folder used for archived chats</a>: hidden stories are displayed there purely due to a UI implementation detail, not because they're actually added to the <a href="/api/folders#peer-folders">archive peer folder »</a> or the <a href="#pinned-or-archived-stories">story archive »</a>, which are different things. </p>
|
||||
<h3><a class="anchor" href="#sharing-stories" id="sharing-stories" name="sharing-stories"><i class="anchor-icon"></i></a>Sharing stories</h3>
|
||||
<pre><code><a href='/constructor/inputMediaStory'>inputMediaStory</a>#89fdd778 peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/int'>int</a> = <a href='/type/InputMedia'>InputMedia</a>;
|
||||
|
||||
|
@ -230,7 +230,7 @@ When the stories of a user are marked as hidden, the <code>stories_hidden</code>
|
|||
<a href='/method/stories.getStoryReactionsList'>stories.getStoryReactionsList</a>#b9b2881f flags:<a href='/type/%23'>#</a> forwards_first:flags.2?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/int'>int</a> reaction:flags.0?<a href='/type/Reaction'>Reaction</a> offset:flags.1?<a href='/type/string'>string</a> limit:<a href='/type/int'>int</a> = <a href='/type/stories.StoryReactionsList'>stories.StoryReactionsList</a>;
|
||||
|
||||
<a href='/method/stories.getStoriesViews'>stories.getStoriesViews</a>#28e16cc8 peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/Vector%20t'>Vector</a><<a href='/type/int'>int</a>> = <a href='/type/stories.StoryViews'>stories.StoryViews</a>;</code></pre>
|
||||
<p>Use <a href="/method/stories.getStoryViewsList">stories.getStoryViewsList</a> to obtain the full list of users that have interacted with a specific story we posted as a user, returned as a list of <a href="/type/StoryView">StoryView</a> constructors; pass the returned <code>next_offset</code> (if present) to <code>offset</code> to paginate through the results; the full list is available at all times only to <a href="/api/premium">Premium</a> users, and will be deleted on stories posted by non-<a href="/api/premium">Premium</a> users <a href="/api/config#story-viewers-expire-period">story_viewers_expire_period »</a> seconds after the story expires; if it's still viewable, the <code>has_viewers</code> flag will be set. </p>
|
||||
<p>Use <a href="/method/stories.getStoryViewsList">stories.getStoryViewsList</a> to obtain the full list of users that have interacted with a specific story we posted as a user, returned as a list of <a href="/type/StoryView">StoryView</a> constructors; pass the returned <code>next_offset</code> (if present) to <code>offset</code> to paginate through the results; the full list is available at all times only to <a href="/api/premium">Premium</a> users, and will be deleted on stories posted by non-<a href="/api/premium">Premium</a> users <a href="/api/config#story-viewers-expire-period">story_viewers_expire_period »</a> seconds after the story expires; if it's still viewable, the <code>has_viewers</code> flag will be set. </p>
|
||||
<p>The above method can only be used for stories posted by users, to fetch almost the exact same information for stories posted by channels/supergroups, use <a href="/method/stories.getStoryReactionsList">stories.getStoryReactionsList</a>: the data returned by both methods is actually almost exactly the same, the only difference is that:</p>
|
||||
<ul>
|
||||
<li><a href="/method/stories.getStoryViewsList">stories.getStoryViewsList</a> can only be used for stories posted by the current user and also contains view and <a href="/api/block">blocklist</a> information. </li>
|
||||
|
@ -297,8 +297,8 @@ Paginate the results by re-calling the method, passing to <code>offset</code> th
|
|||
|
||||
<a href='/method/stories.exportStoryLink'>stories.exportStoryLink</a>#7b8def20 peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/int'>int</a> = <a href='/type/ExportedStoryLink'>ExportedStoryLink</a>;</code></pre>
|
||||
<p>Use <a href="/method/stories.exportStoryLink">stories.exportStoryLink</a> to generate a <a href="/api/links#story-links">story deep link</a> for a specific story. </p>
|
||||
<p>Upon encountering a story deep link, clients should open the specified story as <a href="#watching-stories">specified here »</a>. </p>
|
||||
<p>See <a href="/api/links#story-links">here »</a> for more info on story deep links.</p>
|
||||
<p>Upon encountering a story deep link, clients should open the specified story as <a href="#watching-stories">specified here »</a>. </p>
|
||||
<p>See <a href="/api/links#story-links">here »</a> for more info on story deep links.</p>
|
||||
<h3><a class="anchor" href="#media-areas" id="media-areas" name="media-areas"><i class="anchor-icon"></i></a>Media areas</h3>
|
||||
<p>Schema:</p>
|
||||
<pre><code><a href='/constructor/mediaAreaCoordinates'>mediaAreaCoordinates</a>#cfc9e002 flags:<a href='/type/%23'>#</a> x:<a href='/type/double'>double</a> y:<a href='/type/double'>double</a> w:<a href='/type/double'>double</a> h:<a href='/type/double'>double</a> rotation:<a href='/type/double'>double</a> radius:flags.0?<a href='/type/double'>double</a> = <a href='/type/MediaAreaCoordinates'>MediaAreaCoordinates</a>;
|
||||
|
@ -310,7 +310,7 @@ Paginate the results by re-calling the method, passing to <code>offset</code> th
|
|||
<a href='/method/stories.sendStory'>stories.sendStory</a>#e4e6694b flags:<a href='/type/%23'>#</a> pinned:flags.2?<a href='/constructor/true'>true</a> noforwards:flags.4?<a href='/constructor/true'>true</a> fwd_modified:flags.7?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> media:<a href='/type/InputMedia'>InputMedia</a> media_areas:flags.5?<a href='/type/Vector%20t'>Vector</a><<a href='/type/MediaArea'>MediaArea</a>> caption:flags.0?<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a><<a href='/type/MessageEntity'>MessageEntity</a>> privacy_rules:<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputPrivacyRule'>InputPrivacyRule</a>> random_id:<a href='/type/long'>long</a> period:flags.3?<a href='/type/int'>int</a> fwd_from_id:flags.6?<a href='/type/InputPeer'>InputPeer</a> fwd_from_story:flags.6?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;
|
||||
<a href='/method/stories.editStory'>stories.editStory</a>#b583ba46 flags:<a href='/type/%23'>#</a> peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/int'>int</a> media:flags.0?<a href='/type/InputMedia'>InputMedia</a> media_areas:flags.3?<a href='/type/Vector%20t'>Vector</a><<a href='/type/MediaArea'>MediaArea</a>> caption:flags.1?<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a><<a href='/type/MessageEntity'>MessageEntity</a>> privacy_rules:flags.2?<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputPrivacyRule'>InputPrivacyRule</a>> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||
<p>Stories can have so-called "media areas": clickable rectangular areas with animated overlays on top of the story offering functionality like location tags or reactions. </p>
|
||||
<p>The coordinates and size of each media area is specified in a <a href="/constructor/mediaAreaCoordinates">mediaAreaCoordinates</a> constructor attached to each <a href="/type/MediaArea">MediaArea</a>, see <a href="/constructor/mediaAreaCoordinates">the constructor page »</a> for more info. </p>
|
||||
<p>The coordinates and size of each media area is specified in a <a href="/constructor/mediaAreaCoordinates">mediaAreaCoordinates</a> constructor attached to each <a href="/type/MediaArea">MediaArea</a>, see <a href="/constructor/mediaAreaCoordinates">the constructor page »</a> for more info. </p>
|
||||
<p>After construction, the vector of <a href="/type/MediaArea">MediaArea</a> constructors can be passed to <a href="/method/stories.sendStory">stories.sendStory</a> or <a href="/method/stories.editStory">stories.editStory</a>.</p>
|
||||
<h4><a class="anchor" href="#channel-posts" id="channel-posts" name="channel-posts"><i class="anchor-icon"></i></a>Channel posts</h4>
|
||||
<pre><code><a href='/constructor/inputMediaAreaChannelPost'>inputMediaAreaChannelPost</a>#2271f2bf coordinates:<a href='/type/MediaAreaCoordinates'>MediaAreaCoordinates</a> channel:<a href='/type/InputChannel'>InputChannel</a> msg_id:<a href='/type/int'>int</a> = <a href='/type/MediaArea'>MediaArea</a>;
|
||||
|
@ -334,7 +334,7 @@ Paginate the results by re-calling the method, passing to <code>offset</code> th
|
|||
<p>Currently, the only provider that needs to be supported is <code>foursquare</code>. </p>
|
||||
<p>To send a <a href="/constructor/mediaAreaVenue">mediaAreaVenue</a>, clients should use <a href="/constructor/inputMediaAreaVenue">inputMediaAreaVenue</a>, constructed as follows:</p>
|
||||
<ul>
|
||||
<li>If the user gives permission to share their location with the location provider, query the inline bot specified in the <a href="/api/config#stories-venue-search-username"><code>stories_venue_search_username</code> client configuration parameter »</a>, as described as the <a href="/api/bots/inline">inline queries documentation »</a>, populating the <code>geo_point</code>.<br>
|
||||
<li>If the user gives permission to share their location with the location provider, query the inline bot specified in the <a href="/api/config#stories-venue-search-username"><code>stories_venue_search_username</code> client configuration parameter »</a>, as described as the <a href="/api/bots/inline">inline queries documentation »</a>, populating the <code>geo_point</code>.<br>
|
||||
Note that this should be done transparently in a map UI, not in the usual inline query UI in the chat text bar. </li>
|
||||
<li>The results returned by the bot, containing a list of venues close to the specified <code>geo_point</code>, should be listed in the lower section of the map UI: upon selection, construct the <a href="/constructor/inputMediaAreaVenue">inputMediaAreaVenue</a> with:<ul>
|
||||
<li><code>query_id</code>: the <code>query_id</code> from <a href="/constructor/messages.botResults">messages.botResults</a>.</li>
|
||||
|
@ -343,7 +343,7 @@ Note that this should be done transparently in a map UI, not in the usual inline
|
|||
</li>
|
||||
</ul>
|
||||
<p>Clients may only re-use existing <a href="/constructor/mediaAreaVenue">mediaAreaVenue</a>s when repositioning a pre-existing location tag when editing a story; use <a href="/constructor/inputMediaAreaVenue">inputMediaAreaVenue</a> when posting a new story or adding a new location tag to an existing story.</p>
|
||||
<p><a href="#searching-stories">Global story search »</a> should be automatically triggered when clicking on a location, passing the <a href="/constructor/mediaAreaGeoPoint">mediaAreaGeoPoint</a>/<a href="/constructor/mediaAreaVenue">mediaAreaVenue</a> to <a href="/method/stories.searchPosts">stories.searchPosts</a>, with results displayed under the map. </p>
|
||||
<p><a href="#searching-stories">Global story search »</a> should be automatically triggered when clicking on a location, passing the <a href="/constructor/mediaAreaGeoPoint">mediaAreaGeoPoint</a>/<a href="/constructor/mediaAreaVenue">mediaAreaVenue</a> to <a href="/method/stories.searchPosts">stories.searchPosts</a>, with results displayed under the map. </p>
|
||||
<p>Note <a href="/constructor/mediaAreaGeoPoint">mediaAreaGeoPoint</a> areas may be searched only if they have an associated <code>address</code>. </p>
|
||||
<h4><a class="anchor" href="#reactions" id="reactions" name="reactions"><i class="anchor-icon"></i></a>Reactions</h4>
|
||||
<p>Schema:</p>
|
||||
|
@ -361,17 +361,17 @@ Note that this should be done transparently in a map UI, not in the usual inline
|
|||
<a href='/method/stories.sendReaction'>stories.sendReaction</a>#7fd736b2 flags:<a href='/type/%23'>#</a> add_to_recent:flags.0?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> story_id:<a href='/type/int'>int</a> reaction:<a href='/type/Reaction'>Reaction</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||
<p>Story <a href="/api/reactions">reactions</a> are implemented using a simple in-UI button that allows the user to send any reaction using <a href="/method/stories.sendReaction">stories.sendReaction</a>. </p>
|
||||
<p>Sending this method will return an <a href="/constructor/updateSentStoryReaction">updateSentStoryReaction</a> update to all logged-in sessions.<br>
|
||||
The story poster will also receive an <a href="/constructor/updateNewStoryReaction">updateNewStoryReaction</a> update when a user reacts to their story, if enabled as specified <a href="/api/reactions#notifications-about-reactions">here »</a>. </p>
|
||||
<p>However, the poster of a story may also use <a href="/constructor/mediaAreaSuggestedReaction">mediaAreaSuggestedReaction</a> <a href="#media-areas">media areas »</a> to suggest some specific reactions as simple clickable buttons: they're rendered as a round comic-style thought bubble with its "tail" on the right, white background and the <a href="/api/reactions">reaction »</a> from the <code>reaction</code> field located in its center.<br>
|
||||
The story poster will also receive an <a href="/constructor/updateNewStoryReaction">updateNewStoryReaction</a> update when a user reacts to their story, if enabled as specified <a href="/api/reactions#notifications-about-reactions">here »</a>. </p>
|
||||
<p>However, the poster of a story may also use <a href="/constructor/mediaAreaSuggestedReaction">mediaAreaSuggestedReaction</a> <a href="#media-areas">media areas »</a> to suggest some specific reactions as simple clickable buttons: they're rendered as a round comic-style thought bubble with its "tail" on the right, white background and the <a href="/api/reactions">reaction »</a> from the <code>reaction</code> field located in its center.<br>
|
||||
If the <code>dark</code> flag is set, the background should be black.<br>
|
||||
If the <code>flipped</code> flag is set, the "tail" should be located on the left.
|
||||
The maximum number of story reaction media areas that can be added to a story is specified by the <a href="/api/config#stories-suggested-reactions-limit-default"><code>stories_suggested_reactions_limit_*</code> »</a> config keys.<br>
|
||||
The maximum number of story reaction media areas that can be added to a story is specified by the <a href="/api/config#stories-suggested-reactions-limit-default"><code>stories_suggested_reactions_limit_*</code> »</a> config keys.<br>
|
||||
Clicking it should invoke <a href="/method/stories.sendReaction">stories.sendReaction</a> as usual.</p>
|
||||
<p>See <a href="#fetching-the-interaction-list">here »</a> to get more info on how to fetch the reaction list of a <a href="/api/stories">story</a>.</p>
|
||||
<p>See <a href="#fetching-the-interaction-list">here »</a> to get more info on how to fetch the reaction list of a <a href="/api/stories">story</a>.</p>
|
||||
<h4><a class="anchor" href="#urls" id="urls" name="urls"><i class="anchor-icon"></i></a>URLs</h4>
|
||||
<pre><code><a href='/constructor/mediaAreaUrl'>mediaAreaUrl</a>#37381085 coordinates:<a href='/type/MediaAreaCoordinates'>MediaAreaCoordinates</a> url:<a href='/type/string'>string</a> = <a href='/type/MediaArea'>MediaArea</a>;</code></pre>
|
||||
<p>URL media areas offer stickers that when clicked, should offer the user a prompt (implemented as a tooltip on the sticker) to open the specified <code>url</code>. </p>
|
||||
<p>The maximum number of URL media areas that can be added to a story is specified by the <a href="/api/config#stories-area-url-max"><code>stories_area_url_max</code> »</a> config key. </p>
|
||||
<p>The maximum number of URL media areas that can be added to a story is specified by the <a href="/api/config#stories-area-url-max"><code>stories_area_url_max</code> »</a> config key. </p>
|
||||
<h4><a class="anchor" href="#weather" id="weather" name="weather"><i class="anchor-icon"></i></a>Weather</h4>
|
||||
<pre><code><a href='/constructor/mediaAreaWeather'>mediaAreaWeather</a>#49a6549c coordinates:<a href='/type/MediaAreaCoordinates'>MediaAreaCoordinates</a> emoji:<a href='/type/string'>string</a> temperature_c:<a href='/type/double'>double</a> color:<a href='/type/int'>int</a> = <a href='/type/MediaArea'>MediaArea</a>;
|
||||
|
||||
|
@ -385,7 +385,7 @@ This query will return a single <a href="/constructor/botInlineResult">botInline
|
|||
<p>The inline query should be made internally by the client when the user creates a new weather media area, not by showing the usual inline query UI, but by treating the inline query as an API call to fetch the weather for the current user's location. </p>
|
||||
<p>If the <a href="/api/config#story-weather-preload">story_weather_preload</a> client configuration parameter is equal to true, clients should preload the weather using the flow specified above on startup (as opposed to only doing it when creating a weather media area). </p>
|
||||
<h3><a class="anchor" href="#stealth-mode" id="stealth-mode" name="stealth-mode"><i class="anchor-icon"></i></a>Stealth mode</h3>
|
||||
<p><a href="/api/premium">Premium users</a> may enable <a href="https://telegram.org/tour/stories#stealth-mode">stealth mode</a>, erasing their views from any stories they opened in the past <a href="/api/config#stories-stealth-past-period"><code>stories_stealth_past_period</code> seconds »</a>, and hiding their views on stories for the next <a href="/api/config#stories-stealth-future-period"><code>stories_stealth_future_period</code> seconds »</a>, as specified by the <a href="/api/config#client-configuration">client configuration »</a>.</p>
|
||||
<p><a href="/api/premium">Premium users</a> may enable <a href="https://telegram.org/tour/stories#stealth-mode">stealth mode</a>, erasing their views from any stories they opened in the past <a href="/api/config#stories-stealth-past-period"><code>stories_stealth_past_period</code> seconds »</a>, and hiding their views on stories for the next <a href="/api/config#stories-stealth-future-period"><code>stories_stealth_future_period</code> seconds »</a>, as specified by the <a href="/api/config#client-configuration">client configuration »</a>.</p>
|
||||
<p>Schema:</p>
|
||||
<pre><code><a href='/constructor/storiesStealthMode'>storiesStealthMode</a>#712e27fd flags:<a href='/type/%23'>#</a> active_until_date:flags.0?<a href='/type/int'>int</a> cooldown_until_date:flags.1?<a href='/type/int'>int</a> = <a href='/type/StoriesStealthMode'>StoriesStealthMode</a>;
|
||||
|
||||
|
@ -394,7 +394,7 @@ This query will return a single <a href="/constructor/botInlineResult">botInline
|
|||
---functions---
|
||||
|
||||
<a href='/method/stories.activateStealthMode'>stories.activateStealthMode</a>#57bbd166 flags:<a href='/type/%23'>#</a> past:flags.0?<a href='/constructor/true'>true</a> future:flags.1?<a href='/constructor/true'>true</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||||
<p>Invoke <a href="/method/stories.activateStealthMode">stories.activateStealthMode</a> to activate stealth mode, passing the <code>past</code> flag to erase views from any stories opened in the past <a href="/api/config#stories-stealth-past-period"><code>stories_stealth_past_period</code> seconds »</a> and/or the <code>future</code> flag to hide future story views for the next <a href="/api/config#stories-stealth-future-period"><code>stories_stealth_future_period</code> seconds »</a>. </p>
|
||||
<p>Invoke <a href="/method/stories.activateStealthMode">stories.activateStealthMode</a> to activate stealth mode, passing the <code>past</code> flag to erase views from any stories opened in the past <a href="/api/config#stories-stealth-past-period"><code>stories_stealth_past_period</code> seconds »</a> and/or the <code>future</code> flag to hide future story views for the next <a href="/api/config#stories-stealth-future-period"><code>stories_stealth_future_period</code> seconds »</a>. </p>
|
||||
<p>Clients can only invoke this method every <a href="/api/config#stories-stealth-cooldown-period"><code>stories_stealth_cooldown_period</code> seconds</a> as specified by the <a href="/api/config#client-configuration">client configuration</a>: invoking the method before the cooldown period has expired will trigger a <code>FLOOD_WAIT_X</code> error, with <code>X</code> being the number of seconds left before the cooldown period expires. </p>
|
||||
<p>An <a href="/constructor/updateStoriesStealthMode">updateStoriesStealthMode</a> constructor will be returned, containing the following fields:</p>
|
||||
<ul>
|
||||
|
@ -414,7 +414,7 @@ This query will return a single <a href="/constructor/botInlineResult">botInline
|
|||
<a href='/method/stats.getStoryStats'>stats.getStoryStats</a>#374fef40 flags:<a href='/type/%23'>#</a> dark:flags.0?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/int'>int</a> = <a href='/type/stats.StoryStats'>stats.StoryStats</a>;
|
||||
|
||||
<a href='/method/stats.getStoryPublicForwards'>stats.getStoryPublicForwards</a>#a6437ef6 peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/int'>int</a> offset:<a href='/type/string'>string</a> limit:<a href='/type/int'>int</a> = <a href='/type/stats.PublicForwards'>stats.PublicForwards</a>;</code></pre>
|
||||
<p>Use <a href="/method/stats.getStoryStats">stats.getStoryStats</a> to obtain statistics about a story; the returned <a href="/type/StatsGraph">StatsGraph</a> graphs can be rendered <a href="/api/stats#graph-visualization">as described here »</a>. </p>
|
||||
<p>Use <a href="/method/stats.getStoryStats">stats.getStoryStats</a> to obtain statistics about a story; the returned <a href="/type/StatsGraph">StatsGraph</a> graphs can be rendered <a href="/api/stats#graph-visualization">as described here »</a>. </p>
|
||||
<p>Use <a href="/method/stats.getStoryPublicForwards">stats.getStoryPublicForwards</a> to obtain forwards of a story as a message to public chats and reposts by public channels.</p></div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -121,7 +121,7 @@ If the user also chose to download only messages within a specific date interval
|
|||
<li>
|
||||
<p>If the user wants to export their contact list: </p>
|
||||
<ul>
|
||||
<li>See <a href="#contacts">here »</a></li>
|
||||
<li>See <a href="#contacts">here »</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -144,7 +144,7 @@ If the user also chose to download only messages within a specific date interval
|
|||
|
||||
<a href='/method/contacts.getSaved'>contacts.getSaved</a>#82f1e39f = <a href='/type/Vector%20t'>Vector</a><<a href='/type/SavedContact'>SavedContact</a>>;</code></pre>
|
||||
<p>This method does <strong>not</strong> require pagination using <a href="#split-ranges">message ranges</a>. </p>
|
||||
<p>Use <a href="/method/contacts.getSaved">contacts.getSaved</a> to export the full contact list, see <a href="/api/contacts#fetching-the-contact-list">here »</a> for another alternative method that may be used to fetch the full list of all contacts with a Telegram account, without using a takeout session.</p>
|
||||
<p>Use <a href="/method/contacts.getSaved">contacts.getSaved</a> to export the full contact list, see <a href="/api/contacts#fetching-the-contact-list">here »</a> for another alternative method that may be used to fetch the full list of all contacts with a Telegram account, without using a takeout session.</p>
|
||||
<h4><a class="anchor" href="#left-channels" id="left-channels" name="left-channels"><i class="anchor-icon"></i></a>Left channels</h4>
|
||||
<pre><code><a href='/constructor/messages.chats'>messages.chats</a>#64ff9fd5 chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> = <a href='/type/messages.Chats'>messages.Chats</a>;
|
||||
<a href='/constructor/messages.chatsSlice'>messages.chatsSlice</a>#9cd81144 count:<a href='/type/int'>int</a> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> = <a href='/type/messages.Chats'>messages.Chats</a>;
|
||||
|
|
|
@ -74,8 +74,8 @@ The resulting document should be used when <a href="#creating-themes">creating</
|
|||
---functions---
|
||||
|
||||
<a href='/method/account.createTheme'>account.createTheme</a>#652e4400 flags:<a href='/type/%23'>#</a> slug:<a href='/type/string'>string</a> title:<a href='/type/string'>string</a> document:flags.2?<a href='/type/InputDocument'>InputDocument</a> settings:flags.3?<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputThemeSettings'>InputThemeSettings</a>> = <a href='/type/Theme'>Theme</a>;</code></pre>
|
||||
<p>Use <a href="/method/account.createTheme">account.createTheme</a> to create a theme, see the <a href="/method/account.createTheme">method page for more info about the parameters »</a>.</p>
|
||||
<p>The resulting theme can be shared by generating a <a href="/api/links#theme-links">theme deep link »</a> using either a user-provided <code>slug</code>, or an autogenerated one by leaving the <code>slug</code> parameter empty and using the returned <code>slug</code>.</p>
|
||||
<p>Use <a href="/method/account.createTheme">account.createTheme</a> to create a theme, see the <a href="/method/account.createTheme">method page for more info about the parameters »</a>.</p>
|
||||
<p>The resulting theme can be shared by generating a <a href="/api/links#theme-links">theme deep link »</a> using either a user-provided <code>slug</code>, or an autogenerated one by leaving the <code>slug</code> parameter empty and using the returned <code>slug</code>.</p>
|
||||
<h3><a class="anchor" href="#updating-themes" id="updating-themes" name="updating-themes"><i class="anchor-icon"></i></a>Updating themes</h3>
|
||||
<pre><code><a href='/constructor/inputTheme'>inputTheme</a>#3c5693e9 id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputTheme'>InputTheme</a>;
|
||||
<a href='/constructor/inputThemeSlug'>inputThemeSlug</a>#f5890df1 slug:<a href='/type/string'>string</a> = <a href='/type/InputTheme'>InputTheme</a>;
|
||||
|
|
|
@ -62,7 +62,7 @@ Replies to messages in a thread are part of the same thread, and do not spawn ne
|
|||
<p>When receiving a <a href="/constructor/message">message</a> from a group that is also the top of a thread (the message with ID <code>420</code>), the <code>replies</code> optional field will contain a <a href="/constructor/messageReplies">messageReplies</a> constructor, containing the message ID and <a href="/api/updates">PTS</a> of the latest reply in the thread, and the message ID of the latest read thread reply, along with the total number of replies in the thread. </p>
|
||||
<p>Replies to a thread can also be manually fetched using <a href="/method/messages.search">messages.search</a>, providing to <code>top_msg_id</code> the thread ID. </p>
|
||||
<h3><a class="anchor" href="#channel-comments" id="channel-comments" name="channel-comments"><i class="anchor-icon"></i></a>Channel comments</h3>
|
||||
<p>The same <a href="/constructor/messageReplies">messageReplies</a> constructor seen above will also be contained in channel posts, this time containing information about the comment section of a specific channel post, see <a href="/api/discussion">here »</a> for more info.</p></div>
|
||||
<p>The same <a href="/constructor/messageReplies">messageReplies</a> constructor seen above will also be contained in channel posts, this time containing information about the comment section of a specific channel post, see <a href="/api/discussion">here »</a> for more info.</p></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ These updates will contain the updated <code>text</code> with the same <code>tra
|
|||
<p>A transcription can then be rated as good or bad using <a href="/method/messages.rateTranscribedAudio">messages.rateTranscribedAudio</a>. </p>
|
||||
<p>Users without a <a href="/api/premium">Telegram Premium</a> subscription can only transcribe <a href="/api/config#transcribe-audio-trial-weekly-number">transcribe_audio_trial_weekly_number</a> messages per week, each of maximum duration equal to <a href="/api/config#transcribe-audio-trial-duration-max">transcribe_audio_trial_duration_max</a> seconds.<br>
|
||||
For non-premium users, the <code>trial_remains_num</code> and <code>trial_remains_until_date</code> flags of <a href="/constructor/messages.transcribedAudio">messages.transcribedAudio</a> will also be set, indicating the remaining transcriptions, and the date when the <code>trial_remains_num</code> counter will be reset to the maximum value of <a href="/api/config#transcribe-audio-trial-weekly-number">transcribe_audio_trial_weekly_number</a>. </p>
|
||||
<p>Also, after a supergroup reaches at least the <a href="/api/boost">boost level</a> specified in the <a href="/api/config#group-transcribe-level-min"><code>group_transcribe_level_min</code> »</a> config parameter, non-<a href="/api/premium">Premium</a> users in the supergroup gain the ability to <a href="/api/transcribe">transcribe any voice message</a>, without using up their free transcription quota.</p></div>
|
||||
<p>Also, after a supergroup reaches at least the <a href="/api/boost">boost level</a> specified in the <a href="/api/config#group-transcribe-level-min"><code>group_transcribe_level_min</code> »</a> config parameter, non-<a href="/api/premium">Premium</a> users in the supergroup gain the ability to <a href="/api/transcribe">transcribe any voice message</a>, without using up their free transcription quota.</p></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<p>All events are received from the socket as a sequence of TL-serialized <a href="/type/Updates">Updates</a> objects, which might be optionally gzip-compressed in the same way as <a href="/api/invoking#decompressing-data">responses to queries</a>.</p>
|
||||
<p>Each <a href="/type/Updates">Updates</a> object may contain single or multiple <a href="/type/Update">Update</a> objects, representing different events happening.</p>
|
||||
<p>In order to apply all updates in precise order and to guarantee that no update is missed or applied twice there is <code>seq</code> attribute in <a href="/type/Updates">Updates</a> constructors, and <code>pts</code> (with <code>pts_count</code>) or <code>qts</code> attributes in <a href="/type/Update">Update</a> constructors. The client must use those attributes values in combination with locally stored state to correctly apply incoming updates.</p>
|
||||
<p>When a gap in updates sequence occurs, it must be filled via calling one of the API methods. <a href="#recovering-gaps">More below »</a></p>
|
||||
<p>When a gap in updates sequence occurs, it must be filled via calling one of the API methods. <a href="#recovering-gaps">More below »</a></p>
|
||||
<h3><a class="anchor" href="#updates-sequence" id="updates-sequence" name="updates-sequence"><i class="anchor-icon"></i></a><a href="/type/Updates">Updates</a> sequence</h3>
|
||||
<p>As said earlier, each payload with updates has a TL-type <a href="/type/Updates">Updates</a>. It can be seen from the schema below that this type has several constructors.</p>
|
||||
<pre><code><a href='/constructor/updatesTooLong'>updatesTooLong</a>#e317af7e = <a href='/type/Updates'>Updates</a>;
|
||||
|
@ -103,8 +103,8 @@ The common update state can also be fetched from <a href="/constructor/updates.d
|
|||
<p>The <em>Updates sequence state</em> is represented by the <code>date</code> and <code>seq</code> of the <em>Updates sequence</em>, it is contained in the <a href="/type/updates.State">updates.State</a> of the <em>common</em> update state.</p>
|
||||
<h3><a class="anchor" href="#update-handling" id="update-handling" name="update-handling"><i class="anchor-icon"></i></a>Update handling</h3>
|
||||
<p>Update handling in Telegram clients consists of receiving events, making sure there were no gaps and no events were missed based on the locally stored state of the correspondent event sequence, and then updating the locally stored state based on the parameters received.</p>
|
||||
<p>When the client receives payload with serialized updates, first of all, it needs to walk through all of the nested <a href="/type/Update">Update</a> objects and check if they belong to any of message box sequences (have <code>pts</code> or <code>qts</code> parameters). Those updates need to be handled separately according to corresponding local state and new <code>pts</code>/<code>qts</code> values. <a href="#pts-checking-and-applying">Details below »</a></p>
|
||||
<p>After message box updates are handled, if there are any other updates remaining the client needs to handle them with respect to <code>seq</code>. <a href="#seq-checking-and-applying">Details below »</a></p>
|
||||
<p>When the client receives payload with serialized updates, first of all, it needs to walk through all of the nested <a href="/type/Update">Update</a> objects and check if they belong to any of message box sequences (have <code>pts</code> or <code>qts</code> parameters). Those updates need to be handled separately according to corresponding local state and new <code>pts</code>/<code>qts</code> values. <a href="#pts-checking-and-applying">Details below »</a></p>
|
||||
<p>After message box updates are handled, if there are any other updates remaining the client needs to handle them with respect to <code>seq</code>. <a href="#seq-checking-and-applying">Details below »</a></p>
|
||||
<h4><a class="anchor" href="#pts-checking-and-applying" id="pts-checking-and-applying" name="pts-checking-and-applying"><i class="anchor-icon"></i></a><code>pts</code>: checking and applying</h4>
|
||||
<p>Here, <code>local_pts</code> will be the local state, <code>pts</code> will be the remote state, <code>pts_count</code> will be the number of events in the update.</p>
|
||||
<ul>
|
||||
|
@ -160,7 +160,7 @@ The intermediate status, represented by the <strong>pts</strong>, must be saved
|
|||
<p>For performance reasons and for better user experience, client can set maximum gap size to be filled: <code>pts_total_limit</code> parameter of <a href="/method/updates.getDifference">updates.getDifference</a> and <code>limit</code> parameter for <a href="/method/updates.getChannelDifference">updates.getChannelDifference</a> can be used.</p>
|
||||
<p>If the gap is too large and there are too many updates to fetch, a <code>*TooLong</code> constructor will be returned. In this case, the client must <a href="#fetching-state">re-fetch the state</a>, re-start fetching updates from that state and follow the instructions that can be found <a href="/constructor/updates.channelDifferenceTooLong">here</a>.</p>
|
||||
<p>It is recommended to use limit <code>10-100</code> for channels and <code>1000-10000</code> otherwise.</p>
|
||||
<p>Do not re-invoke <a href="/method/updates.getChannelDifference">updates.getChannelDifference</a> if the returned difference is <code>final</code>, unless <a href="#subscribing-to-updates-of-channels-supergroups">the user has opened the channel/supergroup »</a>. </p>
|
||||
<p>Do not re-invoke <a href="/method/updates.getChannelDifference">updates.getChannelDifference</a> if the returned difference is <code>final</code>, unless <a href="#subscribing-to-updates-of-channels-supergroups">the user has opened the channel/supergroup »</a>. </p>
|
||||
<h3><a class="anchor" href="#subscribing-to-updates-of-channels-supergroups" id="subscribing-to-updates-of-channels-supergroups" name="subscribing-to-updates-of-channels-supergroups"><i class="anchor-icon"></i></a>Subscribing to updates of channels/supergroups</h3>
|
||||
<p>The API will automatically send passive updates (i.e. as standalone <a href="/type/Updates">Updates</a> constructors in the socket) for channels/supergroups the user/bot is a member of. </p>
|
||||
<p>However, clients (user accounts only) should also additionally invoke <a href="/method/updates.getChannelDifference">updates.getChannelDifference</a> periodically for channels and supergroups the user is currently viewing (i.e. explicitly opened channels/supergroups in one or more tabs/windows). </p>
|
||||
|
@ -172,7 +172,7 @@ The intermediate status, represented by the <strong>pts</strong>, must be saved
|
|||
<h3><a class="anchor" href="#example-implementations" id="example-implementations" name="example-implementations"><i class="anchor-icon"></i></a>Example implementations</h3>
|
||||
<p>Implementations also have to take care to postpone updates received via the socket while filling gaps in the event and Update sequences, as well as avoid filling gaps in the same sequence.</p>
|
||||
<p>Example implementations: <a href="https://github.com/tdlib/td">tdlib</a>, <a href="https://github.com/danog/MadelineProto">MadelineProto</a>. </p>
|
||||
<p>An interesting and easy way this can be implemented, instead of using various locks, is by running background loops, like in <a href="https://docs.madelineproto.xyz/docs/UPDATES_INTERNAL.html">MadelineProto »</a>.</p>
|
||||
<p>An interesting and easy way this can be implemented, instead of using various locks, is by running background loops, like in <a href="https://docs.madelineproto.xyz/docs/UPDATES_INTERNAL.html">MadelineProto »</a>.</p>
|
||||
<h3><a class="anchor" href="#push-notifications-about-updates" id="push-notifications-about-updates" name="push-notifications-about-updates"><i class="anchor-icon"></i></a><a href="/api/push-updates">PUSH Notifications about Updates</a></h3>
|
||||
<p>If a client does not have an active connection at the time of an event, <a href="/api/push-updates">PUSH Notifications</a> will also be useful.</p></div>
|
||||
|
||||
|
|
|
@ -64,13 +64,13 @@ The same must be done if the user opens the link while refusing the authorizatio
|
|||
<h3><a class="anchor" href="#link-url-authorization" id="link-url-authorization" name="link-url-authorization"><i class="anchor-icon"></i></a>Link URL authorization</h3>
|
||||
<p>Telegram supports automatic authorization on certain websites upon opening an HTTP URL in-app, upon clicking a link in a message or clicking on a <a href="/constructor/keyboardButtonUrl">keyboardButtonUrl</a>.</p>
|
||||
<h4><a class="anchor" href="#automatic-authorization" id="automatic-authorization" name="automatic-authorization"><i class="anchor-icon"></i></a>Automatic authorization</h4>
|
||||
<p>Clients should automatically authenticate users when opening official Telegram websites, listed in the <a href="/api/config#autologin-domains"><code>autologin_domains</code> key</a> of the <a href="/api/config#client-configuration">client configuration object »</a>. </p>
|
||||
<p>Upon clicking a link, the URL must be modified by appending the <a href="/constructor/config"><code>autologin_token</code> »</a> from the <a href="/api/config#mtproto-configuration">MTProto configuration object »</a> to the <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4">query string</a>, like so: </p>
|
||||
<p>Clients should automatically authenticate users when opening official Telegram websites, listed in the <a href="/api/config#autologin-domains"><code>autologin_domains</code> key</a> of the <a href="/api/config#client-configuration">client configuration object »</a>. </p>
|
||||
<p>Upon clicking a link, the URL must be modified by appending the <a href="/constructor/config"><code>autologin_token</code> »</a> from the <a href="/api/config#mtproto-configuration">MTProto configuration object »</a> to the <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4">query string</a>, like so: </p>
|
||||
<p>Original URL: <code>https://somedomain.telegram.org/path?query=string#fragment=value</code><br>
|
||||
Modified URL: <code>https://somedomain.telegram.org/path?query=string&autologin_token=$autologin_token#fragment=value</code> </p>
|
||||
<p>Make sure that the used <code>autologin_token</code> is no more than <code>10000</code> seconds old, if it is older it must be refetched before use with <a href="/method/help.getConfig">help.getConfig</a>. </p>
|
||||
<h4><a class="anchor" href="#manual-authorization" id="manual-authorization" name="manual-authorization"><i class="anchor-icon"></i></a>Manual authorization</h4>
|
||||
<p>Clients should show a confirmation prompt similar to the one used <a href="#bot-url-authorization">for bots</a>, to authenticate users when opening certain Telegram websites, listed in the <code>url_auth_domains</code> key of the <a href="/api/config#url-auth-domains">client configuration object »</a>. </p>
|
||||
<p>Clients should show a confirmation prompt similar to the one used <a href="#bot-url-authorization">for bots</a>, to authenticate users when opening certain Telegram websites, listed in the <code>url_auth_domains</code> key of the <a href="/api/config#url-auth-domains">client configuration object »</a>. </p>
|
||||
<p><a href="/method/messages.requestUrlAuth">messages.requestUrlAuth</a> should be called, providing only the original <code>url</code>.
|
||||
The returned <a href="/constructor/urlAuthResultRequest">urlAuthResultRequest</a> object will contain more details about the authorization request:</p>
|
||||
<ul>
|
||||
|
|
|
@ -86,9 +86,9 @@ The <code>settings</code> field describes the transforms that should be applied
|
|||
<p>Fill wallpapers are simple wallpapers described by the <a href="/constructor/wallPaperNoFile">wallPaperNoFile</a> constructor, containing only the <a href="#fill-types">fill</a> specified by the <code>settings</code> field. </p>
|
||||
<h4><a class="anchor" href="#channel-and-supergroup-wallpapers" id="channel-and-supergroup-wallpapers" name="channel-and-supergroup-wallpapers"><i class="anchor-icon"></i></a>Channel and supergroup wallpapers</h4>
|
||||
<pre><code><a href='/constructor/wallPaperSettings'>wallPaperSettings</a>#372efcd0 flags:<a href='/type/%23'>#</a> blur:flags.1?<a href='/constructor/true'>true</a> motion:flags.2?<a href='/constructor/true'>true</a> background_color:flags.0?<a href='/type/int'>int</a> second_background_color:flags.4?<a href='/type/int'>int</a> third_background_color:flags.5?<a href='/type/int'>int</a> fourth_background_color:flags.6?<a href='/type/int'>int</a> intensity:flags.3?<a href='/type/int'>int</a> rotation:flags.4?<a href='/type/int'>int</a> emoticon:flags.7?<a href='/type/string'>string</a> = <a href='/type/WallPaperSettings'>WallPaperSettings</a>;</code></pre>
|
||||
<p><a href="#fill-wallpapers">Fill wallpapers</a> with an <code>emoticon</code> contained in the associated wallpaper <code>settings</code> indicate a channel/supergroup wallpaper, that can be <a href="#installing-wallpapers-in-a-specific-chat-or-channel">installed »</a> in channels and supergroups that have enough boosts, <a href="#installing-wallpapers-in-a-specific-chat-or-channel">see here »</a> for more info. </p>
|
||||
<p><a href="#fill-wallpapers">Fill wallpapers</a> with an <code>emoticon</code> contained in the associated wallpaper <code>settings</code> indicate a channel/supergroup wallpaper, that can be <a href="#installing-wallpapers-in-a-specific-chat-or-channel">installed »</a> in channels and supergroups that have enough boosts, <a href="#installing-wallpapers-in-a-specific-chat-or-channel">see here »</a> for more info. </p>
|
||||
<p>The full list of channel/supergroup wallpapers can be fetched using <a href="/method/account.getChatThemes">account.getChatThemes</a>. </p>
|
||||
<p>Channels/supergroups may also set any custom wallpaper (not just the ones returned by <a href="/method/account.getChatThemes">account.getChatThemes</a>) after reaching a higher boost level, <a href="#installing-wallpapers-in-a-specific-chat-or-channel">see here »</a> for more info. </p>
|
||||
<p>Channels/supergroups may also set any custom wallpaper (not just the ones returned by <a href="/method/account.getChatThemes">account.getChatThemes</a>) after reaching a higher boost level, <a href="#installing-wallpapers-in-a-specific-chat-or-channel">see here »</a> for more info. </p>
|
||||
<h3><a class="anchor" href="#fill-types" id="fill-types" name="fill-types"><i class="anchor-icon"></i></a>Fill types</h3>
|
||||
<p>Fill and pattern wallpapers are generated using one of three fill types: </p>
|
||||
<ul>
|
||||
|
@ -117,7 +117,7 @@ If set, <code>rotation</code> indicates clockwise rotation angle of the gradient
|
|||
<a href='/method/account.uploadWallPaper'>account.uploadWallPaper</a>#e39a8f03 flags:<a href='/type/%23'>#</a> for_chat:flags.0?<a href='/constructor/true'>true</a> file:<a href='/type/InputFile'>InputFile</a> mime_type:<a href='/type/string'>string</a> settings:<a href='/type/WallPaperSettings'>WallPaperSettings</a> = <a href='/type/WallPaper'>WallPaper</a>;</code></pre>
|
||||
<p><a href="/method/account.uploadWallPaper">account.uploadWallPaper</a> is used to upload <a href="#image-wallpapers">image</a> and <a href="#pattern-wallpapers">pattern</a> wallpapers. The <code>for_chat</code> flag must be set when uploading wallpapers to be used with <a href="/method/messages.setChatWallPaper">messages.setChatWallPaper</a>.<br>
|
||||
<a href="#fill-wallpapers">Fill wallpapers</a> don't require uploading since they have no associated file, and a <a href="/constructor/wallPaper">wallPaper</a> constructor can directly be generated client-side, specifying <code>id=0</code>. </p>
|
||||
<p>Wallpapers can then be shared using a <a href="/api/links#wallpaper-links">wallpaper deep link »</a>, and/or <a href="#installing-wallpapers">installed as specified here (image and pattern wallpapers only) »</a>. </p>
|
||||
<p>Wallpapers can then be shared using a <a href="/api/links#wallpaper-links">wallpaper deep link »</a>, and/or <a href="#installing-wallpapers">installed as specified here (image and pattern wallpapers only) »</a>. </p>
|
||||
<h4><a class="anchor" href="#installing-wallpapers" id="installing-wallpapers" name="installing-wallpapers"><i class="anchor-icon"></i></a>Installing wallpapers</h4>
|
||||
<pre><code><a href='/constructor/inputWallPaper'>inputWallPaper</a>#e630b979 id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputWallPaper'>InputWallPaper</a>;
|
||||
<a href='/constructor/inputWallPaperSlug'>inputWallPaperSlug</a>#72091c80 slug:<a href='/type/string'>string</a> = <a href='/type/InputWallPaper'>InputWallPaper</a>;
|
||||
|
@ -151,7 +151,7 @@ Note that calling this method will also automatically save the wallpaper, if it'
|
|||
<ul>
|
||||
<li><a href="/constructor/inputWallPaperSlug">inputWallPaperSlug</a> when working with <a href="/api/links#wallpaper-links">wallpaper deep links</a>.</li>
|
||||
<li><a href="/constructor/inputWallPaper">inputWallPaper</a> otherwise, using the ID and access hash fields of a full <a href="/constructor/wallPaper">wallPaper</a>.<br>
|
||||
As mentioned earlier, <a href="#fill-wallpapers">fill wallpapers</a> can't be saved to the server using <a href="/method/account.installWallPaper">account.installWallPaper</a> or <a href="/method/account.saveWallPaper">account.saveWallPaper</a>: an <a href="/constructor/inputWallPaperNoFile">inputWallPaperNoFile</a> is available for fill wallpapers but can <strong>only</strong> be used when working with <a href="/api/themes">themes »</a> or when using <a href="/method/messages.setChatWallPaper">messages.setChatWallPaper</a> as follows.</li>
|
||||
As mentioned earlier, <a href="#fill-wallpapers">fill wallpapers</a> can't be saved to the server using <a href="/method/account.installWallPaper">account.installWallPaper</a> or <a href="/method/account.saveWallPaper">account.saveWallPaper</a>: an <a href="/constructor/inputWallPaperNoFile">inputWallPaperNoFile</a> is available for fill wallpapers but can <strong>only</strong> be used when working with <a href="/api/themes">themes »</a> or when using <a href="/method/messages.setChatWallPaper">messages.setChatWallPaper</a> as follows.</li>
|
||||
</ul>
|
||||
<h4><a class="anchor" href="#installing-wallpapers-in-a-specific-chat-or-channel" id="installing-wallpapers-in-a-specific-chat-or-channel" name="installing-wallpapers-in-a-specific-chat-or-channel"><i class="anchor-icon"></i></a>Installing wallpapers in a specific chat or channel</h4>
|
||||
<pre><code><a href='/constructor/messageActionSetChatWallPaper'>messageActionSetChatWallPaper</a>#5060a3f4 flags:<a href='/type/%23'>#</a> same:flags.0?<a href='/constructor/true'>true</a> for_both:flags.1?<a href='/constructor/true'>true</a> wallpaper:<a href='/type/WallPaper'>WallPaper</a> = <a href='/type/MessageAction'>MessageAction</a>;
|
||||
|
|
|
@ -94,24 +94,24 @@ While handling is enabled, maximum 3 consecutive valid events of this type can b
|
|||
<p>Emitted by <a href="/api/bots/webapps">bot mini apps</a> to ask permission from the user to send them messages. </p>
|
||||
<p>Upon receiving this event, clients should first invoke <a href="/method/bots.canSendMessage">bots.canSendMessage</a>, to check whether they have already granted the bot permission to write them in some way. </p>
|
||||
<ul>
|
||||
<li>If the method returns <a href="/constructor/boolTrue">boolTrue</a>, a <a href="/api/bots/webapps#write-access-requested">write_access_requested event »</a> with <code>{"status": "allowed"}</code> should be sent to the Mini App.</li>
|
||||
<li>If the method returns <a href="/constructor/boolTrue">boolTrue</a>, a <a href="/api/bots/webapps#write-access-requested">write_access_requested event »</a> with <code>{"status": "allowed"}</code> should be sent to the Mini App.</li>
|
||||
<li>Otherwise, if the method returns <a href="/constructor/boolFalse">boolFalse</a>, a prompt should be shown to the user, indicating that the bot is asking permission to send messages to them.<br>
|
||||
If the user accepts, invoke <a href="/method/bots.allowSendMessage">bots.allowSendMessage</a>, and if the method call succeeds emit a <a href="/api/bots/webapps#write-access-requested">write_access_requested event »</a> with <code>{"status": "allowed"}</code>.<br>
|
||||
Otherwise, if the user refuses or the <a href="/method/bots.allowSendMessage">bots.allowSendMessage</a> call fails, emit a <a href="/api/bots/webapps#write-access-requested">write_access_requested event »</a> with <code>{"status": "cancelled"}</code>.</li>
|
||||
If the user accepts, invoke <a href="/method/bots.allowSendMessage">bots.allowSendMessage</a>, and if the method call succeeds emit a <a href="/api/bots/webapps#write-access-requested">write_access_requested event »</a> with <code>{"status": "allowed"}</code>.<br>
|
||||
Otherwise, if the user refuses or the <a href="/method/bots.allowSendMessage">bots.allowSendMessage</a> call fails, emit a <a href="/api/bots/webapps#write-access-requested">write_access_requested event »</a> with <code>{"status": "cancelled"}</code>.</li>
|
||||
</ul>
|
||||
<h4><a class="anchor" href="#web-app-request-phone" id="web-app-request-phone" name="web-app-request-phone"><i class="anchor-icon"></i></a><code>web_app_request_phone</code></h4>
|
||||
<p>Event data: <code>null</code></p>
|
||||
<p>Emitted by <a href="/api/bots/webapps">bot mini apps</a> to ask the user to share their phone number as a contact.</p>
|
||||
<p>Upon receiving this event, clients should show a prompt to the user, indicating that the bot is asking them to share their phone number (optionally also asking the user to unblock the bot, if it's currently blocked). </p>
|
||||
<p>If they accept, the user's phone number should be shared by sending a contact to the bot (unblocking it first, if it's currently blocked by the user); if all RPC queries (to unblock the bot, to send the message) succeed, a <a href="/api/bots/webapps#write-access-requested">phone_requested event »</a> should be sent with <code>{"status": "sent"}</code>. </p>
|
||||
<p>If the user refuses or any intermdiate method call fails, a <a href="/api/bots/webapps#write-access-requested">phone_requested event »</a> should be sent with <code>{"status": "cancelled"}</code>. </p>
|
||||
<p>If they accept, the user's phone number should be shared by sending a contact to the bot (unblocking it first, if it's currently blocked by the user); if all RPC queries (to unblock the bot, to send the message) succeed, a <a href="/api/bots/webapps#write-access-requested">phone_requested event »</a> should be sent with <code>{"status": "sent"}</code>. </p>
|
||||
<p>If the user refuses or any intermdiate method call fails, a <a href="/api/bots/webapps#write-access-requested">phone_requested event »</a> should be sent with <code>{"status": "cancelled"}</code>. </p>
|
||||
<h4><a class="anchor" href="#web-app-biometry-get-info" id="web-app-biometry-get-info" name="web-app-biometry-get-info"><i class="anchor-icon"></i></a><code>web_app_biometry_get_info</code></h4>
|
||||
<p>Event data: <code>null</code></p>
|
||||
<p>Emitted by <a href="/api/bots/webapps">bot mini apps</a> to ask the client to initialize the biometric authentication manager object for the current bot, emitting a <a href="/api/bots/webapps#biometry-info-received"><code>biometry_info_received</code> event »</a> on completion. </p>
|
||||
<p>Emitted by <a href="/api/bots/webapps">bot mini apps</a> to ask the client to initialize the biometric authentication manager object for the current bot, emitting a <a href="/api/bots/webapps#biometry-info-received"><code>biometry_info_received</code> event »</a> on completion. </p>
|
||||
<p>This request should just initialize the client-side state, i.e. by checking if biometric authentication is even available or not, it should not ask the user anything. </p>
|
||||
<h4><a class="anchor" href="#web-app-biometry-request-access" id="web-app-biometry-request-access" name="web-app-biometry-request-access"><i class="anchor-icon"></i></a><code>web_app_biometry_request_access</code></h4>
|
||||
<p>Event data: a JSON object, with an optional <code>reason</code> string field (1-128 chars, used in the prompt), containing the reason why the bot is asking to use biometric authentication. </p>
|
||||
<p>Emitted by <a href="/api/bots/webapps">bot mini apps</a> to ask the user permission to use biometric authentication, emitting a <a href="/api/bots/webapps#biometry-info-received"><code>biometry_info_received</code> event »</a> on completion. </p>
|
||||
<p>Emitted by <a href="/api/bots/webapps">bot mini apps</a> to ask the user permission to use biometric authentication, emitting a <a href="/api/bots/webapps#biometry-info-received"><code>biometry_info_received</code> event »</a> on completion. </p>
|
||||
<p>This request should not actually prompt biometric authentication, it should just ask the user permission to use it through a popup that should be shown only <strong>once</strong> (for this bot): no popup must be shown if the user has already previously allowed, denied or cancelled a biometry permission popup from this bot.</p>
|
||||
<h4><a class="anchor" href="#web-app-biometry-update-token" id="web-app-biometry-update-token" name="web-app-biometry-update-token"><i class="anchor-icon"></i></a><code>web_app_biometry_update_token</code></h4>
|
||||
<p>Event data: a JSON object with the following fields:</p>
|
||||
|
@ -119,15 +119,15 @@ Otherwise, if the user refuses or the <a href="/method/bots.allowSendMessage">bo
|
|||
<li><code>token</code> - The new token (string, 0-1024 chars), or an empty string to remove it. </li>
|
||||
<li><code>reason</code> - Optional string field, containing the reason why the bot is asking to authenticate using biometrics (1-128 chars, used in the prompt). </li>
|
||||
</ul>
|
||||
<p>Emitted by <a href="/api/bots/webapps">bot mini apps</a> to authenticate using biometrics and store the biometric token securely stored on-device, emitting a <a href="/api/bots/webapps#biometry-token-updated"><code>biometry_token_updated</code> event »</a> on completion. </p>
|
||||
<p>Emitted by <a href="/api/bots/webapps">bot mini apps</a> to authenticate using biometrics and store the biometric token securely stored on-device, emitting a <a href="/api/bots/webapps#biometry-token-updated"><code>biometry_token_updated</code> event »</a> on completion. </p>
|
||||
<p>This token (which may be for example the private key of a cryptocurrency wallet, or some other data the app must keep safe) must be safely stored by the Telegram client, associating it to the bot that owns the mini app. </p>
|
||||
<p>For example, the token may be directly stored in the on-device secure storage, accessible only after biometric authentication, or it may be stored to normal, non-secure storage, but <strong>in encrypted form</strong>, encrypted using the key returned from the device's secure storage after biometric authentication (for example on Android, using the CryptoObject returned by <a href="https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt.AuthenticationResult#getCryptoObject\(\)">the biometric prompt authentication result</a>). </p>
|
||||
<p>If the user has <a href="#web-app-biometry-request-access">previously disallowed</a> the bot from using biometric authentication, this request should immediately fail, emitting an appropriate <a href="/api/bots/webapps#biometry-token-updated"><code>biometry_token_updated</code> event »</a>. </p>
|
||||
<p>If the user has <a href="#web-app-biometry-request-access">previously disallowed</a> the bot from using biometric authentication, this request should immediately fail, emitting an appropriate <a href="/api/bots/webapps#biometry-token-updated"><code>biometry_token_updated</code> event »</a>. </p>
|
||||
<h4><a class="anchor" href="#web-app-biometry-request-auth" id="web-app-biometry-request-auth" name="web-app-biometry-request-auth"><i class="anchor-icon"></i></a><code>web_app_biometry_request_auth</code></h4>
|
||||
<p>Event data: a JSON object, with an optional <code>reason</code> string field, containing the reason why the bot is asking to authenticate using biometrics (1-128 chars, used in the prompt). </p>
|
||||
<p>Emitted by <a href="/api/bots/webapps">bot mini apps</a> to authenticate using biometrics and fetch the <a href="#web-app-biometry-update-token">previously stored secure token</a>, emitting a <a href="/api/bots/webapps#biometry-auth-requested"><code>biometry_auth_requested</code> event »</a> on completion, containing either an error, or the decrypted <a href="#web-app-biometry-update-token">biometric token »</a> (or an empty string if no token was configured yet). </p>
|
||||
<p>Should only be used if the <code>token_saved</code> field of the <a href="/api/bots/webapps#biometry-info-received">biometry_info_received object »</a> is equal to <code>true</code>, otherwise set a new token first using <a href="#web-app-biometry-update-token">web_app_biometry_update_token »</a>. </p>
|
||||
<p>If the user has <a href="#web-app-biometry-request-access">previously disallowed</a> the bot from using biometric authentication, this request should immediately fail, emitting an appropriate <a href="/api/bots/webapps#biometry-auth-requested"><code>biometry_auth_requested</code> event »</a>. </p>
|
||||
<p>Emitted by <a href="/api/bots/webapps">bot mini apps</a> to authenticate using biometrics and fetch the <a href="#web-app-biometry-update-token">previously stored secure token</a>, emitting a <a href="/api/bots/webapps#biometry-auth-requested"><code>biometry_auth_requested</code> event »</a> on completion, containing either an error, or the decrypted <a href="#web-app-biometry-update-token">biometric token »</a> (or an empty string if no token was configured yet). </p>
|
||||
<p>Should only be used if the <code>token_saved</code> field of the <a href="/api/bots/webapps#biometry-info-received">biometry_info_received object »</a> is equal to <code>true</code>, otherwise set a new token first using <a href="#web-app-biometry-update-token">web_app_biometry_update_token »</a>. </p>
|
||||
<p>If the user has <a href="#web-app-biometry-request-access">previously disallowed</a> the bot from using biometric authentication, this request should immediately fail, emitting an appropriate <a href="/api/bots/webapps#biometry-auth-requested"><code>biometry_auth_requested</code> event »</a>. </p>
|
||||
<h4><a class="anchor" href="#web-app-biometry-open-settings" id="web-app-biometry-open-settings" name="web-app-biometry-open-settings"><i class="anchor-icon"></i></a><code>web_app_biometry_open_settings</code></h4>
|
||||
<p>Event data: <code>null</code></p>
|
||||
<p>Emitted by <a href="/api/bots/webapps">bot mini apps</a> to open the biometric authentication settings page for bots, useful when the app needs to request permission to use biometrics from users who have previously denied it.</p>
|
||||
|
@ -141,7 +141,7 @@ Otherwise, if the user refuses or the <a href="/method/bots.allowSendMessage">bo
|
|||
</ul>
|
||||
<p>Emitted by <a href="/api/bots/webapps">bot mini apps</a> to make custom method calls to Telegram's servers on behalf of the user. </p>
|
||||
<p>This event should trigger a <a href="/method/bots.invokeWebViewCustomMethod">bots.invokeWebViewCustomMethod</a> request, passing the <code>method</code> to <code>custom_method</code>, and the <code>params</code> to <code>params</code>. </p>
|
||||
<p>Upon receiving a reply, a <a href="/api/bots/webapps#custom-method-invoked">custom_method_invoked event »</a> should be emitted, with the following fields:</p>
|
||||
<p>Upon receiving a reply, a <a href="/api/bots/webapps#custom-method-invoked">custom_method_invoked event »</a> should be emitted, with the following fields:</p>
|
||||
<ul>
|
||||
<li><code>req_id</code> - The <code>req_id</code> from the <code>web_app_invoke_custom_method</code> object</li>
|
||||
<li><code>result</code> - The JSON data contained in the response of the <a href="/method/bots.invokeWebViewCustomMethod">bots.invokeWebViewCustomMethod</a> method, if the method call succeeded</li>
|
||||
|
@ -153,26 +153,26 @@ Otherwise, if the user refuses or the <a href="/method/bots.allowSendMessage">bo
|
|||
<li><code>req_id</code> - A string with the ID of the current request</li>
|
||||
</ul>
|
||||
<p>Emitted by <a href="/api/bots/webapps">bot mini apps</a> to obtain the contents of the system clipboard. </p>
|
||||
<p>Only for Mini Apps owned by bots added to the <a href="/api/bots/attach">attachment menu</a>, regardles of how the Mini App itself was launched, this event should trigger a <a href="/api/bots/webapps#clipboard-text-received">clipboard_text_received event »</a> with the following payload: </p>
|
||||
<p>Only for Mini Apps owned by bots added to the <a href="/api/bots/attach">attachment menu</a>, regardles of how the Mini App itself was launched, this event should trigger a <a href="/api/bots/webapps#clipboard-text-received">clipboard_text_received event »</a> with the following payload: </p>
|
||||
<ul>
|
||||
<li><code>req_id</code> - The <code>req_id</code> from the <code>web_app_read_text_from_clipboard</code> request</li>
|
||||
<li><code>data</code> - A string with the clipboard contents</li>
|
||||
</ul>
|
||||
<p>Note that this method can be called only in response to a user interaction with the Mini App interface (e.g. a click inside the Mini App or on the main or settings button).<br>
|
||||
Note that user interactions must have a TTL of 10 seconds: events of this type must be ignored and a <a href="/api/bots/webapps#clipboard-text-received">clipboard_text_received event »</a> with the correct <code>req_id</code> and no <code>data</code> field must be sent if the last Mini App user interaction (as described above) happened more than 10 seconds ago. </p>
|
||||
<p>A <a href="/api/bots/webapps#clipboard-text-received">clipboard_text_received event »</a> with the correct <code>req_id</code> and no <code>data</code> field must also be sent if the bot is not installed in the <a href="/api/bots/attach">attachment menu</a>.</p>
|
||||
Note that user interactions must have a TTL of 10 seconds: events of this type must be ignored and a <a href="/api/bots/webapps#clipboard-text-received">clipboard_text_received event »</a> with the correct <code>req_id</code> and no <code>data</code> field must be sent if the last Mini App user interaction (as described above) happened more than 10 seconds ago. </p>
|
||||
<p>A <a href="/api/bots/webapps#clipboard-text-received">clipboard_text_received event »</a> with the correct <code>req_id</code> and no <code>data</code> field must also be sent if the bot is not installed in the <a href="/api/bots/attach">attachment menu</a>.</p>
|
||||
<h4><a class="anchor" href="#web-app-open-scan-qr-popup" id="web-app-open-scan-qr-popup" name="web-app-open-scan-qr-popup"><i class="anchor-icon"></i></a><code>web_app_open_scan_qr_popup</code></h4>
|
||||
<p>Event data: a JSON object with the following fields:</p>
|
||||
<ul>
|
||||
<li><code>text</code> - Optional string, containing the text to be displayed under the 'Scan QR' heading, 0-64 characters. </li>
|
||||
</ul>
|
||||
<p>Emitted by <a href="/api/bots/webapps">bot mini apps</a> to prompt the client to open the native QR code scanner and start continuously scanning for QR codes. </p>
|
||||
<p>A <a href="/api/bots/webapps#qr-text-received"><code>qr_text_received</code> event »</a> should be emitted every time a new QR code is scanned, until the user closes the popup via the UI or the Mini App closes the popup with a <a href="#web-app-close-scan-qr-popup">web_app_close_scan_qr_popup</a> event.</p>
|
||||
<p>Closing the popup should emit a <a href="/api/bots/webapps#scan-qr-popup-closed"><code>scan_qr_popup_closed</code> event »</a>; the same event should be emitted if the scan QR code popup cannot be opened due to permission issues. </p>
|
||||
<p>A <a href="/api/bots/webapps#qr-text-received"><code>qr_text_received</code> event »</a> should be emitted every time a new QR code is scanned, until the user closes the popup via the UI or the Mini App closes the popup with a <a href="#web-app-close-scan-qr-popup">web_app_close_scan_qr_popup</a> event.</p>
|
||||
<p>Closing the popup should emit a <a href="/api/bots/webapps#scan-qr-popup-closed"><code>scan_qr_popup_closed</code> event »</a>; the same event should be emitted if the scan QR code popup cannot be opened due to permission issues. </p>
|
||||
<h4><a class="anchor" href="#web-app-close-scan-qr-popup" id="web-app-close-scan-qr-popup" name="web-app-close-scan-qr-popup"><i class="anchor-icon"></i></a><code>web_app_close_scan_qr_popup</code></h4>
|
||||
<p>Event data: <code>null</code></p>
|
||||
<p>Emitted by <a href="/api/bots/webapps">bot mini apps</a> to prompt the client to close the native QR code scanner opened using <a href="#web-app-open-scan-qr-popup">web_app_open_scan_qr_popup</a>. </p>
|
||||
<p>The <a href="/api/bots/webapps#scan-qr-popup-closed"><code>scan_qr_popup_closed</code> event »</a> event should <em>not</em> be emitted if the QR code popup is closed using this event. </p>
|
||||
<p>The <a href="/api/bots/webapps#scan-qr-popup-closed"><code>scan_qr_popup_closed</code> event »</a> event should <em>not</em> be emitted if the QR code popup is closed using this event. </p>
|
||||
<h4><a class="anchor" href="#web-app-setup-closing-behavior" id="web-app-setup-closing-behavior" name="web-app-setup-closing-behavior"><i class="anchor-icon"></i></a><code>web_app_setup_closing_behavior</code></h4>
|
||||
<p>Event data: a JSON object with a boolean <code>need_confirmation</code>.</p>
|
||||
<p>If equal to <code>true</code>, the client should require user confirmation with a "Changes that you made may not be saved." popup with "Cancel"/"Close anyway" buttons before closing the webview, to avoid accidentally aborting a sensitive operation; otherwise no confirmation should be requested. </p>
|
||||
|
@ -193,7 +193,7 @@ Note that user interactions must have a TTL of 10 seconds: events of this type m
|
|||
<p>Used to set the mini app header and upper overscroll color. </p>
|
||||
<h4><a class="anchor" href="#web-app-data-send" id="web-app-data-send" name="web-app-data-send"><i class="anchor-icon"></i></a><code>web_app_data_send</code></h4>
|
||||
<p>Event data: a JSON object with a string <code>data</code> field. </p>
|
||||
<p>Used <strong>only</strong> by <a href="/api/bots/webapps#keyboard-button-mini-apps">keyboard button mini apps</a> to send back data to the bot as specified <a href="/api/bots/webapps#keyboard-button-mini-apps">here »</a>. The Mini App will be closed. </p>
|
||||
<p>Used <strong>only</strong> by <a href="/api/bots/webapps#keyboard-button-mini-apps">keyboard button mini apps</a> to send back data to the bot as specified <a href="/api/bots/webapps#keyboard-button-mini-apps">here »</a>. The Mini App will be closed. </p>
|
||||
<h4><a class="anchor" href="#web-app-switch-inline-query" id="web-app-switch-inline-query" name="web-app-switch-inline-query"><i class="anchor-icon"></i></a><code>web_app_switch_inline_query</code></h4>
|
||||
<p>Event data: a JSON object with the following keys:</p>
|
||||
<ul>
|
||||
|
@ -204,7 +204,7 @@ If non-empty, the client should prompt the user to choose a specific chat of the
|
|||
The array values specify which types of chats the user will be able to choose from.<br>
|
||||
If empty, the current chat is used. </li>
|
||||
</ul>
|
||||
<p>Used by <a href="/api/bots/webapps#inline-mode-mini-apps">inline mode mini apps</a> to send back data to the bot as specified <a href="/api/bots/webapps#inline-mode-mini-apps">here »</a>. The Mini App will be closed. </p>
|
||||
<p>Used by <a href="/api/bots/webapps#inline-mode-mini-apps">inline mode mini apps</a> to send back data to the bot as specified <a href="/api/bots/webapps#inline-mode-mini-apps">here »</a>. The Mini App will be closed. </p>
|
||||
<h4><a class="anchor" href="#web-app-trigger-haptic-feedback" id="web-app-trigger-haptic-feedback" name="web-app-trigger-haptic-feedback"><i class="anchor-icon"></i></a><code>web_app_trigger_haptic_feedback</code></h4>
|
||||
<p>Event data: a JSON object with the following fields:</p>
|
||||
<ul>
|
||||
|
@ -261,7 +261,7 @@ Note that user interactions must have a TTL of 1 second: events of this type mus
|
|||
<p>Used to open a <a href="/api/links">t.me deep link</a>. The Mini App must be closed.</p>
|
||||
<h4><a class="anchor" href="#web-app-open-invoice" id="web-app-open-invoice" name="web-app-open-invoice"><i class="anchor-icon"></i></a><code>web_app_open_invoice</code></h4>
|
||||
<p>Event data: a JSON object with a string <code>slug</code> field, containing an <a href="/api/links#invoice-links">invoice deep link</a>.</p>
|
||||
<p>Used to initiate <a href="/api/payments">payment of an invoice »</a>, by opening an invoice popup over the Mini App: the Mini App itself must not be closed. </p>
|
||||
<p>Used to initiate <a href="/api/payments">payment of an invoice »</a>, by opening an invoice popup over the Mini App: the Mini App itself must not be closed. </p>
|
||||
<p>The payment status must be reported back to the mini app using <a href="/api/bots/webapps#invoice-closed">invoice_closed</a>.</p>
|
||||
<h4><a class="anchor" href="#web-app-expand" id="web-app-expand" name="web-app-expand"><i class="anchor-icon"></i></a><code>web_app_expand</code></h4>
|
||||
<p>No event payload.</p>
|
||||
|
@ -306,7 +306,7 @@ Note that on supported platforms, the OS back button can be used instead of a cu
|
|||
<li><code>credentials</code> is a service-specific JSON object with information about the payment credentials provided by the user to the payment system. </li>
|
||||
</ul>
|
||||
<p><strong>Neither Telegram, nor bots will have access to your credit card information.</strong><br>
|
||||
Credit card details will be handled only by the payment system, see the <a href="/api/payments">payment documentation for more info »</a>. </p>
|
||||
Credit card details will be handled only by the payment system, see the <a href="/api/payments">payment documentation for more info »</a>. </p>
|
||||
<h4><a class="anchor" href="#share-score" id="share-score" name="share-score"><i class="anchor-icon"></i></a><code>share_score</code></h4>
|
||||
<p>No event payload.</p>
|
||||
<p>Will be called by games when the user explicitly clicks on the <strong>share score</strong> button to share the game, along with their score.<br>
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
<tr>
|
||||
<td>400</td>
|
||||
<td>AUTOARCHIVE_NOT_AVAILABLE</td>
|
||||
<td>The autoarchive setting is not available at this time: please check the value of the <a href="/api/config#client-configuration">autoarchive_setting_available field in client config »</a> before calling this method.</td>
|
||||
<td>The autoarchive setting is not available at this time: please check the value of the <a href="/api/config#client-configuration">autoarchive_setting_available field in client config »</a> before calling this method.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>403</td>
|
||||
|
|
|
@ -104,7 +104,7 @@ This info will be contained in <a href="/constructor/userFull">userFull</a>.<cod
|
|||
<tr>
|
||||
<td>400</td>
|
||||
<td>BUSINESS_WORK_HOURS_PERIOD_INVALID</td>
|
||||
<td>The specified work hours are invalid, see <a href="/api/business#opening-hours">here »</a> for the exact requirements.</td>
|
||||
<td>The specified work hours are invalid, see <a href="/api/business#opening-hours">here »</a> for the exact requirements.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
<tr>
|
||||
<td>400</td>
|
||||
<td>INVITES_TOO_MUCH</td>
|
||||
<td>The maximum number of per-folder invites specified by the <code>chatlist_invites_limit_default</code>/<code>chatlist_invites_limit_premium</code> <a href="/api/config#chatlist-invites-limit-default">client configuration parameters »</a> was reached.</td>
|
||||
<td>The maximum number of per-folder invites specified by the <code>chatlist_invites_limit_default</code>/<code>chatlist_invites_limit_premium</code> <a href="/api/config#chatlist-invites-limit-default">client configuration parameters »</a> was reached.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
|
|
@ -111,7 +111,7 @@
|
|||
<tr>
|
||||
<td>406</td>
|
||||
<td>BUSINESS_ADDRESS_ACTIVE</td>
|
||||
<td>The user is currently advertising a <a href="/api/business#location">Business Location</a>, the location may only be changed (or removed) using <a href="/method/account.updateBusinessLocation">account.updateBusinessLocation »</a>. .</td>
|
||||
<td>The user is currently advertising a <a href="/api/business#location">Business Location</a>, the location may only be changed (or removed) using <a href="/method/account.updateBusinessLocation">account.updateBusinessLocation »</a>. .</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
<tr>
|
||||
<td>400</td>
|
||||
<td>ENTITY_BOUNDS_INVALID</td>
|
||||
<td>A specified <a href="/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="/api/entities#entity-length">here »</a> for info on how to properly compute the entity offset/length.</td>
|
||||
<td>A specified <a href="/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="/api/entities#entity-length">here »</a> for info on how to properly compute the entity offset/length.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>403</td>
|
||||
|
|
|
@ -131,7 +131,7 @@
|
|||
<tr>
|
||||
<td>400</td>
|
||||
<td>ENTITY_BOUNDS_INVALID</td>
|
||||
<td>A specified <a href="/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="/api/entities#entity-length">here »</a> for info on how to properly compute the entity offset/length.</td>
|
||||
<td>A specified <a href="/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="/api/entities#entity-length">here »</a> for info on how to properly compute the entity offset/length.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
|
|
@ -191,7 +191,7 @@
|
|||
<tr>
|
||||
<td>403</td>
|
||||
<td>CHAT_GUEST_SEND_FORBIDDEN</td>
|
||||
<td>You join the discussion group before commenting, see <a href="/api/discussion#requiring-users-to-join-the-group">here »</a> for more info.</td>
|
||||
<td>You join the discussion group before commenting, see <a href="/api/discussion#requiring-users-to-join-the-group">here »</a> for more info.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
@ -296,7 +296,7 @@
|
|||
<tr>
|
||||
<td>406</td>
|
||||
<td>PAYMENT_UNSUPPORTED</td>
|
||||
<td>A detailed description of the error will be received separately as described <a href="/api/errors#406-not-acceptable">here »</a>.</td>
|
||||
<td>A detailed description of the error will be received separately as described <a href="/api/errors#406-not-acceptable">here »</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
<tr>
|
||||
<td>400</td>
|
||||
<td>CHAT_TOO_BIG</td>
|
||||
<td>This method is not available for groups with more than <code>chat_read_mark_size_threshold</code> members, <a href="/api/config#client-configuration">see client configuration »</a>.</td>
|
||||
<td>This method is not available for groups with more than <code>chat_read_mark_size_threshold</code> members, <a href="/api/config#client-configuration">see client configuration »</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
<tr>
|
||||
<td>400</td>
|
||||
<td>ENTITY_BOUNDS_INVALID</td>
|
||||
<td>A specified <a href="/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="/api/entities#entity-length">here »</a> for info on how to properly compute the entity offset/length.</td>
|
||||
<td>A specified <a href="/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="/api/entities#entity-length">here »</a> for info on how to properly compute the entity offset/length.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
|
|
@ -131,7 +131,7 @@
|
|||
<tr>
|
||||
<td>400</td>
|
||||
<td>ENTITY_BOUNDS_INVALID</td>
|
||||
<td>A specified <a href="/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="/api/entities#entity-length">here »</a> for info on how to properly compute the entity offset/length.</td>
|
||||
<td>A specified <a href="/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="/api/entities#entity-length">here »</a> for info on how to properly compute the entity offset/length.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
|
|
@ -171,7 +171,7 @@
|
|||
<tr>
|
||||
<td>403</td>
|
||||
<td>CHAT_GUEST_SEND_FORBIDDEN</td>
|
||||
<td>You join the discussion group before commenting, see <a href="/api/discussion#requiring-users-to-join-the-group">here »</a> for more info.</td>
|
||||
<td>You join the discussion group before commenting, see <a href="/api/discussion#requiring-users-to-join-the-group">here »</a> for more info.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
@ -231,7 +231,7 @@
|
|||
<tr>
|
||||
<td>400</td>
|
||||
<td>ENTITY_BOUNDS_INVALID</td>
|
||||
<td>A specified <a href="/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="/api/entities#entity-length">here »</a> for info on how to properly compute the entity offset/length.</td>
|
||||
<td>A specified <a href="/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="/api/entities#entity-length">here »</a> for info on how to properly compute the entity offset/length.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
|
|
@ -236,7 +236,7 @@
|
|||
<tr>
|
||||
<td>403</td>
|
||||
<td>CHAT_GUEST_SEND_FORBIDDEN</td>
|
||||
<td>You join the discussion group before commenting, see <a href="/api/discussion#requiring-users-to-join-the-group">here »</a> for more info.</td>
|
||||
<td>You join the discussion group before commenting, see <a href="/api/discussion#requiring-users-to-join-the-group">here »</a> for more info.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
@ -321,7 +321,7 @@
|
|||
<tr>
|
||||
<td>400</td>
|
||||
<td>ENTITY_BOUNDS_INVALID</td>
|
||||
<td>A specified <a href="/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="/api/entities#entity-length">here »</a> for info on how to properly compute the entity offset/length.</td>
|
||||
<td>A specified <a href="/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="/api/entities#entity-length">here »</a> for info on how to properly compute the entity offset/length.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
|
|
@ -241,7 +241,7 @@
|
|||
<tr>
|
||||
<td>403</td>
|
||||
<td>CHAT_GUEST_SEND_FORBIDDEN</td>
|
||||
<td>You join the discussion group before commenting, see <a href="/api/discussion#requiring-users-to-join-the-group">here »</a> for more info.</td>
|
||||
<td>You join the discussion group before commenting, see <a href="/api/discussion#requiring-users-to-join-the-group">here »</a> for more info.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
@ -281,7 +281,7 @@
|
|||
<tr>
|
||||
<td>400</td>
|
||||
<td>ENTITY_BOUNDS_INVALID</td>
|
||||
<td>A specified <a href="/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="/api/entities#entity-length">here »</a> for info on how to properly compute the entity offset/length.</td>
|
||||
<td>A specified <a href="/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="/api/entities#entity-length">here »</a> for info on how to properly compute the entity offset/length.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
@ -321,7 +321,7 @@
|
|||
<tr>
|
||||
<td>406</td>
|
||||
<td>PAYMENT_UNSUPPORTED</td>
|
||||
<td>A detailed description of the error will be received separately as described <a href="/api/errors#406-not-acceptable">here »</a>.</td>
|
||||
<td>A detailed description of the error will be received separately as described <a href="/api/errors#406-not-acceptable">here »</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
|
|
@ -201,7 +201,7 @@
|
|||
<tr>
|
||||
<td>400</td>
|
||||
<td>ENTITY_BOUNDS_INVALID</td>
|
||||
<td>A specified <a href="/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="/api/entities#entity-length">here »</a> for info on how to properly compute the entity offset/length.</td>
|
||||
<td>A specified <a href="/api/entities#entity-length">entity offset or length</a> is invalid, see <a href="/api/entities#entity-length">here »</a> for info on how to properly compute the entity offset/length.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
|
|
@ -177,7 +177,7 @@
|
|||
<tr>
|
||||
<td>400</td>
|
||||
<td>REACTIONS_TOO_MANY</td>
|
||||
<td>The message already has exactly <code>reactions_uniq_max</code> reaction emojis, you can't react with a new emoji, see <a href="/api/config#client-configuration">the docs for more info »</a>.</td>
|
||||
<td>The message already has exactly <code>reactions_uniq_max</code> reaction emojis, you can't react with a new emoji, see <a href="/api/config#client-configuration">the docs for more info »</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
|
|
|
@ -490,7 +490,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-gifs-" id="working-with-gifs-" name="working-with-gifs-"><i class="anchor-icon"></i></a>Working with <a href="/api/gifs">GIFs »</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-gifs-" id="working-with-gifs-" name="working-with-gifs-"><i class="anchor-icon"></i></a>Working with <a href="/api/gifs">GIFs »</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -509,7 +509,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-main-mini-bot-apps--and-the-mini-app-store" id="working-with-main-mini-bot-apps--and-the-mini-app-store" name="working-with-main-mini-bot-apps--and-the-mini-app-store"><i class="anchor-icon"></i></a>Working with <a href="/api/bots/webapps#main-mini-apps">Main Mini Bot Apps »</a> and the <a href="/api/search#apps-tab">Mini App Store</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-main-mini-bot-apps--and-the-mini-app-store" id="working-with-main-mini-bot-apps--and-the-mini-app-store" name="working-with-main-mini-bot-apps--and-the-mini-app-store"><i class="anchor-icon"></i></a>Working with <a href="/api/bots/webapps#main-mini-apps">Main Mini Bot Apps »</a> and the <a href="/api/search#apps-tab">Mini App Store</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -552,7 +552,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-mini-bot-apps-" id="working-with-mini-bot-apps-" name="working-with-mini-bot-apps-"><i class="anchor-icon"></i></a>Working with <a href="/api/bots/webapps">Mini Bot Apps »</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-mini-bot-apps-" id="working-with-mini-bot-apps-" name="working-with-mini-bot-apps-"><i class="anchor-icon"></i></a>Working with <a href="/api/bots/webapps">Mini Bot Apps »</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -665,7 +665,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-telegram-business-connected-bots-" id="working-with-telegram-business-connected-bots-" name="working-with-telegram-business-connected-bots-"><i class="anchor-icon"></i></a>Working with <a href="/api/business#connected-bots">Telegram Business connected bots »</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-telegram-business-connected-bots-" id="working-with-telegram-business-connected-bots-" name="working-with-telegram-business-connected-bots-"><i class="anchor-icon"></i></a>Working with <a href="/api/business#connected-bots">Telegram Business connected bots »</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -719,7 +719,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-telegram-business-opening-hours-" id="working-with-telegram-business-opening-hours-" name="working-with-telegram-business-opening-hours-"><i class="anchor-icon"></i></a>Working with <a href="/api/business#opening-hours">Telegram Business opening hours »</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-telegram-business-opening-hours-" id="working-with-telegram-business-opening-hours-" name="working-with-telegram-business-opening-hours-"><i class="anchor-icon"></i></a>Working with <a href="/api/business#opening-hours">Telegram Business opening hours »</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -734,7 +734,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-telegram-business-quick-reply-shortcuts-" id="working-with-telegram-business-quick-reply-shortcuts-" name="working-with-telegram-business-quick-reply-shortcuts-"><i class="anchor-icon"></i></a>Working with <a href="/api/business#quick-reply-shortcuts">Telegram Business quick reply shortcuts »</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-telegram-business-quick-reply-shortcuts-" id="working-with-telegram-business-quick-reply-shortcuts-" name="working-with-telegram-business-quick-reply-shortcuts-"><i class="anchor-icon"></i></a>Working with <a href="/api/business#quick-reply-shortcuts">Telegram Business quick reply shortcuts »</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -883,7 +883,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-accent-colors-" id="working-with-accent-colors-" name="working-with-accent-colors-"><i class="anchor-icon"></i></a>Working with <a href="/api/colors">accent colors »</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-accent-colors-" id="working-with-accent-colors-" name="working-with-accent-colors-"><i class="anchor-icon"></i></a>Working with <a href="/api/colors">accent colors »</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -914,7 +914,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-boosts-" id="working-with-boosts-" name="working-with-boosts-"><i class="anchor-icon"></i></a>Working with <a href="/api/boost">boosts »</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-boosts-" id="working-with-boosts-" name="working-with-boosts-"><i class="anchor-icon"></i></a>Working with <a href="/api/boost">boosts »</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -949,7 +949,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-channel-recommendations-" id="working-with-channel-recommendations-" name="working-with-channel-recommendations-"><i class="anchor-icon"></i></a>Working with <a href="/api/recommend">channel recommendations »</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-channel-recommendations-" id="working-with-channel-recommendations-" name="working-with-channel-recommendations-"><i class="anchor-icon"></i></a>Working with <a href="/api/recommend">channel recommendations »</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -1920,7 +1920,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-reaction-notification-settings-" id="working-with-reaction-notification-settings-" name="working-with-reaction-notification-settings-"><i class="anchor-icon"></i></a>Working with <a href="/api/reactions#notifications-about-reactions">reaction notification settings »</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-reaction-notification-settings-" id="working-with-reaction-notification-settings-" name="working-with-reaction-notification-settings-"><i class="anchor-icon"></i></a>Working with <a href="/api/reactions#notifications-about-reactions">reaction notification settings »</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -1939,7 +1939,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-saved-message-dialogs-" id="working-with-saved-message-dialogs-" name="working-with-saved-message-dialogs-"><i class="anchor-icon"></i></a>Working with <a href="/api/saved-messages">saved message dialogs »</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-saved-message-dialogs-" id="working-with-saved-message-dialogs-" name="working-with-saved-message-dialogs-"><i class="anchor-icon"></i></a>Working with <a href="/api/saved-messages">saved message dialogs »</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -1974,7 +1974,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-saved-message-tags-" id="working-with-saved-message-tags-" name="working-with-saved-message-tags-"><i class="anchor-icon"></i></a>Working with <a href="/api/saved-messages#tags">saved message tags »</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-saved-message-tags-" id="working-with-saved-message-tags-" name="working-with-saved-message-tags-"><i class="anchor-icon"></i></a>Working with <a href="/api/saved-messages#tags">saved message tags »</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -2087,7 +2087,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-stickers-" id="working-with-stickers-" name="working-with-stickers-"><i class="anchor-icon"></i></a>Working with <a href="/api/stickers">stickers »</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-stickers-" id="working-with-stickers-" name="working-with-stickers-"><i class="anchor-icon"></i></a>Working with <a href="/api/stickers">stickers »</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -2457,7 +2457,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-wallpapers-" id="working-with-wallpapers-" name="working-with-wallpapers-"><i class="anchor-icon"></i></a>Working with <a href="/api/wallpapers">wallpapers »</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-wallpapers-" id="working-with-wallpapers-" name="working-with-wallpapers-"><i class="anchor-icon"></i></a>Working with <a href="/api/wallpapers">wallpapers »</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -3375,7 +3375,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-the-telegram-business-intro-" id="working-with-the-telegram-business-intro-" name="working-with-the-telegram-business-intro-"><i class="anchor-icon"></i></a>Working with the <a href="/api/business#business-introduction">Telegram Business intro »</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-the-telegram-business-intro-" id="working-with-the-telegram-business-intro-" name="working-with-the-telegram-business-intro-"><i class="anchor-icon"></i></a>Working with the <a href="/api/business#business-introduction">Telegram Business intro »</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -3405,7 +3405,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-the-attachment-menu--of-mini-bot-apps-" id="working-with-the-attachment-menu--of-mini-bot-apps-" name="working-with-the-attachment-menu--of-mini-bot-apps-"><i class="anchor-icon"></i></a>Working with the <a href="/bots/webapps#launching-mini-apps-from-the-attachment-menu">attachment menu »</a> of <a href="/bots/webapps">mini bot apps »</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-the-attachment-menu--of-mini-bot-apps-" id="working-with-the-attachment-menu--of-mini-bot-apps-" name="working-with-the-attachment-menu--of-mini-bot-apps-"><i class="anchor-icon"></i></a>Working with the <a href="/bots/webapps#launching-mini-apps-from-the-attachment-menu">attachment menu »</a> of <a href="/bots/webapps">mini bot apps »</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -3595,7 +3595,7 @@ Look for updates of telegram's terms of service…">
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#working-with-the-bot-menu-button-" id="working-with-the-bot-menu-button-" name="working-with-the-bot-menu-button-"><i class="anchor-icon"></i></a>Working with the bot <a href="/bots/webapps#launching-mini-apps-from-the-menu-button">menu button »</a></h3>
|
||||
<h3><a class="anchor" href="#working-with-the-bot-menu-button-" id="working-with-the-bot-menu-button-" name="working-with-the-bot-menu-button-"><i class="anchor-icon"></i></a>Working with the bot <a href="/bots/webapps#launching-mini-apps-from-the-menu-button">menu button »</a></h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
|
@ -246,7 +246,7 @@ If bit 3 of the <code>flags</code> parameter is set, this indicates that the spe
|
|||
<li>The type<code>Unit</code> with a single null constructor <code>Unit</code> is similar to the previous type.</li>
|
||||
</ul>
|
||||
<h4><a class="anchor" href="#antlr-definition" id="antlr-definition" name="antlr-definition"><i class="anchor-icon"></i></a>ANTLR definition</h4>
|
||||
<p>An <a href="https://www.antlr.org">ANLTR</a> definition of TL grammar can be found <a href="https://gitlab.com/telekram/telekram/-/blob/master/generator/src/commonMain/antlr/TL.g4">here »</a>. </p></div>
|
||||
<p>An <a href="https://www.antlr.org">ANLTR</a> definition of TL grammar can be found <a href="https://gitlab.com/telekram/telekram/-/blob/master/generator/src/commonMain/antlr/TL.g4">here »</a>.</p></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ MTProto v.1.0 is deprecated and is currently being phased out.</p>
|
|||
<p>A (time-dependent) 64-bit number used uniquely to identify a message within a session. Client message identifiers are divisible by 4, server message identifiers modulo 4 yield 1 if the message is a response to a client message, and 3 otherwise. Client message identifiers must increase monotonically (within a single session), the same as server message identifiers, and must approximately equal unixtime*2^32. This way, a message identifier points to the approximate moment in time the message was created. A message is rejected over 300 seconds after it is created or 30 seconds before it is created (this is needed to protect from replay attacks). In this situation, it must be re-sent with a different identifier (or placed in a container with a higher identifier). The identifier of a message container must be strictly greater than those of its nested messages.</p>
|
||||
<p><strong>Important</strong>: to counter replay-attacks the lower 32 bits of <strong>msg_id</strong> passed by the client must not be empty and must present a fractional part of the time point when the message was created.</p>
|
||||
<h4><a class="anchor" href="#message-sequence-number-msg-seqno" id="message-sequence-number-msg-seqno" name="message-sequence-number-msg-seqno"><i class="anchor-icon"></i></a>Message Sequence Number (msg_seqno)</h4>
|
||||
<p>A 32-bit number equal to twice the number of <a href="#content-related-message">content-related »</a> messages created by the sender prior to this message and subsequently incremented by one if the current message is a content-related message. </p>
|
||||
<p>A 32-bit number equal to twice the number of <a href="#content-related-message">content-related »</a> messages created by the sender prior to this message and subsequently incremented by one if the current message is a content-related message. </p>
|
||||
<p>The seqno of a content-related message is thus <code>msg.seqNo = (current_seqno*2)+1</code> (and after generating it, the local <code>current_seqno</code> counter must be incremented by 1), the seqno of a non-content related message is <code>msg.seqNo = (current_seqno*2)</code> (<code>current_seqno</code> must <strong>not</strong> be incremented by 1 after generation). </p>
|
||||
<p>Thus, the content-relatedness of an incoming MTProto message can simply be determined by checking the value of the least-significant bit of the seqno of the message (<code>message.isContentRelated = (message.seqNo & 1) == 1</code>). </p>
|
||||
<p>A container is always generated after its entire contents; therefore, its sequence number is greater than or equal to the sequence numbers of the messages contained in it. </p>
|
||||
|
|
|
@ -53,9 +53,9 @@
|
|||
<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 7C 04 0E 00 3C 0A C3 66
|
||||
0010 | 14 00 00 00 F1 8E 7E BE E7 19 9F 71 52 F4 17 B2
|
||||
0020 | 07 80 D8 E1 D7 BC 17 04</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 2C A3 0D 00 0D 0D C3 66
|
||||
0010 | 14 00 00 00 F1 8E 7E BE AC 7E C6 49 66 2E CF 3C
|
||||
0020 | F3 BA 99 1B 9D 8D AB D5</code></pre>
|
||||
<p>Payload (de)serialization:</p>
|
||||
<pre><code>req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;</code></pre>
|
||||
<table class="table">
|
||||
|
@ -77,7 +77,7 @@
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>7C040E003C0AC366</code></td>
|
||||
<td><code>2CA30D000D0DC366</code></td>
|
||||
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -95,7 +95,7 @@
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>E7199F7152F417B20780D8E1D7BC1704</code></td>
|
||||
<td><code>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td>Random number</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -104,11 +104,11 @@
|
|||
<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 10 4E CB 3C 0A C3 66
|
||||
0010 | 80 00 00 00 63 24 16 05 E7 19 9F 71 52 F4 17 B2
|
||||
0020 | 07 80 D8 E1 D7 BC 17 04 D7 6E 2C 5F D5 BB C2 60
|
||||
0030 | 92 E5 5C F8 19 1A 23 1B 08 10 85 82 42 09 13 AC
|
||||
0040 | B1 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 74 FF E0 0D 0D C3 66
|
||||
0010 | 90 00 00 00 63 24 16 05 AC 7E C6 49 66 2E CF 3C
|
||||
0020 | F3 BA 99 1B 9D 8D AB D5 6C 8D 9C F5 77 54 AE 5A
|
||||
0030 | 5C B3 05 75 9A 60 50 D0 08 1B E3 63 A4 6F 8E DF
|
||||
0040 | C1 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>
|
||||
|
@ -132,13 +132,13 @@
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>01104ECB3C0AC366</code></td>
|
||||
<td><code>0174FFE00D0DC366</code></td>
|
||||
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>message_length</td>
|
||||
<td>16, 4</td>
|
||||
<td><code>80000000</code> (128 in decimal)</td>
|
||||
<td><code>90000000</code> (144 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -150,19 +150,19 @@
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>E7199F7152F417B20780D8E1D7BC1704</code></td>
|
||||
<td><code>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>D76E2C5FD5BBC26092E55CF8191A231B</code></td>
|
||||
<td><code>6C8D9CF57754AE5A5CB305759A6050D0</code></td>
|
||||
<td>Server-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pq</td>
|
||||
<td>56, 12</td>
|
||||
<td><code>08108582420913ACB1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1190500896641100977</td>
|
||||
<td><code>081BE363A46F8EDFC1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2009559416634793921</td>
|
||||
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -208,22 +208,22 @@
|
|||
<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-lt-q" id="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" name="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p < q.</h5>
|
||||
<!-- start pq -->
|
||||
<pre><code>pq = 1190500896641100977</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1190500896641100977 = 1068782431 * 1113885167</code></p>
|
||||
<pre><code>p = 1068782431
|
||||
q = 1113885167</code></pre>
|
||||
<pre><code>pq = 2009559416634793921</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2009559416634793921 = 1090123583 * 1843423487</code></p>
|
||||
<pre><code>p = 1090123583
|
||||
q = 1843423487</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 10 85 82 42 09 13 AC B1 00 00 00
|
||||
0010 | 04 3F B4 53 5F 00 00 00 04 42 64 89 EF 00 00 00
|
||||
0020 | E7 19 9F 71 52 F4 17 B2 07 80 D8 E1 D7 BC 17 04
|
||||
0030 | D7 6E 2C 5F D5 BB C2 60 92 E5 5C F8 19 1A 23 1B
|
||||
0040 | DC A0 FC 59 7E 07 F3 08 F8 BA F3 C7 EC A9 67 DF
|
||||
0050 | B0 48 D2 97 15 BA B9 E7 85 4B 99 B5 B9 B8 B0 6F
|
||||
<pre><code>0000 | 95 5F F5 A9 08 1B E3 63 A4 6F 8E DF C1 00 00 00
|
||||
0010 | 04 40 F9 F7 3F 00 00 00 04 6D E0 68 FF 00 00 00
|
||||
0020 | AC 7E C6 49 66 2E CF 3C F3 BA 99 1B 9D 8D AB D5
|
||||
0030 | 6C 8D 9C F5 77 54 AE 5A 5C B3 05 75 9A 60 50 D0
|
||||
0040 | DB 3F 7E 5E 2E E1 CF 4C 86 05 74 57 84 5C 5C 5B
|
||||
0050 | 4F 2A 99 51 F0 38 E4 31 B2 94 33 4E 12 C6 C4 19
|
||||
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>
|
||||
|
@ -246,37 +246,37 @@ q = 1113885167</code></pre>
|
|||
<tr>
|
||||
<td>pq</td>
|
||||
<td>4, 12</td>
|
||||
<td><code>08108582420913ACB1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1190500896641100977</td>
|
||||
<td><code>081BE363A46F8EDFC1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2009559416634793921</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>043FB4535F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1068782431</td>
|
||||
<td><code>0440F9F73F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1090123583</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>04426489EF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1113885167</td>
|
||||
<td><code>046DE068FF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1843423487</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>E7199F7152F417B20780D8E1D7BC1704</code></td>
|
||||
<td><code>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>48, 16</td>
|
||||
<td><code>D76E2C5FD5BBC26092E55CF8191A231B</code></td>
|
||||
<td><code>6C8D9CF57754AE5A5CB305759A6050D0</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce</td>
|
||||
<td>64, 32</td>
|
||||
<td><code>DCA0FC597E07F308F8BAF3C7ECA967DF</code> <code>B048D29715BAB9E7854B99B5B9B8B06F</code></td>
|
||||
<td><code>DB3F7E5E2EE1CF4C86057457845C5C5B</code> <code>4F2A9951F038E431B294334E12C6C419</code></td>
|
||||
<td>Client-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -291,39 +291,39 @@ q = 1113885167</code></pre>
|
|||
<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 = 955FF5A908108582420913ACB1000000043FB4535F00000004426489EF000000E7199F7152F417B20780D8E1D7BC1704D76E2C5FD5BBC26092E55CF8191A231BDCA0FC597E07F308F8BAF3C7ECA967DFB048D29715BAB9E7854B99B5B9B8B06F02000000
|
||||
random_padding_bytes = CD393FCFEB081990DA2835A72E28946F14963306102127968BB2B6A789B316253C22F20E4644BA4C6D46D23270644CBE6E7FAC4B6EE847C315221DA0DA04B76ED8C7602AFA1D3135FBE421B73E582E2A2E320ABD76E5BAA964CCA583</code></pre>
|
||||
<pre><code>data = 955FF5A9081BE363A46F8EDFC10000000440F9F73F000000046DE068FF000000AC7EC649662ECF3CF3BA991B9D8DABD56C8D9CF57754AE5A5CB305759A6050D0DB3F7E5E2EE1CF4C86057457845C5C5B4F2A9951F038E431B294334E12C6C41902000000
|
||||
random_padding_bytes = 82EF77A67CA950176B3C8A6AED8C49B22B5B8338E93D9A8077219C1F643736C7ADE8802882B4E6667914AA15469B2AAC5111CA5F9D52D0C5949AAB0B8F9D894DCDA3ECD755440EBBC1A5FD15EB5486870DA7BA006C53D35B1C76B0B4</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 = 6F4886E82022FCAC422856BF30AF8E859D309D8740D801CA8DCF42919353C656F61E608F19F19F59034ED4B587152A17760245ED706DAD32D8F782F9B2763512F1C7AA8979E6F691D9013A1CEC861673C0532BE494F18CB59016800ED3126CB2C7BBEE311002D621B741D94061155F38F7514E86F7525BAEF6164D022B85B02E8433F6B050458CF598A7B3961EAC5DD03F083C347FD95679C53122D2EF1C69FEC77441B7DA71367C6F08DC3711FA8CE801B1F7EB2BC46FA254AFC0FABD0C93843572A54072E336D889607D70BAF097EAEF5BEC69667A731C08AEE033C6F55C4C8065F54FD64C3A0A4C9FBFEFE4FEB0805AEAE6E3CAD853A2E5C9E1D0DB146E48</code></pre>
|
||||
<pre><code>encrypted_data = C71092A1879498AD33CCAF6BF2F48145F0F624E20B99A8439CFC4D59974ED6299399FE92C80D06DF951CDA757AAB3014EC0B33B7D9B1F9AB6BFF3CFB7284552A27BBC42FBCE1D5D22BB05E9D90F04691F50C990BF4F315D204F1208FCC938C59F04B7F8E612DAA6F65BD768A085D4263F024496447833F731DB4C9960BE5263F98F448C32F8943258C687DC7CD6C3581FD371B2114654F3A5CD92BC032E8C6B644D859D5615712BA528CF8EC73E1B0887E204CA81847304A2FB3C4AAAA8A45C364D6CC6FE070913B7B19C2045BE3426D2CFEC5533A0CA28D5B47D69752D68F740CB1BC9C23CD1559C2054BAF7EB8622C39348A2B95A7D79FD4F8A3901B1501C5</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 80 04 0E 00 3C 0A C3 66
|
||||
0010 | 40 01 00 00 BE E4 12 D7 E7 19 9F 71 52 F4 17 B2
|
||||
0020 | 07 80 D8 E1 D7 BC 17 04 D7 6E 2C 5F D5 BB C2 60
|
||||
0030 | 92 E5 5C F8 19 1A 23 1B 04 3F B4 53 5F 00 00 00
|
||||
0040 | 04 42 64 89 EF 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 6F 48 86 E8 20 22 FC AC 42 28 56 BF
|
||||
0060 | 30 AF 8E 85 9D 30 9D 87 40 D8 01 CA 8D CF 42 91
|
||||
0070 | 93 53 C6 56 F6 1E 60 8F 19 F1 9F 59 03 4E D4 B5
|
||||
0080 | 87 15 2A 17 76 02 45 ED 70 6D AD 32 D8 F7 82 F9
|
||||
0090 | B2 76 35 12 F1 C7 AA 89 79 E6 F6 91 D9 01 3A 1C
|
||||
00A0 | EC 86 16 73 C0 53 2B E4 94 F1 8C B5 90 16 80 0E
|
||||
00B0 | D3 12 6C B2 C7 BB EE 31 10 02 D6 21 B7 41 D9 40
|
||||
00C0 | 61 15 5F 38 F7 51 4E 86 F7 52 5B AE F6 16 4D 02
|
||||
00D0 | 2B 85 B0 2E 84 33 F6 B0 50 45 8C F5 98 A7 B3 96
|
||||
00E0 | 1E AC 5D D0 3F 08 3C 34 7F D9 56 79 C5 31 22 D2
|
||||
00F0 | EF 1C 69 FE C7 74 41 B7 DA 71 36 7C 6F 08 DC 37
|
||||
0100 | 11 FA 8C E8 01 B1 F7 EB 2B C4 6F A2 54 AF C0 FA
|
||||
0110 | BD 0C 93 84 35 72 A5 40 72 E3 36 D8 89 60 7D 70
|
||||
0120 | BA F0 97 EA EF 5B EC 69 66 7A 73 1C 08 AE E0 33
|
||||
0130 | C6 F5 5C 4C 80 65 F5 4F D6 4C 3A 0A 4C 9F BF EF
|
||||
0140 | E4 FE B0 80 5A EA E6 E3 CA D8 53 A2 E5 C9 E1 D0
|
||||
0150 | DB 14 6E 48</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 94 C9 0E 00 0E 0D C3 66
|
||||
0010 | 40 01 00 00 BE E4 12 D7 AC 7E C6 49 66 2E CF 3C
|
||||
0020 | F3 BA 99 1B 9D 8D AB D5 6C 8D 9C F5 77 54 AE 5A
|
||||
0030 | 5C B3 05 75 9A 60 50 D0 04 40 F9 F7 3F 00 00 00
|
||||
0040 | 04 6D E0 68 FF 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 C7 10 92 A1 87 94 98 AD 33 CC AF 6B
|
||||
0060 | F2 F4 81 45 F0 F6 24 E2 0B 99 A8 43 9C FC 4D 59
|
||||
0070 | 97 4E D6 29 93 99 FE 92 C8 0D 06 DF 95 1C DA 75
|
||||
0080 | 7A AB 30 14 EC 0B 33 B7 D9 B1 F9 AB 6B FF 3C FB
|
||||
0090 | 72 84 55 2A 27 BB C4 2F BC E1 D5 D2 2B B0 5E 9D
|
||||
00A0 | 90 F0 46 91 F5 0C 99 0B F4 F3 15 D2 04 F1 20 8F
|
||||
00B0 | CC 93 8C 59 F0 4B 7F 8E 61 2D AA 6F 65 BD 76 8A
|
||||
00C0 | 08 5D 42 63 F0 24 49 64 47 83 3F 73 1D B4 C9 96
|
||||
00D0 | 0B E5 26 3F 98 F4 48 C3 2F 89 43 25 8C 68 7D C7
|
||||
00E0 | CD 6C 35 81 FD 37 1B 21 14 65 4F 3A 5C D9 2B C0
|
||||
00F0 | 32 E8 C6 B6 44 D8 59 D5 61 57 12 BA 52 8C F8 EC
|
||||
0100 | 73 E1 B0 88 7E 20 4C A8 18 47 30 4A 2F B3 C4 AA
|
||||
0110 | AA 8A 45 C3 64 D6 CC 6F E0 70 91 3B 7B 19 C2 04
|
||||
0120 | 5B E3 42 6D 2C FE C5 53 3A 0C A2 8D 5B 47 D6 97
|
||||
0130 | 52 D6 8F 74 0C B1 BC 9C 23 CD 15 59 C2 05 4B AF
|
||||
0140 | 7E B8 62 2C 39 34 8A 2B 95 A7 D7 9F D4 F8 A3 90
|
||||
0150 | 1B 15 01 C5</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>
|
||||
<table class="table">
|
||||
|
@ -345,7 +345,7 @@ random_padding_bytes = CD393FCFEB081990DA2835A72E28946F14963306102127968BB2B6A78
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>80040E003C0AC366</code></td>
|
||||
<td><code>94C90E000E0DC366</code></td>
|
||||
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -363,25 +363,25 @@ random_padding_bytes = CD393FCFEB081990DA2835A72E28946F14963306102127968BB2B6A78
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>E7199F7152F417B20780D8E1D7BC1704</code></td>
|
||||
<td><code>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>D76E2C5FD5BBC26092E55CF8191A231B</code></td>
|
||||
<td><code>6C8D9CF57754AE5A5CB305759A6050D0</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p</td>
|
||||
<td>56, 8</td>
|
||||
<td><code>043FB4535F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1068782431</td>
|
||||
<td><code>0440F9F73F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1090123583</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>04426489EF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1113885167</td>
|
||||
<td><code>046DE068FF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1843423487</td>
|
||||
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -393,7 +393,7 @@ random_padding_bytes = CD393FCFEB081990DA2835A72E28946F14963306102127968BB2B6A78
|
|||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>80, 260</td>
|
||||
<td><code>FE0001006F4886E82022FCAC422856BF</code> <code>30AF8E859D309D8740D801CA8DCF4291</code> <code>9353C656F61E608F19F19F59034ED4B5</code> <code>87152A17760245ED706DAD32D8F782F9</code> <code>B2763512F1C7AA8979E6F691D9013A1C</code> <code>EC861673C0532BE494F18CB59016800E</code> <code>D3126CB2C7BBEE311002D621B741D940</code> <code>61155F38F7514E86F7525BAEF6164D02</code> <code>2B85B02E8433F6B050458CF598A7B396</code> <code>1EAC5DD03F083C347FD95679C53122D2</code> <code>EF1C69FEC77441B7DA71367C6F08DC37</code> <code>11FA8CE801B1F7EB2BC46FA254AFC0FA</code> <code>BD0C93843572A54072E336D889607D70</code> <code>BAF097EAEF5BEC69667A731C08AEE033</code> <code>C6F55C4C8065F54FD64C3A0A4C9FBFEF</code> <code>E4FEB0805AEAE6E3CAD853A2E5C9E1D0</code><br> <code>DB146E48</code></td>
|
||||
<td><code>FE000100C71092A1879498AD33CCAF6B</code> <code>F2F48145F0F624E20B99A8439CFC4D59</code> <code>974ED6299399FE92C80D06DF951CDA75</code> <code>7AAB3014EC0B33B7D9B1F9AB6BFF3CFB</code> <code>7284552A27BBC42FBCE1D5D22BB05E9D</code> <code>90F04691F50C990BF4F315D204F1208F</code> <code>CC938C59F04B7F8E612DAA6F65BD768A</code> <code>085D4263F024496447833F731DB4C996</code> <code>0BE5263F98F448C32F8943258C687DC7</code> <code>CD6C3581FD371B2114654F3A5CD92BC0</code> <code>32E8C6B644D859D5615712BA528CF8EC</code> <code>73E1B0887E204CA81847304A2FB3C4AA</code> <code>AA8A45C364D6CC6FE070913B7B19C204</code> <code>5BE3426D2CFEC5533A0CA28D5B47D697</code> <code>52D68F740CB1BC9C23CD1559C2054BAF</code> <code>7EB8622C39348A2B95A7D79FD4F8A390</code><br> <code>1B1501C5</code></td>
|
||||
<td>Value generated above</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -402,47 +402,47 @@ random_padding_bytes = CD393FCFEB081990DA2835A72E28946F14963306102127968BB2B6A78
|
|||
<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 F4 C6 6C 3D 0A C3 66
|
||||
0010 | 84 02 00 00 5C 07 E8 D0 E7 19 9F 71 52 F4 17 B2
|
||||
0020 | 07 80 D8 E1 D7 BC 17 04 D7 6E 2C 5F D5 BB C2 60
|
||||
0030 | 92 E5 5C F8 19 1A 23 1B FE 50 02 00 21 5D C4 8E
|
||||
0040 | 7E B0 83 BF 82 7C 44 47 64 B0 D7 D7 F5 AD 63 A5
|
||||
0050 | 3E 2E 68 18 95 57 BD 62 3E 29 BC 40 69 45 03 56
|
||||
0060 | EC E6 1A 00 13 6C 55 A6 65 D1 6A 81 7F DD F4 F5
|
||||
0070 | 97 A5 30 2B 78 31 7F 8E 4A 92 2E 0F 63 EB 91 48
|
||||
0080 | 79 95 8D 76 34 C4 71 84 95 2D AE 53 62 56 CA A6
|
||||
0090 | CE 5D 0E 3D DF CE 3E 92 C3 44 DE 9C A0 C1 3E 39
|
||||
00A0 | 54 13 EB FB F2 5B F4 65 1C E0 02 FD C2 6E 2E D0
|
||||
00B0 | E8 60 9C 1D A8 9C 77 C3 C7 13 52 8A 77 75 89 83
|
||||
00C0 | D7 26 5F 1E 77 7A 59 06 BA C3 EE 88 6A D1 77 9F
|
||||
00D0 | BF 5B 0B F8 13 CC AF AB 65 15 30 9F 78 5D D6 1F
|
||||
00E0 | AF E3 1F 37 BD 49 F0 7B F6 92 A3 B9 5A 6C 0C D3
|
||||
00F0 | 7A BA BD D1 2B 3C EC 46 46 AC 10 7F 0F D9 1B CB
|
||||
0100 | 29 81 E2 97 58 F9 02 05 76 2D 17 86 FF 32 AE 95
|
||||
0110 | 37 2C E8 C3 98 9F 27 43 D7 33 68 14 E3 BE 4C 0E
|
||||
0120 | 34 33 E4 08 A8 A0 AA 5B 54 E9 36 69 F4 26 B1 A0
|
||||
0130 | E6 52 B3 F3 C2 AD F4 BC 75 08 E5 8A C7 1B C4 E9
|
||||
0140 | 2E AB A4 AA C0 FA EA DC BC 1E E0 19 7E DD 69 92
|
||||
0150 | DF 9F 1B 66 77 24 78 DC 19 D8 EB 92 FC 4F 90 02
|
||||
0160 | 00 50 33 92 22 42 72 B4 91 C1 18 33 80 B4 2D AB
|
||||
0170 | 4B 33 38 43 A2 26 18 3F 3F 6B 48 7E F3 7D 52 8F
|
||||
0180 | F8 17 9A 3A 2F A0 48 17 F5 7A 15 F6 C5 64 86 30
|
||||
0190 | C8 64 52 9A 37 3F 9E 31 12 7F 51 55 93 55 86 3F
|
||||
01A0 | 9B CC F3 E0 D7 C5 0B 3C EA 4A 06 D3 10 81 33 A1
|
||||
01B0 | DF 32 4F 7A 9C E0 D1 83 ED 96 A1 B7 FA 2B A6 AE
|
||||
01C0 | CC 7A 75 4E 3F 9E 28 29 C0 44 A0 D9 48 97 19 1C
|
||||
01D0 | BF 12 D7 26 1B A1 90 5C A5 EC CE DA 6B 9A 48 82
|
||||
01E0 | 6E DB 19 BD 16 48 AA D9 1A C9 B0 8A 8F FF B4 90
|
||||
01F0 | E7 BB CD 00 BE F4 66 59 D8 0F 2E 64 95 99 12 A3
|
||||
0200 | 05 ED B4 CE BA 93 A9 71 33 3E 57 36 40 40 B8 92
|
||||
0210 | 0D 3A 42 AB A3 9D C3 2F 8A D9 35 FE 9A 41 CD E7
|
||||
0220 | 14 3E A0 C9 FA BD 2B 93 EC 32 B1 C6 74 48 A8 A6
|
||||
0230 | D6 CF 3F 92 A6 54 DA AB D9 8A FF 70 E4 3D 0D A3
|
||||
0240 | 3A 99 29 4D 8E 0A 5E 7E 42 49 1D 73 A6 05 2B 51
|
||||
0250 | 97 4D 8A 87 81 FD 01 FF EA 5A 83 B6 49 20 42 45
|
||||
0260 | A1 C3 D4 38 67 35 89 BF 65 4B 93 F4 91 B6 B8 ED
|
||||
0270 | B1 F6 C5 8F 88 80 AF 02 7D FA C7 72 B8 F9 AA 12
|
||||
0280 | 7D 96 7C FD 91 62 EC 3E 82 30 FF FB</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 3C 42 AF 0E 0D C3 66
|
||||
0010 | F0 02 00 00 5C 07 E8 D0 AC 7E C6 49 66 2E CF 3C
|
||||
0020 | F3 BA 99 1B 9D 8D AB D5 6C 8D 9C F5 77 54 AE 5A
|
||||
0030 | 5C B3 05 75 9A 60 50 D0 FE 50 02 00 28 D0 E4 6D
|
||||
0040 | 08 A4 80 08 9A 50 37 02 51 A2 2F 16 07 0A 5D 0F
|
||||
0050 | C7 51 4D BB 6D F2 BE 81 A6 48 9E 9B 53 66 A1 DD
|
||||
0060 | 30 C4 DD 51 E9 98 54 E0 FA 9A A1 A2 3F 97 F4 A2
|
||||
0070 | E6 80 59 DF 84 AE C5 5C 3F 81 06 55 51 F3 A0 66
|
||||
0080 | B1 17 8F 4C F2 82 C6 34 A6 07 87 3F 42 10 87 C0
|
||||
0090 | 73 99 FE EC 09 07 36 B9 7C 5D 2E FD 71 DB 7D C0
|
||||
00A0 | B7 2B F3 B6 36 C6 D6 3E 20 FE DE 5D 86 5A 71 8E
|
||||
00B0 | 85 84 DE 49 9E 8C 94 54 38 03 B4 40 30 54 C8 FE
|
||||
00C0 | DE C8 1C AF F5 C7 56 6B 65 6B 4D 85 EF 92 7A 7C
|
||||
00D0 | 06 A3 CF ED 2E 45 19 A6 22 EE 63 D5 FE 5D 51 1F
|
||||
00E0 | 3A 01 9B 63 FC 11 F9 5B BC E7 FD E9 B0 58 C9 A7
|
||||
00F0 | 12 02 09 C8 0C 57 38 08 43 59 8B 62 3B 94 FC D7
|
||||
0100 | 16 96 04 7F 2A E1 07 69 0E 2F CD 61 EB 05 DA 5A
|
||||
0110 | 6E 0F 13 FA 1E E1 4C 7B E1 E5 5D 47 D0 96 A7 87
|
||||
0120 | 6F 2E 27 A3 C3 62 44 A9 86 E6 17 D9 1A 36 44 D7
|
||||
0130 | DE 98 96 8B FD 09 A4 2C EB 3B 66 14 7A 0F C7 76
|
||||
0140 | 92 2A F1 2D A3 37 7C 8F 33 AA C5 CF C8 75 0C 2F
|
||||
0150 | 4C F9 89 48 09 EF E9 81 F2 88 63 64 FA 81 C7 59
|
||||
0160 | 0A 12 24 4D 00 66 B8 62 D4 2D 78 86 5D DE 8F 2C
|
||||
0170 | 8C 3E 1E ED FA ED 40 1A E2 36 23 D9 19 23 AA CC
|
||||
0180 | A0 71 EE 9D D6 E3 F8 F6 C4 25 A6 06 AF 0B FE F1
|
||||
0190 | 75 A5 17 B6 D4 F7 5C 56 BE 51 F6 DC 45 95 D7 45
|
||||
01A0 | 4D A1 B5 DA D0 5D 59 69 F8 3F E8 DA F2 1C E6 CD
|
||||
01B0 | 4A 57 95 12 CA FF 5F 58 D9 BC 9A 8E 45 92 95 D1
|
||||
01C0 | 35 45 DD 4A C9 B8 37 7B 7A EC 68 2C F3 D7 7E FB
|
||||
01D0 | D4 6B 46 5D 74 40 1F DA C1 7A 6A E4 C3 2F 1A 80
|
||||
01E0 | 53 23 DC 9B 87 DB 38 21 05 38 E1 5D B5 B9 DE DA
|
||||
01F0 | 6A 83 92 E0 1C 4C C4 02 27 16 36 FE BE 42 FE 7A
|
||||
0200 | 2C 81 35 C4 85 A1 A1 04 F4 9B 1F 48 4F B1 8A 80
|
||||
0210 | C8 C0 97 D3 D0 C2 0A 9B 4D 93 09 86 33 8E 2D F5
|
||||
0220 | 56 59 CD F5 0C DE 50 E4 5E 05 CA 09 A3 94 8B BE
|
||||
0230 | 2F 3D 68 E3 EA 5F 3B BF 3E 2E 9F F2 1B B4 5B 18
|
||||
0240 | AF B4 44 F6 75 41 6C 27 C5 5F 3F 52 DA 11 B6 10
|
||||
0250 | D6 C0 D7 07 90 1B 5A 39 3F 81 51 80 1A 3E 2E 38
|
||||
0260 | 75 37 DC 21 DA EF 83 D1 44 1C 47 48 86 60 C0 07
|
||||
0270 | 5F FE 01 D0 E2 0F 65 57 8F FB 6C F2 B3 98 25 38
|
||||
0280 | 4B 29 5F BD 83 9B 46 FA 64 16 C0 A4</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>
|
||||
<table class="table">
|
||||
|
@ -464,13 +464,13 @@ random_padding_bytes = CD393FCFEB081990DA2835A72E28946F14963306102127968BB2B6A78
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>01F4C66C3D0AC366</code></td>
|
||||
<td><code>013C42AF0E0DC366</code></td>
|
||||
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>message_length</td>
|
||||
<td>16, 4</td>
|
||||
<td><code>84020000</code> (644 in decimal)</td>
|
||||
<td><code>F0020000</code> (752 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -482,19 +482,19 @@ random_padding_bytes = CD393FCFEB081990DA2835A72E28946F14963306102127968BB2B6A78
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>E7199F7152F417B20780D8E1D7BC1704</code></td>
|
||||
<td><code>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>D76E2C5FD5BBC26092E55CF8191A231B</code></td>
|
||||
<td><code>6C8D9CF57754AE5A5CB305759A6050D0</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_answer</td>
|
||||
<td>56, 596</td>
|
||||
<td><code>FE500200215DC48E7EB083BF827C4447</code> <code>64B0D7D7F5AD63A53E2E68189557BD62</code> <code>3E29BC4069450356ECE61A00136C55A6</code> <code>65D16A817FDDF4F597A5302B78317F8E</code> <code>4A922E0F63EB914879958D7634C47184</code> <code>952DAE536256CAA6CE5D0E3DDFCE3E92</code> <code>C344DE9CA0C13E395413EBFBF25BF465</code> <code>1CE002FDC26E2ED0E8609C1DA89C77C3</code> <code>C713528A77758983D7265F1E777A5906</code> <code>BAC3EE886AD1779FBF5B0BF813CCAFAB</code> <code>6515309F785DD61FAFE31F37BD49F07B</code> <code>F692A3B95A6C0CD37ABABDD12B3CEC46</code> <code>46AC107F0FD91BCB2981E29758F90205</code> <code>762D1786FF32AE95372CE8C3989F2743</code> <code>D7336814E3BE4C0E3433E408A8A0AA5B</code> <code>54E93669F426B1A0E652B3F3C2ADF4BC</code> <code>7508E58AC71BC4E92EABA4AAC0FAEADC</code> <code>BC1EE0197EDD6992DF9F1B66772478DC</code> <code>19D8EB92FC4F900200503392224272B4</code> <code>91C1183380B42DAB4B333843A226183F</code> <code>3F6B487EF37D528FF8179A3A2FA04817</code> <code>F57A15F6C5648630C864529A373F9E31</code> <code>127F51559355863F9BCCF3E0D7C50B3C</code> <code>EA4A06D3108133A1DF324F7A9CE0D183</code> <code>ED96A1B7FA2BA6AECC7A754E3F9E2829</code> <code>C044A0D94897191CBF12D7261BA1905C</code> <code>A5ECCEDA6B9A48826EDB19BD1648AAD9</code> <code>1AC9B08A8FFFB490E7BBCD00BEF46659</code> <code>D80F2E64959912A305EDB4CEBA93A971</code> <code>333E57364040B8920D3A42ABA39DC32F</code> <code>8AD935FE9A41CDE7143EA0C9FABD2B93</code> <code>EC32B1C67448A8A6D6CF3F92A654DAAB</code> <code>D98AFF70E43D0DA33A99294D8E0A5E7E</code> <code>42491D73A6052B51974D8A8781FD01FF</code> <code>EA5A83B649204245A1C3D438673589BF</code> <code>654B93F491B6B8EDB1F6C58F8880AF02</code> <code>7DFAC772B8F9AA127D967CFD9162EC3E</code><br> <code>8230FFFB</code></td>
|
||||
<td><code>FE50020028D0E46D08A480089A503702</code> <code>51A22F16070A5D0FC7514DBB6DF2BE81</code> <code>A6489E9B5366A1DD30C4DD51E99854E0</code> <code>FA9AA1A23F97F4A2E68059DF84AEC55C</code> <code>3F81065551F3A066B1178F4CF282C634</code> <code>A607873F421087C07399FEEC090736B9</code> <code>7C5D2EFD71DB7DC0B72BF3B636C6D63E</code> <code>20FEDE5D865A718E8584DE499E8C9454</code> <code>3803B4403054C8FEDEC81CAFF5C7566B</code> <code>656B4D85EF927A7C06A3CFED2E4519A6</code> <code>22EE63D5FE5D511F3A019B63FC11F95B</code> <code>BCE7FDE9B058C9A7120209C80C573808</code> <code>43598B623B94FCD71696047F2AE10769</code> <code>0E2FCD61EB05DA5A6E0F13FA1EE14C7B</code> <code>E1E55D47D096A7876F2E27A3C36244A9</code> <code>86E617D91A3644D7DE98968BFD09A42C</code> <code>EB3B66147A0FC776922AF12DA3377C8F</code> <code>33AAC5CFC8750C2F4CF9894809EFE981</code> <code>F2886364FA81C7590A12244D0066B862</code> <code>D42D78865DDE8F2C8C3E1EEDFAED401A</code> <code>E23623D91923AACCA071EE9DD6E3F8F6</code> <code>C425A606AF0BFEF175A517B6D4F75C56</code> <code>BE51F6DC4595D7454DA1B5DAD05D5969</code> <code>F83FE8DAF21CE6CD4A579512CAFF5F58</code> <code>D9BC9A8E459295D13545DD4AC9B8377B</code> <code>7AEC682CF3D77EFBD46B465D74401FDA</code> <code>C17A6AE4C32F1A805323DC9B87DB3821</code> <code>0538E15DB5B9DEDA6A8392E01C4CC402</code> <code>271636FEBE42FE7A2C8135C485A1A104</code> <code>F49B1F484FB18A80C8C097D3D0C20A9B</code> <code>4D930986338E2DF55659CDF50CDE50E4</code> <code>5E05CA09A3948BBE2F3D68E3EA5F3BBF</code> <code>3E2E9FF21BB45B18AFB444F675416C27</code> <code>C55F3F52DA11B610D6C0D707901B5A39</code> <code>3F8151801A3E2E387537DC21DAEF83D1</code> <code>441C47488660C0075FFE01D0E20F6557</code> <code>8FFB6CF2B39825384B295FBD839B46FA</code><br> <code>6416C0A4</code></td>
|
||||
<td>See below</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -502,20 +502,20 @@ random_padding_bytes = CD393FCFEB081990DA2835A72E28946F14963306102127968BB2B6A78
|
|||
<!-- 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 = 215DC48E7EB083BF827C444764B0D7D7F5AD63A53E2E68189557BD623E29BC4069450356ECE61A00136C55A665D16A817FDDF4F597A5302B78317F8E4A922E0F63EB914879958D7634C47184952DAE536256CAA6CE5D0E3DDFCE3E92C344DE9CA0C13E395413EBFBF25BF4651CE002FDC26E2ED0E8609C1DA89C77C3C713528A77758983D7265F1E777A5906BAC3EE886AD1779FBF5B0BF813CCAFAB6515309F785DD61FAFE31F37BD49F07BF692A3B95A6C0CD37ABABDD12B3CEC4646AC107F0FD91BCB2981E29758F90205762D1786FF32AE95372CE8C3989F2743D7336814E3BE4C0E3433E408A8A0AA5B54E93669F426B1A0E652B3F3C2ADF4BC7508E58AC71BC4E92EABA4AAC0FAEADCBC1EE0197EDD6992DF9F1B66772478DC19D8EB92FC4F900200503392224272B491C1183380B42DAB4B333843A226183F3F6B487EF37D528FF8179A3A2FA04817F57A15F6C5648630C864529A373F9E31127F51559355863F9BCCF3E0D7C50B3CEA4A06D3108133A1DF324F7A9CE0D183ED96A1B7FA2BA6AECC7A754E3F9E2829C044A0D94897191CBF12D7261BA1905CA5ECCEDA6B9A48826EDB19BD1648AAD91AC9B08A8FFFB490E7BBCD00BEF46659D80F2E64959912A305EDB4CEBA93A971333E57364040B8920D3A42ABA39DC32F8AD935FE9A41CDE7143EA0C9FABD2B93EC32B1C67448A8A6D6CF3F92A654DAABD98AFF70E43D0DA33A99294D8E0A5E7E42491D73A6052B51974D8A8781FD01FFEA5A83B649204245A1C3D438673589BF654B93F491B6B8EDB1F6C58F8880AF027DFAC772B8F9AA127D967CFD9162EC3E8230FFFB
|
||||
tmp_aes_key = 77B893C5024DD3BD130F7D5371599E09ECFCB661478ADA62E98E1AEA5896239B
|
||||
tmp_aes_iv = BA8F04B37F6A1C228BB98CCC06F171CA2F515B8512A29B19F71AB136DCA0FC59</code></pre>
|
||||
<pre><code>encrypted_answer = 28D0E46D08A480089A50370251A22F16070A5D0FC7514DBB6DF2BE81A6489E9B5366A1DD30C4DD51E99854E0FA9AA1A23F97F4A2E68059DF84AEC55C3F81065551F3A066B1178F4CF282C634A607873F421087C07399FEEC090736B97C5D2EFD71DB7DC0B72BF3B636C6D63E20FEDE5D865A718E8584DE499E8C94543803B4403054C8FEDEC81CAFF5C7566B656B4D85EF927A7C06A3CFED2E4519A622EE63D5FE5D511F3A019B63FC11F95BBCE7FDE9B058C9A7120209C80C57380843598B623B94FCD71696047F2AE107690E2FCD61EB05DA5A6E0F13FA1EE14C7BE1E55D47D096A7876F2E27A3C36244A986E617D91A3644D7DE98968BFD09A42CEB3B66147A0FC776922AF12DA3377C8F33AAC5CFC8750C2F4CF9894809EFE981F2886364FA81C7590A12244D0066B862D42D78865DDE8F2C8C3E1EEDFAED401AE23623D91923AACCA071EE9DD6E3F8F6C425A606AF0BFEF175A517B6D4F75C56BE51F6DC4595D7454DA1B5DAD05D5969F83FE8DAF21CE6CD4A579512CAFF5F58D9BC9A8E459295D13545DD4AC9B8377B7AEC682CF3D77EFBD46B465D74401FDAC17A6AE4C32F1A805323DC9B87DB38210538E15DB5B9DEDA6A8392E01C4CC402271636FEBE42FE7A2C8135C485A1A104F49B1F484FB18A80C8C097D3D0C20A9B4D930986338E2DF55659CDF50CDE50E45E05CA09A3948BBE2F3D68E3EA5F3BBF3E2E9FF21BB45B18AFB444F675416C27C55F3F52DA11B610D6C0D707901B5A393F8151801A3E2E387537DC21DAEF83D1441C47488660C0075FFE01D0E20F65578FFB6CF2B39825384B295FBD839B46FA6416C0A4
|
||||
tmp_aes_key = F9AC244019A3D256B2D0B2A57CCBCB837A05D4A70685F26C926FBAAED69F4148
|
||||
tmp_aes_iv = 1F5D43DF6BEE2B294A86F4F1DCE4E0A30C97CECB011C15F2E09241A4DB3F7E5E</code></pre>
|
||||
<!-- end server_DH_inner_data_input -->
|
||||
<p>Yielding:</p>
|
||||
<!-- start server_DH_inner_data_output -->
|
||||
<pre><code>answer_with_hash = CDA7BD425BA16FD67DF7D1C45E7F4B61F3625919BA0D89B5E7199F7152F417B20780D8E1D7BC1704D76E2C5FD5BBC26092E55CF8191A231B03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001003CEADA7B55C430E582A028F8D0583C5DCCD4AAFD4ECD65AC97A84F5B3154930D918ED19DCD7F179CB1C14A1E231C5F29EBED8423927CAEF54CB2ACFB7EAA46C5A14592675E2A9478B96CF1B5AA91B1823F2002490E19E17D99C63600B7D2602DD38D555EE2AEA387B07A75EB6E0430D05E6BB1C2E6A8E3425DE02A97FC0852D735F137D70FB03FA57D024081413D99AFDB85C42B47765C3F22EDB0F1930452DCF2CF2CA642DC05BF1E681D08C0570FE29AA4B9D6AB49E903E71CFC2F009A74BCE312A50B1C7BFA1EAC4D2EA9CB893EC747E685F6DF59965795EF65B71CEB8F98204D55E60F553592EE583F69D13D020F3963A267413AFF7114A5DDAAC07915933D0AC366A7EBBDB4E9534BFA
|
||||
answer = BA0D89B5E7199F7152F417B20780D8E1D7BC1704D76E2C5FD5BBC26092E55CF8191A231B03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001003CEADA7B55C430E582A028F8D0583C5DCCD4AAFD4ECD65AC97A84F5B3154930D918ED19DCD7F179CB1C14A1E231C5F29EBED8423927CAEF54CB2ACFB7EAA46C5A14592675E2A9478B96CF1B5AA91B1823F2002490E19E17D99C63600B7D2602DD38D555EE2AEA387B07A75EB6E0430D05E6BB1C2E6A8E3425DE02A97FC0852D735F137D70FB03FA57D024081413D99AFDB85C42B47765C3F22EDB0F1930452DCF2CF2CA642DC05BF1E681D08C0570FE29AA4B9D6AB49E903E71CFC2F009A74BCE312A50B1C7BFA1EAC4D2EA9CB893EC747E685F6DF59965795EF65B71CEB8F98204D55E60F553592EE583F69D13D020F3963A267413AFF7114A5DDAAC07915933D0AC366A7EBBDB4E9534BFA</code></pre>
|
||||
<pre><code>answer_with_hash = 581A0BF9CCAD9F42310DD6E06AAB84510994EDCFBA0D89B5AC7EC649662ECF3CF3BA991B9D8DABD56C8D9CF57754AE5A5CB305759A6050D003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001007B42B299039FBDE3A58969368398697AC952271DC43A5438E7782BB65291F69483575A6ED2C3630E9175C7D423174305FF382CE1DED0895A9CEAFA2EE922D6ABF3096665988A10F86D458A967E1328154A8B6DEFA57C0443276AAAAFC9BF7EBEFDFD6B1A512B7A7DA6042C75AD9A1DA99C1B8DA5291E614F942FE51FD4FC134D8C8E4A2020215FD803455E0D1CF12A48B03E77FE29424D184D095B545539183AEAC1C5DA980ADA7EF3BC20493A00BBEAD819933981E9184BED92211B76C02B66DC1A54918634A1AEB3167178B846465FB172CD525C2AC7DEA4C7C342068EECED7240981B353F47601F45B52E83B7AD97D400CF5FD31F810808D8D857EB8924930E0DC36658A349CC05C7B750
|
||||
answer = BA0D89B5AC7EC649662ECF3CF3BA991B9D8DABD56C8D9CF57754AE5A5CB305759A6050D003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001007B42B299039FBDE3A58969368398697AC952271DC43A5438E7782BB65291F69483575A6ED2C3630E9175C7D423174305FF382CE1DED0895A9CEAFA2EE922D6ABF3096665988A10F86D458A967E1328154A8B6DEFA57C0443276AAAAFC9BF7EBEFDFD6B1A512B7A7DA6042C75AD9A1DA99C1B8DA5291E614F942FE51FD4FC134D8C8E4A2020215FD803455E0D1CF12A48B03E77FE29424D184D095B545539183AEAC1C5DA980ADA7EF3BC20493A00BBEAD819933981E9184BED92211B76C02B66DC1A54918634A1AEB3167178B846465FB172CD525C2AC7DEA4C7C342068EECED7240981B353F47601F45B52E83B7AD97D400CF5FD31F810808D8D857EB8924930E0DC36658A349CC05C7B750</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 E7 19 9F 71 52 F4 17 B2 07 80 D8 E1
|
||||
0010 | D7 BC 17 04 D7 6E 2C 5F D5 BB C2 60 92 E5 5C F8
|
||||
0020 | 19 1A 23 1B 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
||||
<pre><code>0000 | BA 0D 89 B5 AC 7E C6 49 66 2E CF 3C F3 BA 99 1B
|
||||
0010 | 9D 8D AB D5 6C 8D 9C F5 77 54 AE 5A 5C B3 05 75
|
||||
0020 | 9A 60 50 D0 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
|
||||
|
@ -532,23 +532,23 @@ answer = BA0D89B5E7199F7152F417B20780D8E1D7BC1704D76E2C5FD5BBC26092E55CF8191A231
|
|||
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 | 3C EA DA 7B 55 C4 30 E5 82 A0 28 F8 D0 58 3C 5D
|
||||
0140 | CC D4 AA FD 4E CD 65 AC 97 A8 4F 5B 31 54 93 0D
|
||||
0150 | 91 8E D1 9D CD 7F 17 9C B1 C1 4A 1E 23 1C 5F 29
|
||||
0160 | EB ED 84 23 92 7C AE F5 4C B2 AC FB 7E AA 46 C5
|
||||
0170 | A1 45 92 67 5E 2A 94 78 B9 6C F1 B5 AA 91 B1 82
|
||||
0180 | 3F 20 02 49 0E 19 E1 7D 99 C6 36 00 B7 D2 60 2D
|
||||
0190 | D3 8D 55 5E E2 AE A3 87 B0 7A 75 EB 6E 04 30 D0
|
||||
01A0 | 5E 6B B1 C2 E6 A8 E3 42 5D E0 2A 97 FC 08 52 D7
|
||||
01B0 | 35 F1 37 D7 0F B0 3F A5 7D 02 40 81 41 3D 99 AF
|
||||
01C0 | DB 85 C4 2B 47 76 5C 3F 22 ED B0 F1 93 04 52 DC
|
||||
01D0 | F2 CF 2C A6 42 DC 05 BF 1E 68 1D 08 C0 57 0F E2
|
||||
01E0 | 9A A4 B9 D6 AB 49 E9 03 E7 1C FC 2F 00 9A 74 BC
|
||||
01F0 | E3 12 A5 0B 1C 7B FA 1E AC 4D 2E A9 CB 89 3E C7
|
||||
0200 | 47 E6 85 F6 DF 59 96 57 95 EF 65 B7 1C EB 8F 98
|
||||
0210 | 20 4D 55 E6 0F 55 35 92 EE 58 3F 69 D1 3D 02 0F
|
||||
0220 | 39 63 A2 67 41 3A FF 71 14 A5 DD AA C0 79 15 93
|
||||
0230 | 3D 0A C3 66</code></pre>
|
||||
0130 | 7B 42 B2 99 03 9F BD E3 A5 89 69 36 83 98 69 7A
|
||||
0140 | C9 52 27 1D C4 3A 54 38 E7 78 2B B6 52 91 F6 94
|
||||
0150 | 83 57 5A 6E D2 C3 63 0E 91 75 C7 D4 23 17 43 05
|
||||
0160 | FF 38 2C E1 DE D0 89 5A 9C EA FA 2E E9 22 D6 AB
|
||||
0170 | F3 09 66 65 98 8A 10 F8 6D 45 8A 96 7E 13 28 15
|
||||
0180 | 4A 8B 6D EF A5 7C 04 43 27 6A AA AF C9 BF 7E BE
|
||||
0190 | FD FD 6B 1A 51 2B 7A 7D A6 04 2C 75 AD 9A 1D A9
|
||||
01A0 | 9C 1B 8D A5 29 1E 61 4F 94 2F E5 1F D4 FC 13 4D
|
||||
01B0 | 8C 8E 4A 20 20 21 5F D8 03 45 5E 0D 1C F1 2A 48
|
||||
01C0 | B0 3E 77 FE 29 42 4D 18 4D 09 5B 54 55 39 18 3A
|
||||
01D0 | EA C1 C5 DA 98 0A DA 7E F3 BC 20 49 3A 00 BB EA
|
||||
01E0 | D8 19 93 39 81 E9 18 4B ED 92 21 1B 76 C0 2B 66
|
||||
01F0 | DC 1A 54 91 86 34 A1 AE B3 16 71 78 B8 46 46 5F
|
||||
0200 | B1 72 CD 52 5C 2A C7 DE A4 C7 C3 42 06 8E EC ED
|
||||
0210 | 72 40 98 1B 35 3F 47 60 1F 45 B5 2E 83 B7 AD 97
|
||||
0220 | D4 00 CF 5F D3 1F 81 08 08 D8 D8 57 EB 89 24 93
|
||||
0230 | 0E 0D C3 66</code></pre>
|
||||
<p>Payload (de)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>
|
||||
<table class="table">
|
||||
|
@ -570,13 +570,13 @@ answer = BA0D89B5E7199F7152F417B20780D8E1D7BC1704D76E2C5FD5BBC26092E55CF8191A231
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>E7199F7152F417B20780D8E1D7BC1704</code></td>
|
||||
<td><code>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>D76E2C5FD5BBC26092E55CF8191A231B</code></td>
|
||||
<td><code>6C8D9CF57754AE5A5CB305759A6050D0</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -594,13 +594,13 @@ answer = BA0D89B5E7199F7152F417B20780D8E1D7BC1704D76E2C5FD5BBC26092E55CF8191A231
|
|||
<tr>
|
||||
<td>g_a</td>
|
||||
<td>300, 260</td>
|
||||
<td><code>FE0001003CEADA7B55C430E582A028F8</code> <code>D0583C5DCCD4AAFD4ECD65AC97A84F5B</code> <code>3154930D918ED19DCD7F179CB1C14A1E</code> <code>231C5F29EBED8423927CAEF54CB2ACFB</code> <code>7EAA46C5A14592675E2A9478B96CF1B5</code> <code>AA91B1823F2002490E19E17D99C63600</code> <code>B7D2602DD38D555EE2AEA387B07A75EB</code> <code>6E0430D05E6BB1C2E6A8E3425DE02A97</code> <code>FC0852D735F137D70FB03FA57D024081</code> <code>413D99AFDB85C42B47765C3F22EDB0F1</code> <code>930452DCF2CF2CA642DC05BF1E681D08</code> <code>C0570FE29AA4B9D6AB49E903E71CFC2F</code> <code>009A74BCE312A50B1C7BFA1EAC4D2EA9</code> <code>CB893EC747E685F6DF59965795EF65B7</code> <code>1CEB8F98204D55E60F553592EE583F69</code> <code>D13D020F3963A267413AFF7114A5DDAA</code><br> <code>C0791593</code></td>
|
||||
<td><code>FE0001007B42B299039FBDE3A5896936</code> <code>8398697AC952271DC43A5438E7782BB6</code> <code>5291F69483575A6ED2C3630E9175C7D4</code> <code>23174305FF382CE1DED0895A9CEAFA2E</code> <code>E922D6ABF3096665988A10F86D458A96</code> <code>7E1328154A8B6DEFA57C0443276AAAAF</code> <code>C9BF7EBEFDFD6B1A512B7A7DA6042C75</code> <code>AD9A1DA99C1B8DA5291E614F942FE51F</code> <code>D4FC134D8C8E4A2020215FD803455E0D</code> <code>1CF12A48B03E77FE29424D184D095B54</code> <code>5539183AEAC1C5DA980ADA7EF3BC2049</code> <code>3A00BBEAD819933981E9184BED92211B</code> <code>76C02B66DC1A54918634A1AEB3167178</code> <code>B846465FB172CD525C2AC7DEA4C7C342</code> <code>068EECED7240981B353F47601F45B52E</code> <code>83B7AD97D400CF5FD31F810808D8D857</code><br> <code>EB892493</code></td>
|
||||
<td><code>g_a</code> diffie-hellman parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_time</td>
|
||||
<td>560, 4</td>
|
||||
<td><code>3D0AC366</code> (1724058173 in decimal)</td>
|
||||
<td><code>0E0DC366</code> (1724058894 in decimal)</td>
|
||||
<td>Server time</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -609,34 +609,34 @@ answer = BA0D89B5E7199F7152F417B20780D8E1D7BC1704D76E2C5FD5BBC26092E55CF8191A231
|
|||
<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 = 695233B6F2BF27BECC34920082B37D1D65BEC6B17E0A0390A70BCA737373C2826A8B92AE441809E0C8C9A1D80778E2DCB916012DED52E62BCC7359FF350AF09C622E713B22221F2FEF2B695975FF01922BB7ADE3BE91D18ABE9DA4D17E577C516A142AC0650037BDCAE7E667ED18961C80993CC08BCBC3978FAFC70F634564D907055490CD9D7F23F2555DF42DD3D3403F8898C2E0E2CCD8D3377E9CF208B68E09E71C94DC2B2EE95A3787E50189201AA83D7A9496C892F333112B902A083CAF0C7703784E954F4CDCA4F153AAFADC5682BBD23485EFDDF3AA453A1D953DE4767277587EED6E154DB7D7490A5D3D702119367E5548D7560F17D8923B2F1F1469</code></pre>
|
||||
<pre><code>b = 592CF3A19B9F0EAF00180A82A163D2734BD5B520CD6E7DFAFEACCDB4E64203CCB37CE3D94B45F10AF1D590B9FE8ACEED5FC0390C4B82FCC6E7FB83744382FC1643953D8E7B63AF64EEF000B16EAA8A5B80A8E432A1C23EDA3595E595FFEEB429F54B3CEA2A505B5E4CE9B43CA620FE8BB21079C53900852A26CD29062D22176B711435EBA75E446C8C72CE622E461D9D8C4322E0C2170E825E383B45C88A04E5C1CB33E19A859EB12D81F9AE6A3483A6DD45545F56227EE76841462EE855901E5121C73CAC985F6A21655557AE0ED4659B8F6B383C90F13B98ECF55A9F242EB1B0C5E695B83D1015236DED146C70C4D8C421E8B61F21BBBD8714C6656C06B162</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 = B80CC79120B35536558EC7DEF5FE306ABA79D28B23BD58121BADE4F7BFEB80F2E80D6E86008799B2FAB9F1AB34B56753F35E64B663AC7DF948F53E86EDE5610358205AC014BC9B81A59591E9ABBC2C161E91B8CFC28E7632D96D596F7297D21D44FE2B457F94B5AD8F1B0BDF288CD500D3A4C9EF835D59CC9197E9820DDBCE41151C3EF4E6E29043BC7BDC5F50A79CB1EC0A60CB5A9A3B672EEB138E8E14747B73C65ABD932213F531524870E820DC7733E6E2047720DC9516F0EAD3910C7569CD648280F63160C5A98D50C8F02011B74E03B8419BF3511A275F6E6840F5480191167E8A3B7B6B8B9456E18868C0DADEFCE02B6571CE13695AEE668A610BDB95</code></pre>
|
||||
<pre><code>g_b = 8D1278EB55A89D367A6E59DA3EDE2FB197719FEDB8D0267AE15A609E6E631352A2BAF8C2877AD56010AF1A7C28C58F67C82E7F16360B40519FE75E169930B96F55D677B3F248E01472A76800BC08CE8DAA8919E4902D5E9C5B344AD4D75DFA7500701C0B6E43BCB27DD1038B77DA5BE15E0478C97F71650D656D8788144673597AA665EDDDC485F703AB0A326BCCB8C11D2CB748673D4DD5BD21C279F31F893036930DC74DD564CBC2DE3FB243032979A41CFDB7FD06463F43721E79D0C2FD44F4BE371C7385D48CC71D7A104CF1BB8CC21AC3FC7E64FD647021F77864DD28A617F2386160A7DCD7BA7EA71C1DE7D21B304BEE614B3F24031F70E2CE02368BC7</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 E7 19 9F 71 52 F4 17 B2 07 80 D8 E1
|
||||
0010 | D7 BC 17 04 D7 6E 2C 5F D5 BB C2 60 92 E5 5C F8
|
||||
0020 | 19 1A 23 1B 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | B8 0C C7 91 20 B3 55 36 55 8E C7 DE F5 FE 30 6A
|
||||
0040 | BA 79 D2 8B 23 BD 58 12 1B AD E4 F7 BF EB 80 F2
|
||||
0050 | E8 0D 6E 86 00 87 99 B2 FA B9 F1 AB 34 B5 67 53
|
||||
0060 | F3 5E 64 B6 63 AC 7D F9 48 F5 3E 86 ED E5 61 03
|
||||
0070 | 58 20 5A C0 14 BC 9B 81 A5 95 91 E9 AB BC 2C 16
|
||||
0080 | 1E 91 B8 CF C2 8E 76 32 D9 6D 59 6F 72 97 D2 1D
|
||||
0090 | 44 FE 2B 45 7F 94 B5 AD 8F 1B 0B DF 28 8C D5 00
|
||||
00A0 | D3 A4 C9 EF 83 5D 59 CC 91 97 E9 82 0D DB CE 41
|
||||
00B0 | 15 1C 3E F4 E6 E2 90 43 BC 7B DC 5F 50 A7 9C B1
|
||||
00C0 | EC 0A 60 CB 5A 9A 3B 67 2E EB 13 8E 8E 14 74 7B
|
||||
00D0 | 73 C6 5A BD 93 22 13 F5 31 52 48 70 E8 20 DC 77
|
||||
00E0 | 33 E6 E2 04 77 20 DC 95 16 F0 EA D3 91 0C 75 69
|
||||
00F0 | CD 64 82 80 F6 31 60 C5 A9 8D 50 C8 F0 20 11 B7
|
||||
0100 | 4E 03 B8 41 9B F3 51 1A 27 5F 6E 68 40 F5 48 01
|
||||
0110 | 91 16 7E 8A 3B 7B 6B 8B 94 56 E1 88 68 C0 DA DE
|
||||
0120 | FC E0 2B 65 71 CE 13 69 5A EE 66 8A 61 0B DB 95</code></pre>
|
||||
<pre><code>0000 | 54 B6 43 66 AC 7E C6 49 66 2E CF 3C F3 BA 99 1B
|
||||
0010 | 9D 8D AB D5 6C 8D 9C F5 77 54 AE 5A 5C B3 05 75
|
||||
0020 | 9A 60 50 D0 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 8D 12 78 EB 55 A8 9D 36 7A 6E 59 DA 3E DE 2F B1
|
||||
0040 | 97 71 9F ED B8 D0 26 7A E1 5A 60 9E 6E 63 13 52
|
||||
0050 | A2 BA F8 C2 87 7A D5 60 10 AF 1A 7C 28 C5 8F 67
|
||||
0060 | C8 2E 7F 16 36 0B 40 51 9F E7 5E 16 99 30 B9 6F
|
||||
0070 | 55 D6 77 B3 F2 48 E0 14 72 A7 68 00 BC 08 CE 8D
|
||||
0080 | AA 89 19 E4 90 2D 5E 9C 5B 34 4A D4 D7 5D FA 75
|
||||
0090 | 00 70 1C 0B 6E 43 BC B2 7D D1 03 8B 77 DA 5B E1
|
||||
00A0 | 5E 04 78 C9 7F 71 65 0D 65 6D 87 88 14 46 73 59
|
||||
00B0 | 7A A6 65 ED DD C4 85 F7 03 AB 0A 32 6B CC B8 C1
|
||||
00C0 | 1D 2C B7 48 67 3D 4D D5 BD 21 C2 79 F3 1F 89 30
|
||||
00D0 | 36 93 0D C7 4D D5 64 CB C2 DE 3F B2 43 03 29 79
|
||||
00E0 | A4 1C FD B7 FD 06 46 3F 43 72 1E 79 D0 C2 FD 44
|
||||
00F0 | F4 BE 37 1C 73 85 D4 8C C7 1D 7A 10 4C F1 BB 8C
|
||||
0100 | C2 1A C3 FC 7E 64 FD 64 70 21 F7 78 64 DD 28 A6
|
||||
0110 | 17 F2 38 61 60 A7 DC D7 BA 7E A7 1C 1D E7 D2 1B
|
||||
0120 | 30 4B EE 61 4B 3F 24 03 1F 70 E2 CE 02 36 8B C7</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>
|
||||
<table class="table">
|
||||
|
@ -658,19 +658,19 @@ answer = BA0D89B5E7199F7152F417B20780D8E1D7BC1704D76E2C5FD5BBC26092E55CF8191A231
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>E7199F7152F417B20780D8E1D7BC1704</code></td>
|
||||
<td><code>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>D76E2C5FD5BBC26092E55CF8191A231B</code></td>
|
||||
<td><code>6C8D9CF57754AE5A5CB305759A6050D0</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>g_b</td>
|
||||
<td>36, 260</td>
|
||||
<td><code>FE000100B80CC79120B35536558EC7DE</code> <code>F5FE306ABA79D28B23BD58121BADE4F7</code> <code>BFEB80F2E80D6E86008799B2FAB9F1AB</code> <code>34B56753F35E64B663AC7DF948F53E86</code> <code>EDE5610358205AC014BC9B81A59591E9</code> <code>ABBC2C161E91B8CFC28E7632D96D596F</code> <code>7297D21D44FE2B457F94B5AD8F1B0BDF</code> <code>288CD500D3A4C9EF835D59CC9197E982</code> <code>0DDBCE41151C3EF4E6E29043BC7BDC5F</code> <code>50A79CB1EC0A60CB5A9A3B672EEB138E</code> <code>8E14747B73C65ABD932213F531524870</code> <code>E820DC7733E6E2047720DC9516F0EAD3</code> <code>910C7569CD648280F63160C5A98D50C8</code> <code>F02011B74E03B8419BF3511A275F6E68</code> <code>40F5480191167E8A3B7B6B8B9456E188</code> <code>68C0DADEFCE02B6571CE13695AEE668A</code><br> <code>610BDB95</code></td>
|
||||
<td><code>FE0001008D1278EB55A89D367A6E59DA</code> <code>3EDE2FB197719FEDB8D0267AE15A609E</code> <code>6E631352A2BAF8C2877AD56010AF1A7C</code> <code>28C58F67C82E7F16360B40519FE75E16</code> <code>9930B96F55D677B3F248E01472A76800</code> <code>BC08CE8DAA8919E4902D5E9C5B344AD4</code> <code>D75DFA7500701C0B6E43BCB27DD1038B</code> <code>77DA5BE15E0478C97F71650D656D8788</code> <code>144673597AA665EDDDC485F703AB0A32</code> <code>6BCCB8C11D2CB748673D4DD5BD21C279</code> <code>F31F893036930DC74DD564CBC2DE3FB2</code> <code>43032979A41CFDB7FD06463F43721E79</code> <code>D0C2FD44F4BE371C7385D48CC71D7A10</code> <code>4CF1BB8CC21AC3FC7E64FD647021F778</code> <code>64DD28A617F2386160A7DCD7BA7EA71C</code> <code>1DE7D21B304BEE614B3F24031F70E2CE</code><br> <code>02368BC7</code></td>
|
||||
<td>Single-byte prefix denoting length, a 256-byte (2048-bit) string, and zero bytes of padding</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -684,47 +684,47 @@ answer = BA0D89B5E7199F7152F417B20780D8E1D7BC1704D76E2C5FD5BBC26092E55CF8191A231
|
|||
<!-- 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 = 54B64366E7199F7152F417B20780D8E1D7BC1704D76E2C5FD5BBC26092E55CF8191A231B0000000000000000FE000100B80CC79120B35536558EC7DEF5FE306ABA79D28B23BD58121BADE4F7BFEB80F2E80D6E86008799B2FAB9F1AB34B56753F35E64B663AC7DF948F53E86EDE5610358205AC014BC9B81A59591E9ABBC2C161E91B8CFC28E7632D96D596F7297D21D44FE2B457F94B5AD8F1B0BDF288CD500D3A4C9EF835D59CC9197E9820DDBCE41151C3EF4E6E29043BC7BDC5F50A79CB1EC0A60CB5A9A3B672EEB138E8E14747B73C65ABD932213F531524870E820DC7733E6E2047720DC9516F0EAD3910C7569CD648280F63160C5A98D50C8F02011B74E03B8419BF3511A275F6E6840F5480191167E8A3B7B6B8B9456E18868C0DADEFCE02B6571CE13695AEE668A610BDB95
|
||||
padding = F52C52AE91BAB243EEB80C75
|
||||
tmp_aes_key = 77B893C5024DD3BD130F7D5371599E09ECFCB661478ADA62E98E1AEA5896239B
|
||||
tmp_aes_iv = BA8F04B37F6A1C228BB98CCC06F171CA2F515B8512A29B19F71AB136DCA0FC59</code></pre>
|
||||
<pre><code>data = 54B64366AC7EC649662ECF3CF3BA991B9D8DABD56C8D9CF57754AE5A5CB305759A6050D00000000000000000FE0001008D1278EB55A89D367A6E59DA3EDE2FB197719FEDB8D0267AE15A609E6E631352A2BAF8C2877AD56010AF1A7C28C58F67C82E7F16360B40519FE75E169930B96F55D677B3F248E01472A76800BC08CE8DAA8919E4902D5E9C5B344AD4D75DFA7500701C0B6E43BCB27DD1038B77DA5BE15E0478C97F71650D656D8788144673597AA665EDDDC485F703AB0A326BCCB8C11D2CB748673D4DD5BD21C279F31F893036930DC74DD564CBC2DE3FB243032979A41CFDB7FD06463F43721E79D0C2FD44F4BE371C7385D48CC71D7A104CF1BB8CC21AC3FC7E64FD647021F77864DD28A617F2386160A7DCD7BA7EA71C1DE7D21B304BEE614B3F24031F70E2CE02368BC7
|
||||
padding = FE5409530AA9DA24EA778019
|
||||
tmp_aes_key = F9AC244019A3D256B2D0B2A57CCBCB837A05D4A70685F26C926FBAAED69F4148
|
||||
tmp_aes_iv = 1F5D43DF6BEE2B294A86F4F1DCE4E0A30C97CECB011C15F2E09241A4DB3F7E5E</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 = 0FF48107F119E20293585ABFA87F1D360950F2A86DD2DB3C2CF41A607C1A9811C62DBE86AB1731D5CEB109AD3D723FFC2AD659268048031CF29C92EAEAA04C079B050F2F0BA59FABA51021AAD982A46BF662BDC3D67567FBA2FACBC30E529AE7BEE6C543BF55BEEFDF90A6F88647215CD815B7E5963DF65D07F4035116589209F1885E831404B1A71D7487CB820D1302834A5400A89B30E0D7D3A3E5DD3741ED6DB30FCE5B61540C6EBB5E5029977AC3F55CE934F1F3C317642C79BD8396AA60B976696D7158FE7FDB14ADE12C226EE61C9D63347B90D9372F6DBCE9ACF619D10CCB4E3D7325BE5C75B3DE3BEC95F2E63B12D38C8DEDB73570CA999468DF0651F891124FA5FCF2B2ADEC2FF93ADCD3E766B35ACD5EA9E498B80AF89DDD18D01331C936E97D17F6506E78590F3A63EB74C22357A2C7FED0DCF0440F111231A86AA19F15AFBE8A05D454050A63C0944F81</code></pre>
|
||||
<pre><code>encrypted_data = 6DB219ECBF7D9D7F82C74ED3A0F94C6B2DD8EFD9D013CE3C83711187BCDFAF7A7D6422CC3563BF797CF49D6B019899E8B0A9F6BFF7343A2F7B257E37C5AF8BBEC9B107A84D17BD11567846C804C25CF1D64A669410EFCF2D6FDCE346ECD3431AFAB0B7C0A4B514CC502B6AA66D3FFFBB240B0926E2747E687910C2BA53CAFAC8F7F678D678896169CBD6178733F069AD85B23CA0A84BF76A52AA470FDA804A1F9FBF34A6C944E419697AE7D2B9A4FD2D28BD44204E66FF5E6E7178669128D68EDE1D03B26020A1E9E2F38780FEA68AEB6297F7A282E164C9BA2DC5317A7541B26F726AB2B13E8192AFCE8A664FCFC71FCD0B6A7F1A829ED70CB7F0126E0E15FCAFE07E103CA90992E00071C996A2257B25FA51EE5F2F97255C15FADCE648D9051C03F0F5F5ABA532CA7A5340E5424E4831B296F361FE4C47ACEC49F0F00E8DA434A5FC4CFAB5D004D9867C9CA9195EC6</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 64 E6 0E 00 3D 0A C3 66
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 E7 19 9F 71 52 F4 17 B2
|
||||
0020 | 07 80 D8 E1 D7 BC 17 04 D7 6E 2C 5F D5 BB C2 60
|
||||
0030 | 92 E5 5C F8 19 1A 23 1B FE 50 01 00 0F F4 81 07
|
||||
0040 | F1 19 E2 02 93 58 5A BF A8 7F 1D 36 09 50 F2 A8
|
||||
0050 | 6D D2 DB 3C 2C F4 1A 60 7C 1A 98 11 C6 2D BE 86
|
||||
0060 | AB 17 31 D5 CE B1 09 AD 3D 72 3F FC 2A D6 59 26
|
||||
0070 | 80 48 03 1C F2 9C 92 EA EA A0 4C 07 9B 05 0F 2F
|
||||
0080 | 0B A5 9F AB A5 10 21 AA D9 82 A4 6B F6 62 BD C3
|
||||
0090 | D6 75 67 FB A2 FA CB C3 0E 52 9A E7 BE E6 C5 43
|
||||
00A0 | BF 55 BE EF DF 90 A6 F8 86 47 21 5C D8 15 B7 E5
|
||||
00B0 | 96 3D F6 5D 07 F4 03 51 16 58 92 09 F1 88 5E 83
|
||||
00C0 | 14 04 B1 A7 1D 74 87 CB 82 0D 13 02 83 4A 54 00
|
||||
00D0 | A8 9B 30 E0 D7 D3 A3 E5 DD 37 41 ED 6D B3 0F CE
|
||||
00E0 | 5B 61 54 0C 6E BB 5E 50 29 97 7A C3 F5 5C E9 34
|
||||
00F0 | F1 F3 C3 17 64 2C 79 BD 83 96 AA 60 B9 76 69 6D
|
||||
0100 | 71 58 FE 7F DB 14 AD E1 2C 22 6E E6 1C 9D 63 34
|
||||
0110 | 7B 90 D9 37 2F 6D BC E9 AC F6 19 D1 0C CB 4E 3D
|
||||
0120 | 73 25 BE 5C 75 B3 DE 3B EC 95 F2 E6 3B 12 D3 8C
|
||||
0130 | 8D ED B7 35 70 CA 99 94 68 DF 06 51 F8 91 12 4F
|
||||
0140 | A5 FC F2 B2 AD EC 2F F9 3A DC D3 E7 66 B3 5A CD
|
||||
0150 | 5E A9 E4 98 B8 0A F8 9D DD 18 D0 13 31 C9 36 E9
|
||||
0160 | 7D 17 F6 50 6E 78 59 0F 3A 63 EB 74 C2 23 57 A2
|
||||
0170 | C7 FE D0 DC F0 44 0F 11 12 31 A8 6A A1 9F 15 AF
|
||||
0180 | BE 8A 05 D4 54 05 0A 63 C0 94 4F 81</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 98 C9 0E 00 0E 0D C3 66
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 AC 7E C6 49 66 2E CF 3C
|
||||
0020 | F3 BA 99 1B 9D 8D AB D5 6C 8D 9C F5 77 54 AE 5A
|
||||
0030 | 5C B3 05 75 9A 60 50 D0 FE 50 01 00 6D B2 19 EC
|
||||
0040 | BF 7D 9D 7F 82 C7 4E D3 A0 F9 4C 6B 2D D8 EF D9
|
||||
0050 | D0 13 CE 3C 83 71 11 87 BC DF AF 7A 7D 64 22 CC
|
||||
0060 | 35 63 BF 79 7C F4 9D 6B 01 98 99 E8 B0 A9 F6 BF
|
||||
0070 | F7 34 3A 2F 7B 25 7E 37 C5 AF 8B BE C9 B1 07 A8
|
||||
0080 | 4D 17 BD 11 56 78 46 C8 04 C2 5C F1 D6 4A 66 94
|
||||
0090 | 10 EF CF 2D 6F DC E3 46 EC D3 43 1A FA B0 B7 C0
|
||||
00A0 | A4 B5 14 CC 50 2B 6A A6 6D 3F FF BB 24 0B 09 26
|
||||
00B0 | E2 74 7E 68 79 10 C2 BA 53 CA FA C8 F7 F6 78 D6
|
||||
00C0 | 78 89 61 69 CB D6 17 87 33 F0 69 AD 85 B2 3C A0
|
||||
00D0 | A8 4B F7 6A 52 AA 47 0F DA 80 4A 1F 9F BF 34 A6
|
||||
00E0 | C9 44 E4 19 69 7A E7 D2 B9 A4 FD 2D 28 BD 44 20
|
||||
00F0 | 4E 66 FF 5E 6E 71 78 66 91 28 D6 8E DE 1D 03 B2
|
||||
0100 | 60 20 A1 E9 E2 F3 87 80 FE A6 8A EB 62 97 F7 A2
|
||||
0110 | 82 E1 64 C9 BA 2D C5 31 7A 75 41 B2 6F 72 6A B2
|
||||
0120 | B1 3E 81 92 AF CE 8A 66 4F CF C7 1F CD 0B 6A 7F
|
||||
0130 | 1A 82 9E D7 0C B7 F0 12 6E 0E 15 FC AF E0 7E 10
|
||||
0140 | 3C A9 09 92 E0 00 71 C9 96 A2 25 7B 25 FA 51 EE
|
||||
0150 | 5F 2F 97 25 5C 15 FA DC E6 48 D9 05 1C 03 F0 F5
|
||||
0160 | F5 AB A5 32 CA 7A 53 40 E5 42 4E 48 31 B2 96 F3
|
||||
0170 | 61 FE 4C 47 AC EC 49 F0 F0 0E 8D A4 34 A5 FC 4C
|
||||
0180 | FA B5 D0 04 D9 86 7C 9C A9 19 5E C6</code></pre>
|
||||
<p>Payload (de)serialization:</p>
|
||||
<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">
|
||||
|
@ -746,7 +746,7 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>64E60E003D0AC366</code></td>
|
||||
<td><code>98C90E000E0DC366</code></td>
|
||||
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -764,19 +764,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>E7199F7152F417B20780D8E1D7BC1704</code></td>
|
||||
<td><code>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>D76E2C5FD5BBC26092E55CF8191A231B</code></td>
|
||||
<td><code>6C8D9CF57754AE5A5CB305759A6050D0</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>56, 340</td>
|
||||
<td><code>FE5001000FF48107F119E20293585ABF</code> <code>A87F1D360950F2A86DD2DB3C2CF41A60</code> <code>7C1A9811C62DBE86AB1731D5CEB109AD</code> <code>3D723FFC2AD659268048031CF29C92EA</code> <code>EAA04C079B050F2F0BA59FABA51021AA</code> <code>D982A46BF662BDC3D67567FBA2FACBC3</code> <code>0E529AE7BEE6C543BF55BEEFDF90A6F8</code> <code>8647215CD815B7E5963DF65D07F40351</code> <code>16589209F1885E831404B1A71D7487CB</code> <code>820D1302834A5400A89B30E0D7D3A3E5</code> <code>DD3741ED6DB30FCE5B61540C6EBB5E50</code> <code>29977AC3F55CE934F1F3C317642C79BD</code> <code>8396AA60B976696D7158FE7FDB14ADE1</code> <code>2C226EE61C9D63347B90D9372F6DBCE9</code> <code>ACF619D10CCB4E3D7325BE5C75B3DE3B</code> <code>EC95F2E63B12D38C8DEDB73570CA9994</code> <code>68DF0651F891124FA5FCF2B2ADEC2FF9</code> <code>3ADCD3E766B35ACD5EA9E498B80AF89D</code> <code>DD18D01331C936E97D17F6506E78590F</code> <code>3A63EB74C22357A2C7FED0DCF0440F11</code> <code>1231A86AA19F15AFBE8A05D454050A63</code><br> <code>C0944F81</code></td>
|
||||
<td><code>FE5001006DB219ECBF7D9D7F82C74ED3</code> <code>A0F94C6B2DD8EFD9D013CE3C83711187</code> <code>BCDFAF7A7D6422CC3563BF797CF49D6B</code> <code>019899E8B0A9F6BFF7343A2F7B257E37</code> <code>C5AF8BBEC9B107A84D17BD11567846C8</code> <code>04C25CF1D64A669410EFCF2D6FDCE346</code> <code>ECD3431AFAB0B7C0A4B514CC502B6AA6</code> <code>6D3FFFBB240B0926E2747E687910C2BA</code> <code>53CAFAC8F7F678D678896169CBD61787</code> <code>33F069AD85B23CA0A84BF76A52AA470F</code> <code>DA804A1F9FBF34A6C944E419697AE7D2</code> <code>B9A4FD2D28BD44204E66FF5E6E717866</code> <code>9128D68EDE1D03B26020A1E9E2F38780</code> <code>FEA68AEB6297F7A282E164C9BA2DC531</code> <code>7A7541B26F726AB2B13E8192AFCE8A66</code> <code>4FCFC71FCD0B6A7F1A829ED70CB7F012</code> <code>6E0E15FCAFE07E103CA90992E00071C9</code> <code>96A2257B25FA51EE5F2F97255C15FADC</code> <code>E648D9051C03F0F5F5ABA532CA7A5340</code> <code>E5424E4831B296F361FE4C47ACEC49F0</code> <code>F00E8DA434A5FC4CFAB5D004D9867C9C</code><br> <code>A9195EC6</code></td>
|
||||
<td>Encrypted client_DH_inner_data generated previously, serialized as a TL byte string</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -785,17 +785,17 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|||
<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 = 48FA2B9A781BACF30763E5D01114E33477CB2935AEC3058FDB82A4B16A50180993B24341500F3E54C5BB8ECF46FF7D8A288AF28680430760C01A0E2EC2C51550CCF0E757F6D791B799206B277FFF6E6E0B64DCA4433C7A4CCDA6D5AEC7D0B57E3D687A6C3AD75A60F5B93D57DFC85951CFC0C14DE7BDB82F9465B43E371C3725FE0B3CE2241BE5FAF30C8A666F049916969A370F225003D27626AB0BCC227204C01FD9A17CB5B32B8A0E41BAAB36FA3D9B1732C06F4192A014772F0A11548E28AC0F42B9D071D51896B2FB5D32615E3AF93305F3C5E285B86F11BA510479D17483308D3B019BEE8B00C05969A2DB353A0052538DFE0CEF43479A8F2629E8592E</code></pre>
|
||||
<pre><code>auth_key = BD19EE3E32B7F2A3B21CE27F251253E106ACFE7401C24BAFC48AFF27D4CE65087D21DA335CC0B0C3E61C9968FFFF1DFDC3B15F976115D216753C1ECE895D93F2C24F5FA5DF76AF1C3BE8FEF67D1A70133BF587A93E823EC2F1F859899F9EDA79E004873F21492438EF308B467B9F872C188AE7ED0EEFEA51861D70497863092E5ECD0A440C1CBDC9C183B861C21E6E176645F001E551F29188E07ED84C6BBE7E3266F151D0F2C0CC00F867F821824BB81DF5C510F8E83AEE99D4A08A24209A69817E9F7DEBE86C1C0102BB27D2CA185D60CD31C283EC0AAC6FE7CC02BE53B92EE051F9FC8CC703184DD92303C0F8D7DB74C2F3BC705FCF33BD02B3A8EB4E6957</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 54 8F DC 3E 0A C3 66
|
||||
0010 | 38 00 00 00 34 F7 CB 3B E7 19 9F 71 52 F4 17 B2
|
||||
0020 | 07 80 D8 E1 D7 BC 17 04 D7 6E 2C 5F D5 BB C2 60
|
||||
0030 | 92 E5 5C F8 19 1A 23 1B B5 A4 B1 F9 1A 2D 54 A1
|
||||
0040 | DC 90 37 1D 57 44 C7 A7</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 74 0C 9C 0F 0D C3 66
|
||||
0010 | 60 00 00 00 34 F7 CB 3B AC 7E C6 49 66 2E CF 3C
|
||||
0020 | F3 BA 99 1B 9D 8D AB D5 6C 8D 9C F5 77 54 AE 5A
|
||||
0030 | 5C B3 05 75 9A 60 50 D0 A1 20 67 1F 5B 7A 78 E9
|
||||
0040 | DB D0 18 6D 6D B6 73 54</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>
|
||||
<table class="table">
|
||||
|
@ -817,13 +817,13 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>01548FDC3E0AC366</code></td>
|
||||
<td><code>01740C9C0F0DC366</code></td>
|
||||
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>message_length</td>
|
||||
<td>16, 4</td>
|
||||
<td><code>38000000</code> (56 in decimal)</td>
|
||||
<td><code>60000000</code> (96 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -835,19 +835,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>E7199F7152F417B20780D8E1D7BC1704</code></td>
|
||||
<td><code>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>D76E2C5FD5BBC26092E55CF8191A231B</code></td>
|
||||
<td><code>6C8D9CF57754AE5A5CB305759A6050D0</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce_hash1</td>
|
||||
<td>56, 16</td>
|
||||
<td><code>B5A4B1F91A2D54A1DC90371D5744C7A7</code></td>
|
||||
<td><code>A120671F5B7A78E9DBD0186D6DB67354</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>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
|
@ -104,7 +104,7 @@ destroy_session#e7512126 session_id:long = DestroySessionRes;</code></pre>
|
|||
<pre><code>message msg_id:long seqno:int bytes:int body:Object = Message;</code></pre>
|
||||
<p><code>bytes</code> is the number of bytes in the body serialization.
|
||||
All messages in a container must have msg_id lower than that of the container itself. A container does not require an acknowledgment and may not carry other simple containers. When messages are re-sent, they may be combined into a container in a different manner or sent individually.</p>
|
||||
<p>MTProto container can have at have at most <code>1024</code> messages. Clients should group acknowledgments, state requests and message resend requests into three separate <a href="/mtproto/service_messages_about_messages#acknowledgment-of-receipt"><code>msgs_ack</code> »</a>, <a href="https://core.telegram.org/mtproto/service_messages_about_messages#request-for-message-status-information"><code>msgs_state_req</code> »</a>, <a href="/mtproto/service_messages_about_messages#explicit-request-to-re-send-messages"><code>msg_resend_req</code> »</a> service messages with at most 8192 IDs each. </p>
|
||||
<p>MTProto container can have at have at most <code>1024</code> messages. Clients should group acknowledgments, state requests and message resend requests into three separate <a href="/mtproto/service_messages_about_messages#acknowledgment-of-receipt"><code>msgs_ack</code> »</a>, <a href="https://core.telegram.org/mtproto/service_messages_about_messages#request-for-message-status-information"><code>msgs_state_req</code> »</a>, <a href="/mtproto/service_messages_about_messages#explicit-request-to-re-send-messages"><code>msg_resend_req</code> »</a> service messages with at most 8192 IDs each. </p>
|
||||
<p>Empty containers are also allowed. They are used by the server, for example, to respond to an HTTP request when the timeout specified in http_wait expires, and there are no messages to transmit. </p>
|
||||
<p><a href="https://github.com/tdlib/td/blob/master/td/mtproto/SessionConnection.cpp">Example implementation</a>. </p>
|
||||
<h4><a class="anchor" href="#message-copies" id="message-copies" name="message-copies"><i class="anchor-icon"></i></a>Message Copies</h4>
|
||||
|
|
Loading…
Reference in a new issue