ChosenInlineResult

class telegram.ChosenInlineResult(result_id, from_user, query, location=None, inline_message_id=None, *, api_kwargs=None)[source]

Bases: telegram.TelegramObject

Represents a result of an inline query that was chosen by the user and sent to their chat partner.

Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their result_id is equal.

Note

  • In Python from is a reserved word. Use from_user instead.

  • It is necessary to enable inline feedback via @Botfather in order to receive these objects in updates.

Parameters:
  • result_id (str) – The unique identifier for the result that was chosen.

  • from_user (telegram.User) – The user that chose the result.

  • location (telegram.Location, optional) – Sender location, only for bots that require user location.

  • inline_message_id (str, optional) – Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message.

  • query (str) – The query that was used to obtain the result.

result_id[source]

The unique identifier for the result that was chosen.

Type:

str

from_user[source]

The user that chose the result.

Type:

telegram.User

location[source]

Optional. Sender location, only for bots that require user location.

Type:

telegram.Location

inline_message_id[source]

Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message.

Type:

str

query[source]

The query that was used to obtain the result.

Type:

str

classmethod de_json(data, bot=None)[source]

See telegram.TelegramObject.de_json().