Module

x/grammy/mod.ts>Composer#shippingQuery

The Telegram Bot Framework.
Very Popular
Latest
method Composer.prototype.shippingQuery
import { Composer } from "https://dotland.deno.dev/x/grammy@v1.31.0/mod.ts";

Registers middleware for shipping queries. If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, Telegram will send a shipping query to your bot whenever a user has confirmed their shipping details. You bot will then receive the shipping information and can respond with a confirmation of whether delivery to the specified address is possible. Check out https://core.telegram.org/bots/api#shippingquery to read more about shipping queries.

bot.shippingQuery('invoice_payload', async ctx => {
  // Answer the shipping query, confer https://core.telegram.org/bots/api#answershippingquery
  await ctx.answerShippingQuery( ... )
})

Parameters

trigger: MaybeArray<string | RegExp>

The string to look for in the invoice payload

...middleware: Array<ShippingQueryMiddleware<C>>

The middleware to register

Returns

Composer<ShippingQueryContext<C>>