Update content of files

This commit is contained in:
GitHub Action 2022-10-26 14:23:54 +00:00
parent f26fd0bd57
commit 612b85d9aa
7 changed files with 27 additions and 24 deletions

View file

@ -44,7 +44,7 @@
<div id="dev_page_content"><!-- scroll_nav --> <div id="dev_page_content"><!-- scroll_nav -->
<p>Bots can install attachment menu entries, offering conveniently accessible, versatile <a href="/api/bots/webapps">web apps</a>.</p> <p>Bots can install attachment menu entries, offering conveniently accessible, versatile <a href="/api/bots/webapps#normal-web-apps">web apps</a>.</p>
<p>Schema:</p> <p>Schema:</p>
<pre><code><a href='/constructor/user'>user</a>#5d99adee 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> 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>&lt;<a href='/type/RestrictionReason'>RestrictionReason</a>&gt; 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> = <a href='/type/User'>User</a>; <pre><code><a href='/constructor/user'>user</a>#5d99adee 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> 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>&lt;<a href='/type/RestrictionReason'>RestrictionReason</a>&gt; 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> = <a href='/type/User'>User</a>;
@ -76,15 +76,19 @@
<a href='/method/messages.toggleBotInAttachMenu'>messages.toggleBotInAttachMenu</a>#1aee33af bot:<a href='/type/InputUser'>InputUser</a> enabled:<a href='/type/Bool'>Bool</a> = <a href='/type/Bool'>Bool</a>; <a href='/method/messages.toggleBotInAttachMenu'>messages.toggleBotInAttachMenu</a>#1aee33af bot:<a href='/type/InputUser'>InputUser</a> enabled:<a href='/type/Bool'>Bool</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/messages.getAttachMenuBots'>messages.getAttachMenuBots</a>#16fcc2cb hash:<a href='/type/long'>long</a> = <a href='/type/AttachMenuBots'>AttachMenuBots</a>;</code></pre> <a href='/method/messages.getAttachMenuBots'>messages.getAttachMenuBots</a>#16fcc2cb hash:<a href='/type/long'>long</a> = <a href='/type/AttachMenuBots'>AttachMenuBots</a>;</code></pre>
<p>Bots that have the <code>bot_attach_menu</code> flag set offer an attachment menu entry that can be added to the attachment menu.<br> <p>Bots that have the <code>bot_attach_menu</code> flag set offer an attachment menu entry that can be added to the attachment menu. </p>
Use <a href="/method/messages.getAttachMenuBot">messages.getAttachMenuBot</a> to get info about the attachment menu entry, specifically:</p> <p>Use <a href="/method/messages.getAttachMenuBot">messages.getAttachMenuBot</a> to get info about the attachment menu entry of a given bot, specifically:</p>
<ul> <ul>
<li><a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>short_name</code> contains the short name used for the attachment menu label</li>
<li><a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>peer_types</code> indicates the dialog types supported by the attachment menu</li> <li><a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>peer_types</code> indicates the dialog types supported by the attachment menu</li>
<li><a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>icons</code> contains a list of platform-specific static icons and animations to use for the attachment menu button.</li> <li><a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>icons</code> contains a list of platform-specific static icons and animations to use for the attachment menu button.</li>
</ul> </ul>
<p>Use <a href="/method/messages.toggleBotInAttachMenu">messages.toggleBotInAttachMenu</a> to enable or disable the attachment menu.<br> <p>The installed attachment menu list can be fetched using <a href="/method/messages.getAttachMenuBots">messages.getAttachMenuBots</a>. </p>
Changes made using this method will trigger an <a href="/constructor/updateAttachMenuBots">updateAttachMenuBots</a> update in other clients, which should trigger a <a href="/method/messages.getAttachMenuBots">messages.getAttachMenuBots</a> call to fetch the full updated list of installed attachment menu entries. </p> <p>Use <a href="/method/messages.toggleBotInAttachMenu">messages.toggleBotInAttachMenu</a> to enable or disable the attachment menu of a given bot.<br>
Changes made using this method will trigger an <a href="/constructor/updateAttachMenuBots">updateAttachMenuBots</a> update in other clients, which should trigger a <a href="/method/messages.getAttachMenuBots">messages.getAttachMenuBots</a> call to fetch the full updated list of installed attachment menu entries.<br>
The attachment menu list should also be refreshed if the user changes the app's language in the settings. </p>
<p>Once an attachment menu is enabled for a certain user, the <a href="/constructor/user">user</a>.<code>attach_menu_enabled</code> flag will be set <em>for the bot</em>, and the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>inactive</code> flag will be unset. </p> <p>Once an attachment menu is enabled for a certain user, the <a href="/constructor/user">user</a>.<code>attach_menu_enabled</code> flag will be set <em>for the bot</em>, and the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>inactive</code> flag will be unset. </p>
<p>Clicking on the attachment menu entry should open the related bot <a href="/api/bots/webapps#normal-web-apps">web app</a>.</p>
<p>Attachment menus can be installed and opened through <a href="/api/links#bot-attachment-menu-links">attachment menu deep links</a>.</p></div> <p>Attachment menus can be installed and opened through <a href="/api/links#bot-attachment-menu-links">attachment menu deep links</a>.</p></div>
</div> </div>

