MadelineProtoDocs/docs/API_docs/methods/messages.requestWebView.md
2024-07-02 15:45:44 +02:00

3.7 KiB

title description grand_parent parent image redirect_from
messages.requestWebView Open a [bot mini app](https://core.telegram.org/bots/webapps), sending over user information after user confirmation. Telegram RPC API Methods https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png /API_docs/methods/messages_requestWebView.html

Method: messages.requestWebView

Back to methods index

Open a bot mini app, sending over user information after user confirmation.

After calling this method, until the user closes the webview, messages.prolongWebView must be called every 60 seconds.

Parameters:

Name Type Description Required
from_bot_menu Bool Whether the webview was opened by clicking on the bot's menu button ». Optional
silent Bool Whether the inline message that will be sent by the bot on behalf of the user once the web app interaction is terminated should be sent silently (no notifications for the receivers). Optional
compact Bool Optional
peer Username, chat ID, Update, Message or InputPeer Dialog where the web app is being opened, and where the resulting message will be sent (see the docs for more info »). Optional
bot Username, chat ID, Update, Message or InputUser Bot that owns the web app Optional
url string Web app URL Optional
start_param string If the web app was opened from the attachment menu using a attachment menu deep link, start_param should contain the data from the startattach parameter. Optional
theme_params DataJSON Theme parameters » Optional
platform string Short name of the application; 0-64 English letters, digits, and underscores Optional
reply_to InputReplyTo If set, indicates that the inline message that will be sent by the bot on behalf of the user once the web app interaction is terminated should be sent in reply to the specified message or story. Optional
send_as Username, chat ID, Update, Message or InputPeer Open the web app as the specified peer, sending the resulting the message as the specified peer. Optional

Return type: WebViewResult

Can bots use this method: NO

MadelineProto Example (now async for huge speed and parallelism!):

if (!file_exists('madeline.php')) {
    copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();

$WebViewResult = $MadelineProto->messages->requestWebView(from_bot_menu: $Bool, silent: $Bool, compact: $Bool, peer: $InputPeer, bot: $InputUser, url: 'string', start_param: 'string', theme_params: $DataJSON, platform: 'string', reply_to: $InputReplyTo, send_as: $InputPeer, );