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

2.6 KiB

title description grand_parent parent image redirect_from
messages.requestSimpleWebView Open a [bot mini app](https://core.telegram.org/api/bots/webapps). Telegram RPC API Methods https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png /API_docs/methods/messages_requestSimpleWebView.html

Method: messages.requestSimpleWebView

Back to methods index

Open a bot mini app.

Parameters:

Name Type Description Required
from_switch_webview Bool Whether the webapp was opened by clicking on the switch_webview button shown on top of the inline results list returned by messages.getInlineBotResults. Optional
from_side_menu Bool Set this flag if opening the Mini App from the installed side menu entry » or from a Mini App link ». Optional
compact Bool Optional
bot Username, chat ID, Update, Message or InputUser Bot that owns the mini app Optional
url string Web app URL, if opening from a keyboard button or inline result Optional
start_param string Start parameter, if opening from a Mini App link ». Optional
theme_params DataJSON Theme parameters » Optional
platform string Short name of the application; 0-64 English letters, digits, and underscores 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->requestSimpleWebView(from_switch_webview: $Bool, from_side_menu: $Bool, compact: $Bool, bot: $InputUser, url: 'string', start_param: 'string', theme_params: $DataJSON, platform: 'string', );