Update content of files

This commit is contained in:
GitHub Action 2022-08-25 19:25:02 +00:00
parent d9a7176dfe
commit 8048fe8936
2 changed files with 58 additions and 7 deletions
data/web/corefork.telegram.org/api

View file

@ -70,7 +70,7 @@
<a href='/method/messages.sendWebViewResultMessage'>messages.sendWebViewResultMessage</a>#a4314f5 bot_query_id:<a href='/type/string'>string</a> result:<a href='/type/InputBotInlineResult'>InputBotInlineResult</a> = <a href='/type/WebViewMessageSent'>WebViewMessageSent</a>;
<a href='/method/messages.sendWebViewData'>messages.sendWebViewData</a>#dc0242c8 bot:<a href='/type/InputUser'>InputUser</a> random_id:<a href='/type/long'>long</a> button_text:<a href='/type/string'>string</a> data:<a href='/type/string'>string</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<h3><a class="anchor" href="#web-events" id="web-events" name="web-events"><i class="anchor-icon"></i></a>Web events</h3>
<p>Both <a href="#simple-web-apps">simple</a> and <a href="#normal-web-apps">normal</a> should handle <a href="/api/web-events">web events</a> starting with <code>web_app_</code>; see the <a href="/api/web-events">web event documentation for more info »</a>.</p>
<p>Both <a href="#simple-web-apps">simple</a> and <a href="#normal-web-apps">normal</a> should handle <a href="/api/web-events">web events</a> starting with <code>web_app_</code>; see the <a href="/api/web-events">web event documentation for more info »</a>. </p>
<h3><a class="anchor" href="#simple-web-apps" id="simple-web-apps" name="simple-web-apps"><i class="anchor-icon"></i></a>Simple web apps</h3>
<p>Schema:</p>
<pre><code><a href='/constructor/replyKeyboardMarkup'>replyKeyboardMarkup</a>#85dd99d1 flags:<a href='/type/%23'>#</a> resize:flags.0?<a href='/constructor/true'>true</a> single_use:flags.1?<a href='/constructor/true'>true</a> selective:flags.2?<a href='/constructor/true'>true</a> rows:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/KeyboardButtonRow'>KeyboardButtonRow</a>&gt; placeholder:flags.3?<a href='/type/string'>string</a> = <a href='/type/ReplyMarkup'>ReplyMarkup</a>;

View file

