mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-11-29 11:43:05 +01:00
Update content of files
This commit is contained in:
parent
bab7966991
commit
45a94183d8
2 changed files with 45 additions and 26 deletions
|
@ -73,46 +73,48 @@
|
|||
<p>Both <a href="#simple-web-apps">simple</a> and <a href="#normal-web-apps">normal</a> can <em>send</em> <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 the full list of events that can be <em>sent</em> by the web app to the client »</a>. </p>
|
||||
<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>Here's the full list of events that can be <em>received</em> by a web app from the client. </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>
|
||||
<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>
|
||||
<h4><a class="anchor" href="#settings-button-pressed" id="settings-button-pressed" name="settings-button-pressed"><i class="anchor-icon"></i></a><code>settings_button_pressed</code></h4>
|
||||
<p>Params: <code>null</code></p>
|
||||
<p>Sent by the client when the user presses the settings button, if it was previously enabled in BotFather. </p>
|
||||
<h4><a class="anchor" href="#back-button-pressed" id="back-button-pressed" name="back-button-pressed"><i class="anchor-icon"></i></a><code>back_button_pressed</code></h4>
|
||||
<p>Params: <code>null</code></p>
|
||||
<p>Sent by the client when the user presses the back button, if it was <a href="/api/web-events#web_app_setup_back_button">previously enabled by a <code>web_app_setup_back_button</code> event</a></p>
|
||||
<p>Sent by the client when the user presses the back button, if it was <a href="/api/web-events#web_app_setup_back_button">previously enabled by a <code>web_app_setup_back_button</code> event</a>.</p>
|
||||
<h4><a class="anchor" href="#invoice-closed" id="invoice-closed" name="invoice-closed"><i class="anchor-icon"></i></a><code>invoice_closed</code></h4>
|
||||
<p>Params: JSON object with the following fields:</p>
|
||||
<ul>
|
||||
<li><code>slug</code> - Invoice slug</li>
|
||||
<li><code>status</code> - </li>
|
||||
</ul>
|
||||
<h4><a class="anchor" href="#settings-button-pressed" id="settings-button-pressed" name="settings-button-pressed"><i class="anchor-icon"></i></a><code>settings_button_pressed</code></h4>
|
||||
<p>Params: <code>null</code></p>
|
||||
<p>Sent by the client when the user presses the settings button, if it was previously enabled in BotFather. </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>
|
||||
<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>
|
||||
<h4><a class="anchor" href="#viewport-changed" id="viewport-changed" name="viewport-changed"><i class="anchor-icon"></i></a><code>viewport_changed</code></h4>
|
||||
<p>Params: a JSON object with the following fields:</p>
|
||||
<ul>
|
||||
<li><code>height</code> -</li>
|
||||
<li><code>is_state_stable</code> -</li>
|
||||
<li><code>is_expanded</code> - </li>
|
||||
<li><code>height</code> - The current height of the visible area of the Web App</li>
|
||||
<li><code>is_state_stable</code> - The height of the visible area of the Web App in its last stable state</li>
|
||||
<li><code>is_expanded</code> - Whether the Web App is expanded to its maximum height</li>
|
||||
</ul>
|
||||
<p>Emitted when the viewport is changed. </p>
|
||||
<h4><a class="anchor" href="#theme-changed" id="theme-changed" name="theme-changed"><i class="anchor-icon"></i></a><code>theme_changed</code></h4>
|
||||
<p>Params: a JSON object with the following fields:</p>
|
||||
<ul>
|
||||
<li><code>theme_params</code>: a JSON object with the following fields:<ul>
|
||||
<li><code>bg_color</code> -</li>
|
||||
<li><code>secondary_bg_color</code> -</li>
|
||||
<li><code>text_color</code> - </li>
|
||||
<li><code>hint_color</code> - </li>
|
||||
<li><code>link_color</code> - </li>
|
||||
<li><code>button_color</code> - </li>
|
||||
<li><code>button_text_color</code> - </li>
|
||||
<li><code>bg_color</code> - Background color in hex RGB format (string)</li>
|
||||
<li><code>secondary_bg_color</code> - Secondary background color in hex RGB format (string)</li>
|
||||
<li><code>text_color</code> - Text color in hex RGB format (string)</li>
|
||||
<li><code>hint_color</code> - Hint color in hex RGB format (string)</li>
|
||||
<li><code>link_color</code> - Link color in hex RGB format (string)</li>
|
||||
<li><code>button_color</code> - Button color in hex RGB format (string)</li>
|
||||
<li><code>button_text_color</code> - Button text color in hex RGB format (string)</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Emitted when requested by the web app using a <a href="/api/web-events#web_app_request_theme"><code>web_app_request_theme</code> event</a>, or when the app theme changes. </p>
|
||||
<h4><a class="anchor" href="#popup-closed" id="popup-closed" name="popup-closed"><i class="anchor-icon"></i></a><code>popup_closed</code></h4>
|
||||
<p>Params: a JSON object with an optional <code>button_id</code> string field.</p>
|
||||
<p>Emitted when the user presses a button or cancels a popup brought up by a previous <a href="/api/web-events#web_app_open_popup"><code>web_app_open_popup</code> event</a>. </p>
|
||||
|
|
|
@ -139,25 +139,42 @@ The GamingCommunication and bot web app libraries by default will use <code>'*'<
|
|||
<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>
|
||||
<p>Event data: a JSON object with an <code>is_visible</code> boolean field.</p>
|
||||
<p>Determines whether to show or hide the back button. </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</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>
|
||||
<p>Expands the web app to the maximum available height.</p>
|
||||
<h4><a class="anchor" href="#web-app-request-viewport" id="web-app-request-viewport" name="web-app-request-viewport"><i class="anchor-icon"></i></a><code>web_app_request_viewport</code></h4>
|
||||
<p>No event payload.</p>
|
||||
<p>Used by web apps to request information about the viewport, clients should call <code>window.Telegram.WebView.receiveEvent("viewport_changed", {})</code></p>
|
||||
<p>Used by web apps to request information about the viewport, clients should emit a <a href="/bots/api/webapps#viewport_changed">viewport_changed event</a></p>
|
||||
<h4><a class="anchor" href="#web-app-request-theme" id="web-app-request-theme" name="web-app-request-theme"><i class="anchor-icon"></i></a><code>web_app_request_theme</code></h4>
|
||||
<p>No event payload.</p>
|
||||
<p>Used by web apps to request information about the current theme, clients should emit a <a href="/bots/api/webapps#theme_changed">theme_changed event</a>.</p>
|
||||
<h4><a class="anchor" href="#web-app-ready" id="web-app-ready" name="web-app-ready"><i class="anchor-icon"></i></a><code>web_app_ready</code></h4>
|
||||
<p>No event payload.</p>
|
||||
<p>Emitted by web apps when they are fully loaded.</p>
|
||||
<h4><a class="anchor" href="#web-app-setup-main-button" id="web-app-setup-main-button" name="web-app-setup-main-button"><i class="anchor-icon"></i></a><code>web_app_setup_main_button</code></h4>
|
||||
<p>Event payload: JSON object with the following fields:</p>
|
||||
<ul>
|
||||
<li><code>is_visible</code> - Whether the main button is visible (boolean)</li>
|
||||
<li><code>is_active</code> - Whether the main button is active (boolean)</li>
|
||||
<li><code>text</code> - Button text (string)</li>
|
||||
<li><code>color</code> - Button color in hex RGB format (string)</li>
|
||||
<li><code>text_color</code> - Button text color in hex RGB format (string)</li>
|
||||
<li><code>is_progress_visible</code> - Indicates whether the button should display a loading indicator (boolean)</li>
|
||||
</ul>
|
||||
<p>Configures the main button: when the user presses it a <a href="/api/bots/webapps#main_button_pressed"><code>main_button_pressed</code> event should be emitted by the client</a>. </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>
|
||||
<p>Event data: a JSON object with an <code>is_visible</code> boolean field.</p>
|
||||
<p>Determines whether to show or hide the back button: when the user presses it a <a href="/api/bots/webapps#back_button_pressed"><code>back_button_pressed</code> event should be emitted by the client</a>. </p>
|
||||
<h4><a class="anchor" href="#payment-form-submit" id="payment-form-submit" name="payment-form-submit"><i class="anchor-icon"></i></a><code>payment_form_submit</code></h4>
|
||||
<p>Event payload: JSON object with <code>credentials</code> and <code>title</code> fields.</p>
|
||||
<p><code>title</code> is the censored credit card title.<br>
|
||||
<code>credentials</code> is a service-specific JSON object with information about the payment credentials provided by the user to the payment system.<br>
|
||||
<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. </p>
|
||||
<ul>
|
||||
<li><code>title</code> is the censored credit card title. </li>
|
||||
<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>
|
||||
<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 his score.<br>
|
||||
|
|
Loading…
Reference in a new issue