Link Search Menu Expand Document

Method: messages.sendWebViewData

Back to methods index

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

Parameters:

NameTypeDescriptionRequired
botUsername, chat ID, Update, Message or InputUserBot that owns the web appOptional
button_textstringText of the keyboardButtonSimpleWebView that was pressed to open the web app.Yes
datastringData to relay to the bot, obtained from a web_app_data_send JS event.Yes

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

// PHP 8+ syntax, use an array on PHP 7.
$Updates = $MadelineProto->messages->sendWebViewData(bot: InputUser, button_text: 'string', data: 'string', );