View file

@ -52,9 +52,6 @@
<h3><a class="anchor" href="#incoming-events-client-to-web-app" id="incoming-events-client-to-web-app" name="incoming-events-client-to-web-app"><i class="anchor-icon"></i></a>Incoming events: Client to web app</h3> <h3><a class="anchor" href="#incoming-events-client-to-web-app" id="incoming-events-client-to-web-app" name="incoming-events-client-to-web-app"><i class="anchor-icon"></i></a>Incoming events: Client to web app</h3>
<p>Web apps can also <em>receive</em> events, by exposing a <code>window.Telegram.WebView.receiveEvent("event_name", params)</code> method. </p> <p>Web apps can also <em>receive</em> events, by exposing a <code>window.Telegram.WebView.receiveEvent("event_name", params)</code> method. </p>
<p>Here's the full list of events that can be <em>received</em> by a web app from the client, by calling the <code>receiveEvent</code> method. </p> <p>Here's the full list of events that can be <em>received</em> by a web app from the client, by calling the <code>receiveEvent</code> method. </p>
<h4><a class="anchor" href="#phone-requested" id="phone-requested" name="phone-requested"><i class="anchor-icon"></i></a><code>phone_requested</code></h4>
<p>Params: a JSON object containing an optional string <code>phone_number</code> field.</p>
<p>Sent in response to a <a href="/api/web-events#web-app-request-phone">web_app_request_phone</a> outgoing event, see the <a href="/api/web-events#web-app-request-phone">docs for more info »</a>. </p>
<h4><a class="anchor" href="#main-button-pressed" id="main-button-pressed" name="main-button-pressed"><i class="anchor-icon"></i></a><code>main_button_pressed</code></h4> <h4><a class="anchor" href="#main-button-pressed" id="main-button-pressed" name="main-button-pressed"><i class="anchor-icon"></i></a><code>main_button_pressed</code></h4>
<p>Params: <code>null</code></p> <p>Params: <code>null</code></p>
<p>Sent by the client when the user presses the main button, if it was <a href="/api/web-events#web-app-setup-main-button">previously configured by a <code>web_app_setup_main_button</code> event »</a>.</p> <p>Sent by the client when the user presses the main button, if it was <a href="/api/web-events#web-app-setup-main-button">previously configured by a <code>web_app_setup_main_button</code> event »</a>.</p>
@ -155,13 +152,13 @@
<p>Normal webapps work similarly to <a href="/api/bots/inline">inline bots »</a>: they send messages on behalf of the user to the chat from which the query originated.</p> <p>Normal webapps work similarly to <a href="/api/bots/inline">inline bots »</a>: they send messages on behalf of the user to the chat from which the query originated.</p>
<p>Normal webapps can be opened from:</p> <p>Normal webapps can be opened from:</p>
<ul> <ul>
<li>A <a href="/constructor/keyboardButtonWebView">keyboardButtonWebView</a> button contained in an inline keyboard identified by a <a href="/constructor/replyInlineMarkup">replyInlineMarkup</a> constructor</li> <li>A <a href="/constructor/keyboardButtonWebView">keyboardButtonWebView</a> button contained in an inline keyboard identified by a <a href="/constructor/replyInlineMarkup">replyInlineMarkup</a> constructor: in this case, <a href="/constructor/keyboardButtonWebView">keyboardButtonWebView</a>.<code>url</code> must be passed to <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>url</code>.</li>
<li>A <a href="/constructor/botMenuButton">botMenuButton</a> <a href="/api/bots/menu">menu button »</a> (in this case the <a href="/method/messages.requestSimpleWebView">messages.requestWebView</a>.<code>from_bot_menu</code> flag should be set)</li> <li>A <a href="/constructor/botMenuButton">botMenuButton</a> <a href="/api/bots/menu">menu button »</a>: in this case, the <a href="/method/messages.requestWebView">messages.requestWebView</a>.<code>from_bot_menu</code> flag should be set.</li>
<li>An <a href="/api/bots/attach">attachment menu »</a></li> <li>An <a href="/api/bots/attach">attachment menu »</a></li>
</ul> </ul>
<p>To open them, clients should call <a href="/method/messages.requestSimpleWebView">messages.requestWebView</a>, and then open a webview using the <code>url</code> contained in the returned <a href="/constructor/webViewResultUrl">webViewResultUrl</a>. </p> <p>To open them, clients should call <a href="/method/messages.requestWebView">messages.requestWebView</a>, and then open a webview using the <code>url</code> contained in the returned <a href="/constructor/webViewResultUrl">webViewResultUrl</a>. </p>
<p>After loading the webview, until it is closed by a <a href="/api/web-events#web-app-close">web_app_close event</a>, the user client must invoke <a href="/method/messages.prolongWebView">messages.prolongWebView</a> every 60 seconds. </p> <p>After loading the webview, until it is closed by a <a href="/api/web-events#web-app-close">web_app_close event</a>, the user client must invoke <a href="/method/messages.prolongWebView">messages.prolongWebView</a> every 60 seconds. </p>
<p>The opened URL's fragment parameters already contain basic information about the user and a <code>query_id</code> parameter, that is exposed by the <a href="/bots/webapps">bot web apps JS library</a>: this <code>query_id</code> can then be used <strong>by the bot</strong> to invoke <a href="/method/messages.sendWebViewResultMessage">messages.sendWebViewResultMessage</a>, passing an <a href="/type/InputBotInlineResult">InputBotInlineResult</a> constructor that will automatically send a message with optionally attached media, and even inline buttons on behalf of the user. </p></div> <p>The opened URL's fragment parameters already contain basic information about the user and a <code>query_id</code> parameter, that is exposed by the <a href="/bots/webapps">bot web apps JS library</a>: this <code>query_id</code> can then be used <strong>by the bot</strong> to invoke <a href="/method/messages.sendWebViewResultMessage">messages.sendWebViewResultMessage</a>, passing an <a href="/type/InputBotInlineResult">InputBotInlineResult</a> constructor that will automatically send a message with optionally attached media, and even inline buttons on behalf of the user.</p></div>
</div> </div>

