MadelineProtoDocs/docs/API_docs/methods/messages.sendWebViewData.md
2024-05-01 14:53:46 +02:00

1.8 KiB

title description grand_parent parent image redirect_from
messages.sendWebViewData Used by the user to relay data from an opened [reply keyboard bot mini app](https://core.telegram.org/api/bots/webapps) to the bot that owns it. Telegram RPC API Methods https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png /API_docs/methods/messages_sendWebViewData.html

Method: messages.sendWebViewData

Back to methods index

Used by the user to relay data from an opened reply keyboard bot mini app to the bot that owns it.

Parameters:

Name Type Description Required
bot Username, chat ID, Update, Message or InputUser Bot that owns the web app Optional
button_text string Text of the keyboardButtonSimpleWebView that was pressed to open the web app. Optional
data string Data to relay to the bot, obtained from a web_app_data_send JS event. Optional

Return type: Updates

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();

$Updates = $MadelineProto->messages->sendWebViewData(bot: $InputUser, button_text: 'string', data: 'string', );