From 664b5f1559643be371ab23377e8fdc70ac81165a Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 27 Aug 2022 18:50:40 +0000 Subject: [PATCH] Update content of files --- .../api/bots/attach.html | 118 ++++++++++++++++++ .../api/bots/webapps.html | 52 ++++---- .../constructor/inlineKeyboardMarkup.html | 118 ++++++++++++++++++ .../method/messages.sendWebViewData | 2 +- 4 files changed, 266 insertions(+), 24 deletions(-) create mode 100644 data/web/corefork.telegram.org/api/bots/attach.html create mode 100644 data/web/corefork.telegram.org/constructor/inlineKeyboardMarkup.html diff --git a/data/web/corefork.telegram.org/api/bots/attach.html b/data/web/corefork.telegram.org/api/bots/attach.html new file mode 100644 index 0000000000..28eb794f3a --- /dev/null +++ b/data/web/corefork.telegram.org/api/bots/attach.html @@ -0,0 +1,118 @@ + + + + + Page not found + + + + + + + + + + + + + + + + +
+ +
+
+
+ +

Page not found

+ +
The page has not been saved
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/web/corefork.telegram.org/api/bots/webapps.html b/data/web/corefork.telegram.org/api/bots/webapps.html index 09e214413f..85aed6d618 100644 --- a/data/web/corefork.telegram.org/api/bots/webapps.html +++ b/data/web/corefork.telegram.org/api/bots/webapps.html @@ -47,28 +47,6 @@

Bots can offer users interactive HTML5 web apps to completely replace any website.

They support seamless authorization, integrated payments via multiple payment providers (with Google Pay and Apple Pay out of the box), delivering tailored push notifications to users, and much more.

This article offers a technical overview of the implementation of bot web apps using the MTProto API: see here an overview using the simplified bot API ».

-

Schema:

-
messageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction;
-messageActionWebViewDataSent#b4c38cb5 text:string = MessageAction;
-
-updateWebViewResultSent#1592b79d query_id:long = Update;
-
-keyboardButtonWebView#13767230 text:string url:string = KeyboardButton;
-keyboardButtonSimpleWebView#a0c0505c text:string url:string = KeyboardButton;
-
-webViewResultUrl#c14557c query_id:long url:string = WebViewResult;
-
-simpleWebViewResultUrl#882f76bb url:string = SimpleWebViewResult;
-
-webViewMessageSent#c94511c flags:# msg_id:flags.0?InputBotInlineMessageID = WebViewMessageSent;
-
----functions---
-
-messages.requestWebView#91b15831 flags:# from_bot_menu:flags.4?true silent:flags.5?true peer:InputPeer bot:InputUser url:flags.1?string start_param:flags.3?string theme_params:flags.2?DataJSON reply_to_msg_id:flags.0?int send_as:flags.13?InputPeer = WebViewResult;
-messages.prolongWebView#ea5fbcce flags:# silent:flags.5?true peer:InputPeer bot:InputUser query_id:long reply_to_msg_id:flags.0?int send_as:flags.13?InputPeer = Bool;
-messages.requestSimpleWebView#6abb2f73 flags:# bot:InputUser url:string theme_params:flags.0?DataJSON = SimpleWebViewResult;
-messages.sendWebViewResultMessage#a4314f5 bot_query_id:string result:InputBotInlineResult = WebViewMessageSent;
-messages.sendWebViewData#dc0242c8 bot:InputUser random_id:long button_text:string data:string = Updates;

Outgoing events: Web app to client

Both simple and normal can send web events starting with web_app_; see the web event documentation for the full list of events that can be sent by the web app to the client ».

Incoming events: Client to web app

@@ -136,7 +114,35 @@ messages.sendWebViewData#dc0242c8 bot:InputUser random_id:long button_text:string data:string = Updates;

Simple webapps can only be opened from a keyboardButtonSimpleWebView button contained in a reply keyboard identified by a replyKeyboardMarkup constructor.

To open them, users should call messages.requestSimpleWebView, and then open a webview using the url contained in the returned simpleWebViewResultUrl.

-

Normal web apps

+

Upon receiving a web_app_data_send JS event from the web app, clients should invoke messages.sendWebViewData, passing the following arguments:

+ +

This will generate a messageActionWebViewDataSent update for the user, and a messageActionWebViewDataSentMe update for the bot, containing the event data.

+

Normal web apps

+

Schema:

+
keyboardButtonWebView#13767230 text:string url:string = KeyboardButton;
+botMenuButton#c7b57ce6 text:string url:string = BotMenuButton;
+
+webViewResultUrl#c14557c query_id:long url:string = WebViewResult;
+
+updateWebViewResultSent#1592b79d query_id:long = Update;
+webViewMessageSent#c94511c flags:# msg_id:flags.0?InputBotInlineMessageID = WebViewMessageSent;
+
+---functions---
+
+messages.requestWebView#91b15831 flags:# from_bot_menu:flags.4?true silent:flags.5?true peer:InputPeer bot:InputUser url:flags.1?string start_param:flags.3?string theme_params:flags.2?DataJSON reply_to_msg_id:flags.0?int send_as:flags.13?InputPeer = WebViewResult;
+messages.prolongWebView#ea5fbcce flags:# silent:flags.5?true peer:InputPeer bot:InputUser query_id:long reply_to_msg_id:flags.0?int send_as:flags.13?InputPeer = Bool;
+messages.sendWebViewResultMessage#a4314f5 bot_query_id:string result:InputBotInlineResult = WebViewMessageSent;
+

Normal webapps can be opened from:

+ diff --git a/data/web/corefork.telegram.org/constructor/inlineKeyboardMarkup.html b/data/web/corefork.telegram.org/constructor/inlineKeyboardMarkup.html new file mode 100644 index 0000000000..6b1b40cd8e --- /dev/null +++ b/data/web/corefork.telegram.org/constructor/inlineKeyboardMarkup.html @@ -0,0 +1,118 @@ + + + + + Page not found + + + + + + + + + + + + + + + + +
+ +
+
+
+ +

Page not found

+ +
The page has not been saved
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/web/corefork.telegram.org/method/messages.sendWebViewData b/data/web/corefork.telegram.org/method/messages.sendWebViewData index 4831b290c5..5071aa897e 100644 --- a/data/web/corefork.telegram.org/method/messages.sendWebViewData +++ b/data/web/corefork.telegram.org/method/messages.sendWebViewData @@ -92,7 +92,7 @@ data string -Data to relay to the bot. +Data to relay to the bot, obtained from a web_app_data_send JS event.