View file

@ -982,7 +982,15 @@ For all link types, clients should:</p>
<ul> <ul>
<li>Check that the associated bot username has an associated <a href="/api/bots/attach">attachment menu</a>.</li> <li>Check that the associated bot username has an associated <a href="/api/bots/attach">attachment menu</a>.</li>
<li>If not installed, ask the user to <a href="/api/bots/attach">install the attachment menu</a>.</li> <li>If not installed, ask the user to <a href="/api/bots/attach">install the attachment menu</a>.</li>
<li>Once installed, check that the attachment menu can be opened in the chosen chat type by checking the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>peer_types</code> field.</li> <li>Check that the attachment menu can be opened in the chosen chat type by checking the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>peer_types</code> field.<ul>
<li>If the chosen chat is supported, open the attachment menu <a href="/api/bots/webapps#normal-web-apps">web app »</a></li>
<li>Otherwise:<ul>
<li>If the user has just installed the attachment menu @ step 2, notify the user that the attachment menu was installed successfully.</li>
<li>Otherwise, notify the user that the attachment menu webapp can't be opened in the specified chat.</li>
</ul>
</li>
</ul>
</li>
</ul> </ul>
<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> <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>Installs and opens an attachment menu web app in the currently open chat. </p> <p>Installs and opens an attachment menu web app in the currently open chat. </p>
@ -1089,7 +1097,7 @@ tg://resolve?domain=&lt;bot_username&gt;&amp;startattach=&lt;start_parameter&gt;
<tr> <tr>
<td><code>choose</code></td> <td><code>choose</code></td>
<td style="text-align: center;">Optional</td> <td style="text-align: center;">Optional</td>
<td>A combination of <code>users</code>, <code>bots</code>, <code>groups</code>, <code>channels</code> separated by <code>+</code>: indicates the dialog types to show in the dialog selection popup</td> <td>A combination of <code>users</code>, <code>bots</code>, <code>groups</code>, <code>channels</code> separated by <code>+</code>: indicates the dialog types to show in the dialog selection popup: must be intersected with the dialog types contained in the <a href="/constructor/attachMenuBot">attachMenuBot</a>.<code>peer_types</code> field before use.</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -64,13 +64,6 @@ The GamingCommunication and bot web apps libraries by default will use <code>'*'
<h4><a class="anchor" href="#web-app-close" id="web-app-close" name="web-app-close"><i class="anchor-icon"></i></a><code>web_app_close</code></h4> <h4><a class="anchor" href="#web-app-close" id="web-app-close" name="web-app-close"><i class="anchor-icon"></i></a><code>web_app_close</code></h4>
<p>No event payload. </p> <p>No event payload. </p>
<p>Emitted by <a href="/api/bots/webapps">bot web apps</a> when the web app webview should be closed.</p> <p>Emitted by <a href="/api/bots/webapps">bot web apps</a> when the web app webview should be closed.</p>
<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>No event payload. </p>
<p>Emitted by <a href="/api/bots/webapps">bot web apps</a> when they request the user's phone number: Telegram clients should show a prompt to the user, asking to share the phone number.</p>
<ul>
<li>If the user refuses, call <code>window.Telegram.WebView.receiveEvent("phone_requested", {})</code></li>
<li>If the user accepts, call <code>window.Telegram.WebView.receiveEvent("phone_requested", {"phone_number": "Phone number"})</code></li>
</ul>
<h4><a class="anchor" href="#web-app-open-popup" id="web-app-open-popup" name="web-app-open-popup"><i class="anchor-icon"></i></a><code>web_app_open_popup</code></h4> <h4><a class="anchor" href="#web-app-open-popup" id="web-app-open-popup" name="web-app-open-popup"><i class="anchor-icon"></i></a><code>web_app_open_popup</code></h4>
<p>Event data: a JSON object with the following fields (which should be properly validated by the client).</p> <p>Event data: a JSON object with the following fields (which should be properly validated by the client).</p>
<ul> <ul>