@ -72,23 +72,73 @@ The GamingCommunication and bot web app libraries by default will use <code>'*'<
<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>
<p>Event data: JSON object with the following fields:</p>
<p>Event data: a JSON object with the following fields (which should be properly validated by the client).</p>
<ul>
<li><code>title</code> - Title for the popup (optional string)</li>
<li><code>message</code> - Message of the popup (string)</li>
<li><code>buttons</code> - An array of the following objects (optional, max 3)<ul>
<li><code>text</code> - Button title</li>
<li><code>id</code> - Button ID</li>
<li>
<p><code>title</code> - Title for the popup (optional string, max 64 characters)</p>
</li>
<li>
<p><code>message</code> - Message of the popup (string, max 256 characters)</p>
</li>
<li>
<p><code>buttons</code> - An array of the following objects (optional, max 3)</p>
<ul>
<li><code>type</code> - Button type (string, one of <code>ok</code>, <code>close</code>, <code>cancel</code>, <code>default</code>, <code>destructive</code>, used by the client to choose an appropriate button color)</li>
<li><code>text</code> - Button text (string, optional for <code>ok</code>, <code>close</code> and <code>cancel</code> types)</li>
<li><code>id</code> - Button ID (unique string)</li>
</ul>
</li>
<li>
<p>If the user presses any of the buttons, call <code>window.Telegram.WebView.receiveEvent("popup_closed", {"button_id": "&lt;button id&gt;"})</code></p>
</li>
<li>
<p>If the user cancel the interaction, call <code>window.Telegram.WebView.receiveEvent("popup_closed", {})</code></p>
</li>
</ul>
<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 app should require user confirmation before closing the webview, to avoid accidentally aborting a sensitive operation; otherwise no confirmation should be requested. </p>
<h4><a class="anchor" href="#web-app-set-background-color" id="web-app-set-background-color" name="web-app-set-background-color"><i class="anchor-icon"></i></a><code>web_app_set_background_color</code></h4>
<p>Event data: a JSON object with a string <code>color</code> with a hex RGB color. </p>
<p>Used to set the app background color. </p>
<h4><a class="anchor" href="#web-app-set-header-color" id="web-app-set-header-color" name="web-app-set-header-color"><i class="anchor-icon"></i></a><code>web_app_set_header_color</code></h4>
<p>Event data: a JSON object with a string <code>color</code> with a hex RGB color. </p>
<p>Used to set the app header 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 by <a href="/api/bots/webapps#simple-webapps">simple webapps</a> to send back data to the bot. </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>
<li><code>type</code> - One of the following values (string):<ul>
<li><code>impact</code> - An impact occurred.</li>
<li><code>notification</code> - A task or action has succeeded, failed, or produced a warning.</li>
<li><code>selection_change</code> - The user has changed a selection.</li>
</ul>
</li>
<li><code>impact_style</code> - Only for <code>impact</code> feedbacks, one of the following values (string):<ul>
<li><code>light</code> - Indicates a collision between small or lightweight UI objects</li>
<li><code>medium</code> - Indicates a collision between medium-sized or medium-weight UI objects</li>
<li><code>heavy</code> - Indicates a collision between large or heavyweight UI objects</li>
<li><code>rigid</code> - Indicates a collision between hard or inflexible UI objects</li>
<li><code>soft</code> - Indicates a collision between soft or flexible UI objects</li>
</ul>
</li>
<li><code>notification_type</code> - Only for <code>notification</code> feedbacks, one of the folowing values (string):<ul>
<li><code>error</code> - Indicates that a task or action has failed</li>
<li><code>success</code> - Indicates that a task or action has completed successfully</li>
<li><code>warning</code> - Indicates that a task or action produced a warning</li>
</ul>
</li>
</ul>
<p>Used to trigger haptic feedback for a user interaction in a webapp.</p>
<h4><a class="anchor" href="#web-app-open-link" id="web-app-open-link" name="web-app-open-link"><i class="anchor-icon"></i></a><code>web_app_open_link</code></h4>
<p>Event data: a JSON object with a string <code>url</code> field. </p>
<p>Used to open a link in an external browser. The Web App will not be closed. </p>
<p>Note that this method can be called only in response to the user interaction with the Web App interface (e.g. click inside the Web App or on the main button). </p>
<h4><a class="anchor" href="#web-app-open-tg-link" id="web-app-open-tg-link" name="web-app-open-tg-link"><i class="anchor-icon"></i></a><code>web_app_open_tg_link</code></h4>
<p>Event data: a JSON object with a string <code>path_full</code> field, containing the path+query component of a <a href="/api/links">t.me deep link</a>. </p>
<p>Used to open a <a href="/api/links">t.me deep link</a>. The Web App will be closed.</p>
<h4><a class="anchor" href="#web-app-setup-back-button" id="web-app-setup-back-button" name="web-app-setup-back-button"><i class="anchor-icon"></i></a><code>web_app_setup_back_button</code></h4>
<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>
<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>
@ -114,6 +164,7 @@ Typically done by using <a href="/method/messages.forwardMessages">messages.forw
<p>No event payload.</p>
<p>Can be called by games when the user loses a game</p>
<h4><a class="anchor" href="#game-loaded" id="game-loaded" name="game-loaded"><i class="anchor-icon"></i></a><code>game_loaded</code></h4>
<p>No event payload.</p>
<p>Can be called by games once the game fully loads.</p>
<h4><a class="anchor" href="#resize-frame" id="resize-frame" name="resize-frame"><i class="anchor-icon"></i></a><code>resize_frame</code></h4>
<p>Event payload: JSON object with <code>height</code> field</p>