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.
parameters
| parameter | type | required | description |
|---|---|---|---|
shipping_query_id | string | required | Unique identifier for the query to be answered |
ok | boolean | required | 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) |
shipping_options | ShippingOption[] | optional | Required if ok is True. A JSON-serialized array of available shipping options. |
error_message | string | optional | 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. |
returns
boolean
usage in yaebal
not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.
import type { AnswerShippingQueryParams } from "@yaebal/types";
await bot.api.call<boolean>("answerShippingQuery", {
shipping_query_id: "...",
ok: true,
} satisfies AnswerShippingQueryParams);context shortcut
also available as ctx.answer() on
1
context type — see @yaebal/contexts.
/** If you sent an invoice requesting a shipping address and the parameter *is\_flexible* was specified, the Bot API will send an [Update](https://core.telegram.org/bots/api/#update) with a *shipping\_query* field to the bot. Use this method to reply to shipping queries. On success, *True* is returned. */
ctx.answer(params: Omit<AnswerShippingQueryParams, "shipping_query_id">)official Bot API docs: https://core.telegram.org/bots/api/#answershippingquery