OwnedGift

class telegram.OwnedGift(type, *, api_kwargs=None)[source]

Bases: telegram.TelegramObject

This object describes a gift received and owned by a user or a chat. Currently, it can be one of:

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

Added in version 22.1.

Parameters:

type (str) – Type of the owned gift.

type[source]

Type of the owned gift.

Type:

str

REGULAR = 'regular'[source]

telegram.constants.OwnedGiftType.REGULAR

UNIQUE = 'unique'[source]

telegram.constants.OwnedGiftType.UNIQUE

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

Converts JSON data to the appropriate OwnedGift object, i.e. takes care of selecting the correct subclass.

Parameters:
  • data (dict[str, …]) – The JSON data.

  • bot (telegram.Bot, optional) – The bot associated with this object.

Returns:

The Telegram object.