View file

@ -42,7 +42,7 @@
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/attachMenuPeerTypeBotPM" >attachMenuPeerTypeBotPM</a></li></ul></div> <div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/attachMenuPeerTypeBotPM" >attachMenuPeerTypeBotPM</a></li></ul></div>
<h1 id="dev_page_title">attachMenuPeerTypeBotPM</h1> <h1 id="dev_page_title">attachMenuPeerTypeBotPM</h1>
<div id="dev_page_content"><p>The bot attachment menu entry is available in private chats with other bots</p> <div id="dev_page_content"><p>The bot attachment menu entry is available in private chats with other bots (excluding the bot that offers the current attachment menu)</p>
<p><div class="clearfix"> <p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills"> <ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown"> <li class="dropdown">

View file

@ -42,7 +42,7 @@
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/attachMenuPeerTypePM" >attachMenuPeerTypePM</a></li></ul></div> <div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/attachMenuPeerTypePM" >attachMenuPeerTypePM</a></li></ul></div>
<h1 id="dev_page_title">attachMenuPeerTypePM</h1> <h1 id="dev_page_title">attachMenuPeerTypePM</h1>
<div id="dev_page_content"><p>The bot attachment menu entry is available in private chats with other users</p> <div id="dev_page_content"><p>The bot attachment menu entry is available in private chats with other users (not bots)</p>
<p><div class="clearfix"> <p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills"> <ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown"> <li class="dropdown">

View file

@ -42,7 +42,8 @@
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/methods" >All Methods</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/method/messages.prolongWebView" >messages.prolongWebView</a></li></ul></div> <div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/methods" >All Methods</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/method/messages.prolongWebView" >messages.prolongWebView</a></li></ul></div>
<h1 id="dev_page_title">messages.prolongWebView</h1> <h1 id="dev_page_title">messages.prolongWebView</h1>
<div id="dev_page_content"><p>Indicate to the server (from the user side) that the user is still using a web app.</p> <div id="dev_page_content"><p>Indicate to the server (from the user side) that the user is still using a web app. </p>
<p>If the method returns a <code>QUERY_ID_INVALID</code> error, the webview must be closed.</p>
<p><div class="clearfix"> <p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills"> <ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown"> <li class="dropdown">