MadelineProtoDocs/old_docs/API_docs_v89/methods/messages.setBotShippingResults.md
2019-12-27 18:46:25 +01:00

2.2 KiB

title description image redirect_from
messages.setBotShippingResults If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the bot will receive an [updateBotShippingQuery](../constructors/updateBotShippingQuery.md) update. Use this method to reply to shipping queries. https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png /API_docs/methods/messages_setBotShippingResults.html

Method: messages.setBotShippingResults

Back to methods index

If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the bot will receive an updateBotShippingQuery update. Use this method to reply to shipping queries.

Parameters:

Name Type Description Required
query_id long Unique identifier for the query to be answered Yes
error string Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user. Optional
shipping_options Array of ShippingOption Shipping options Optional

Return type: Bool

Can bots use this method: YES

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

$Bool = $MadelineProto->messages->setBotShippingResults(['query_id' => long, 'error' => 'string', 'shipping_options' => [ShippingOption, ShippingOption], ]);

Or, if you're into Lua:

Bool = messages.setBotShippingResults({query_id=long, error='string', shipping_options={ShippingOption}, })

Errors

Code Type Description
400 QUERY_ID_INVALID The query ID is invalid