Method: bots.answerWebhookJSONQuery

Back to methods index

Answers a custom query; for bots only


Name Type Description Required
query_id long Identifier of a custom query Yes
data DataJSON JSON-serialized answer to the query Yes

Return type: Bool

Can bots use this method: YES

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

if (!file_exists('madeline.php')) {
    copy('', 'madeline.php');
include 'madeline.php';

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

$Bool = $MadelineProto->bots->answerWebhookJSONQuery(['query_id' => long, 'data' => DataJSON, ]);

Or, if you’re into Lua:

Bool = bots.answerWebhookJSONQuery({query_id=long, data=DataJSON, })


Code Type Description
400 QUERY_ID_INVALID The query ID is invalid
400 USER_BOT_INVALID This method can only be called by a bot
This site uses cookies, as described in the cookie policy. By clicking on "Accept" you consent to the use of cookies.