From 612b85d9aae898e9ecc269af48084a8108e7f240 Mon Sep 17 00:00:00 2001
From: GitHub Action 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: Bots that have the Bots that have the 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. 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. Once an attachment menu is enabled for a certain user, the user. 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. Web apps can also receive events, by exposing a Here's the full list of events that can be received by a web app from the client, by calling the Params: a JSON object containing an optional string Sent in response to a web_app_request_phone outgoing event, see the docs for more info ». Params: Sent by the client when the user presses the main button, if it was previously configured by a 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 To open them, clients should call messages.requestWebView, and then open a webview using the 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 The opened URL's fragment parameters already contain basic information about the user and a
-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;
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:bot_attach_menu
flag set offer an attachment menu entry that can be added to the attachment menu.
+
-short_name
contains the short name used for the attachment menu labelpeer_types
indicates the dialog types supported by the attachment menuicons
contains a list of platform-specific static icons and animations to use for the attachment menu button.
-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.
+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. attach_menu_enabled
flag will be set for the bot, and the attachMenuBot.inactive
flag will be unset. Incoming events: Client to web app
window.Telegram.WebView.receiveEvent("event_name", params)
method. receiveEvent
method.
-phone_requested
phone_number
field.main_button_pressed
null
web_app_setup_main_button
event ».
-
-from_bot_menu
flag should be set)url
must be passed to messages.requestWebView.url
.from_bot_menu
flag should be set.url
contained in the returned webViewResultUrl. url
contained in the returned webViewResultUrl. 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. 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.
peer_types
field.peer_types
field.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
users
, bots
, groups
, channels
separated by +
: indicates the dialog types to show in the dialog selection popupusers
, 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.'*'
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.
-
-- If the user refuses, call
window.Telegram.WebView.receiveEvent("phone_requested", {})
-- If the user accepts, call
window.Telegram.WebView.receiveEvent("phone_requested", {"phone_number": "Phone number"})
-
web_app_open_popup
Event data: a JSON object with the following fields (which should be properly validated by the client).
diff --git a/data/web/corefork.telegram.org/constructor/attachMenuPeerTypeBotPM.html b/data/web/corefork.telegram.org/constructor/attachMenuPeerTypeBotPM.html
index 67794c1482..32411f77b5 100644
--- a/data/web/corefork.telegram.org/constructor/attachMenuPeerTypeBotPM.html
+++ b/data/web/corefork.telegram.org/constructor/attachMenuPeerTypeBotPM.html
@@ -42,7 +42,7 @@
attachMenuPeerTypeBotPM
- The bot attachment menu entry is available in private chats with other bots
+ The bot attachment menu entry is available in private chats with other bots (excluding the bot that offers the current attachment menu)
-
diff --git a/data/web/corefork.telegram.org/constructor/attachMenuPeerTypePM.html b/data/web/corefork.telegram.org/constructor/attachMenuPeerTypePM.html
index 011662a60a..2009545a13 100644
--- a/data/web/corefork.telegram.org/constructor/attachMenuPeerTypePM.html
+++ b/data/web/corefork.telegram.org/constructor/attachMenuPeerTypePM.html
@@ -42,7 +42,7 @@
attachMenuPeerTypePM
- The bot attachment menu entry is available in private chats with other users
+ The bot attachment menu entry is available in private chats with other users (not bots)
-
diff --git a/data/web/corefork.telegram.org/method/messages.prolongWebView b/data/web/corefork.telegram.org/method/messages.prolongWebView
index 7102222c39..ca3da9b104 100644
--- a/data/web/corefork.telegram.org/method/messages.prolongWebView
+++ b/data/web/corefork.telegram.org/method/messages.prolongWebView
@@ -42,7 +42,8 @@
messages.prolongWebView
- Indicate to the server (from the user side) that the user is still using a web app.
+ Indicate to the server (from the user side) that the user is still using a web app.
+If the method returns a QUERY_ID_INVALID
error, the webview must be closed.
-