From 612b85d9aae898e9ecc269af48084a8108e7f240 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 26 Oct 2022 14:23:54 +0000 Subject: [PATCH] Update content of files --- .../web/corefork.telegram.org/api/bots/attach.html | 14 +++++++++----- .../corefork.telegram.org/api/bots/webapps.html | 11 ++++------- data/web/corefork.telegram.org/api/links.html | 12 ++++++++++-- data/web/corefork.telegram.org/api/web-events.html | 7 ------- .../constructor/attachMenuPeerTypeBotPM.html | 2 +- .../constructor/attachMenuPeerTypePM.html | 2 +- .../method/messages.prolongWebView | 3 ++- 7 files changed, 27 insertions(+), 24 deletions(-) diff --git a/data/web/corefork.telegram.org/api/bots/attach.html b/data/web/corefork.telegram.org/api/bots/attach.html index 95e400c784..3d11b5d7e4 100644 --- a/data/web/corefork.telegram.org/api/bots/attach.html +++ b/data/web/corefork.telegram.org/api/bots/attach.html @@ -44,7 +44,7 @@
-

Bots can install attachment menu entries, offering conveniently accessible, versatile web apps.

+

Bots can install attachment menu entries, offering conveniently accessible, versatile web apps.

Schema:

user#5d99adee flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus = User;
 
@@ -76,15 +76,19 @@
 messages.toggleBotInAttachMenu#1aee33af bot:InputUser enabled:Bool = Bool;
 
 messages.getAttachMenuBots#16fcc2cb hash:long = AttachMenuBots;
-

Bots that have the bot_attach_menu flag set offer an attachment menu entry that can be added to the attachment menu.
-Use messages.getAttachMenuBot to get info about the attachment menu entry, specifically:

+

Bots that have the bot_attach_menu flag set offer an attachment menu entry that can be added to the attachment menu.

+

Use messages.getAttachMenuBot to get info about the attachment menu entry of a given bot, specifically:

-

Use messages.toggleBotInAttachMenu to enable or disable the attachment menu.
-Changes made using this method will trigger an updateAttachMenuBots update in other clients, which should trigger a messages.getAttachMenuBots call to fetch the full updated list of installed attachment menu entries.

+

The installed attachment menu list can be fetched using messages.getAttachMenuBots.

+

Use messages.toggleBotInAttachMenu to enable or disable the attachment menu of a given bot.
+Changes made using this method will trigger an updateAttachMenuBots update in other clients, which should trigger a messages.getAttachMenuBots call to fetch the full updated list of installed attachment menu entries.
+The attachment menu list should also be refreshed if the user changes the app's language in the settings.

Once an attachment menu is enabled for a certain user, the user.attach_menu_enabled flag will be set for the bot, and the attachMenuBot.inactive flag will be unset.

+

Clicking on the attachment menu entry should open the related bot web app.

Attachment menus can be installed and opened through attachment menu deep links.

diff --git a/data/web/corefork.telegram.org/api/bots/webapps.html b/data/web/corefork.telegram.org/api/bots/webapps.html index d1111a4d60..c949587d3a 100644 --- a/data/web/corefork.telegram.org/api/bots/webapps.html +++ b/data/web/corefork.telegram.org/api/bots/webapps.html @@ -52,9 +52,6 @@

Incoming events: Client to web app

Web apps can also receive events, by exposing a window.Telegram.WebView.receiveEvent("event_name", params) method.

Here's the full list of events that can be received by a web app from the client, by calling the receiveEvent method.

-

phone_requested

-

Params: a JSON object containing an optional string phone_number field.

-

Sent in response to a web_app_request_phone outgoing event, see the docs for more info ».

main_button_pressed

Params: null

Sent by the client when the user presses the main button, if it was previously configured by a web_app_setup_main_button event ».

@@ -155,13 +152,13 @@

Normal webapps work similarly to inline bots »: they send messages on behalf of the user to the chat from which the query originated.

Normal webapps can be opened from:

-

To open them, clients should call messages.requestWebView, and then open a webview using the url contained in the returned webViewResultUrl.

+

To open them, clients should call messages.requestWebView, and then open a webview using the url contained in the returned webViewResultUrl.

After loading the webview, until it is closed by a web_app_close event, the user client must invoke messages.prolongWebView every 60 seconds.

-

The opened URL's fragment parameters already contain basic information about the user and a query_id parameter, that is exposed by the bot web apps JS library: this query_id can then be used by the bot to invoke messages.sendWebViewResultMessage, passing an InputBotInlineResult constructor that will automatically send a message with optionally attached media, and even inline buttons on behalf of the user.

+

The opened URL's fragment parameters already contain basic information about the user and a query_id parameter, that is exposed by the bot web apps JS library: this query_id can then be used by the bot to invoke messages.sendWebViewResultMessage, passing an InputBotInlineResult constructor that will automatically send a message with optionally attached media, and even inline buttons on behalf of the user.

diff --git a/data/web/corefork.telegram.org/api/links.html b/data/web/corefork.telegram.org/api/links.html index 9740924472..96bae3685d 100644 --- a/data/web/corefork.telegram.org/api/links.html +++ b/data/web/corefork.telegram.org/api/links.html @@ -982,7 +982,15 @@ For all link types, clients should:

Open in current chat

Installs and opens an attachment menu web app in the currently open chat.

@@ -1089,7 +1097,7 @@ tg://resolve?domain=<bot_username>&startattach=<start_parameter> choose Optional -A combination of users, bots, groups, channels separated by +: indicates the dialog types to show in the dialog selection popup +A combination of users, bots, groups, channels separated by +: indicates the dialog types to show in the dialog selection popup: must be intersected with the dialog types contained in the attachMenuBot.peer_types field before use. diff --git a/data/web/corefork.telegram.org/api/web-events.html b/data/web/corefork.telegram.org/api/web-events.html index a6dffd6aa0..7ddff37458 100644 --- a/data/web/corefork.telegram.org/api/web-events.html +++ b/data/web/corefork.telegram.org/api/web-events.html @@ -64,13 +64,6 @@ The GamingCommunication and bot web apps libraries by default will use '*'

web_app_close

No event payload.

Emitted by bot web apps when the web app webview should be closed.

-

web_app_request_phone

-

No event payload.

-

Emitted by bot web apps when they request the user's phone number: Telegram clients should show a prompt to the user, asking to share the phone number.

-

web_app_open_popup

Event data: a JSON object with the following fields (which should be properly validated by the client).