mirror of
https://github.com/danog/MadelineProtoDocs.git
synced 2024-11-30 04:39:42 +01:00
2.1 KiB
2.1 KiB
title | description | grand_parent | parent | image | redirect_from |
---|---|---|---|---|---|
bots.invokeWebViewCustomMethod | Send a custom request from a [mini bot app](https://core.telegram.org/api/bots/webapps), triggered by a [web app invoke custom method event »](https://core.telegram.org/api/web-events#web-app-invoke-custom-method). | Telegram RPC API | Methods | https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png | /API_docs/methods/bots_invokeWebViewCustomMethod.html |
Method: bots.invokeWebViewCustomMethod
Send a custom request from a mini bot app, triggered by a web_app_invoke_custom_method event ».
The response should be sent using a custom_method_invoked event, see here » for more info on the flow.
Parameters:
Name | Type | Description | Required |
---|---|---|---|
bot | Username, chat ID, Update, Message or InputUser | Identifier of the bot associated to the mini bot app | Optional |
custom_method | string | Identifier of the custom method to invoke | Optional |
params | DataJSON | Method parameters | Yes |
Return type: DataJSON
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();
$DataJSON = $MadelineProto->bots->invokeWebViewCustomMethod(bot: $InputUser, custom_method: 'string', params: $DataJSON, );