telegram.ShippingQuery

class telegram.ShippingQuery(id, from_user, invoice_payload, shipping_address, bot=None, **kwargs)

Bases: telegram.base.TelegramObject

This object contains information about an incoming shipping query.

Note

  • In Python from is a reserved word, use from_user instead.
id

str – Unique query identifier.

from_user

telegram.User – User who sent the query.

invoice_payload

str – Bot specified invoice payload.

shipping_address

telegram.ShippingAddress – User specified shipping address.

bot

telegram.Bot – Optional. The Bot to use for instance methods.

Parameters:
  • id (str) – Unique query identifier.
  • from_user (telegram.User) – User who sent the query.
  • invoice_payload (str) – Bot specified invoice payload.
  • shipping_address (telegram.ShippingAddress) – User specified shipping address.
  • bot (telegram.Bot, optional) – The Bot to use for instance methods.
  • **kwargs (dict) – Arbitrary keyword arguments.
answer(*args, **kwargs)

Shortcut for:

bot.answer_shipping_query(update.shipping_query.id, *args, **kwargs)
Parameters:
  • ok (bool) – Specify 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 (List[telegram.ShippingOption], optional) – Required if ok is True. A JSON-serialized array of available shipping options.
  • error_message (str, 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.