answerShippingQueryПоддерживается
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
Особенности StaticGram
validates params; shipping queries never exist (Stars invoices cannot be flexible) → QUERY_ID_INVALID
Параметры
Unique identifier for the query to be answered
Pass True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)
Required if ok is True. A JSON-serialized Array of available shipping options.
Required if ok is False. 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.
Пример запроса
curl
curl "https://api.staticgram.top/bot$TOKEN/answerShippingQuery" \
-H "Content-Type: application/json" \
-d '{
"shipping_query_id": "<shipping_query_id>",
"ok": true
}'aiogram 3
from aiogram import Bot
from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.client.telegram import TelegramAPIServer
session = AiohttpSession(api=TelegramAPIServer.from_base("https://api.staticgram.top"))
bot = Bot(TOKEN, session=session)
result = await bot.answer_shipping_query(shipping_query_id="<shipping_query_id>", ok=True)JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/answerShippingQuery`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"shipping_query_id": "<shipping_query_id>",
"ok": true
}),
});
const data = await res.json();Ответ (True)
JSON
{
"ok": true,
"result": true
}