Skip to content
Back to top
View this page

# OwnedGiftUnique

class telegram.OwnedGiftUnique(gift, send_date, owned_gift_id=None, sender_user=None, is_saved=None, can_be_transferred=None, transfer_star_count=None, next_transfer_date=None, *, api_kwargs=None)

  Bases: `telegram.OwnedGift`

  Describes a unique gift received and owned by a user or a chat.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `gift` and `send_date` are equal.

  Available In

  `telegram.OwnedGifts.gifts`

  Added in version 22.1.

  Parameters:

    - gift (`telegram.UniqueGift`) – Information about the unique gift.

    - owned_gift_id (`str`, optional) – Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only.

    - sender_user (`telegram.User`, optional) – Sender of the gift if it is a known user.

    - send_date (`datetime.datetime`) – Date the gift was sent as `datetime.datetime`. The default timezone of the bot is used for localization, which is UTC unless `telegram.ext.Defaults.tzinfo` is used.

    - is_saved (`bool`, optional) – `True`, if the gift is displayed on the account’s profile page; for gifts received on behalf of business accounts only.

    - can_be_transferred (`bool`, optional) – `True`, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only.

    - transfer_star_count (`int`, optional) – Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift.

    - next_transfer_date (`datetime.datetime`, optional) – Date when the gift can be transferred. If it’s in the past, then the gift can be transferred now. The default timezone of the bot is used for localization, which is UTC unless `telegram.ext.Defaults.tzinfo` is used. .. versionadded:: 22.3

  type

    Type of the owned gift, always `'unique'`.

    Type:

      `str`

  gift

    Information about the unique gift.

    Type:

      `telegram.UniqueGift`

  owned_gift_id

    Optional. Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only.

    Type:

      `str`

  sender_user

    Optional. Sender of the gift if it is a known user.

    Type:

      `telegram.User`

  send_date

    Date the gift was sent as `datetime.datetime`. The default timezone of the bot is used for localization, which is UTC unless `telegram.ext.Defaults.tzinfo` is used.

    Type:

      `datetime.datetime`

  is_saved

    Optional. `True`, if the gift is displayed on the account’s profile page; for gifts received on behalf of business accounts only.

    Type:

      `bool`

  can_be_transferred

    Optional. `True`, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only.

    Type:

      `bool`

  transfer_star_count

    Optional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift.

    Type:

      `int`

  next_transfer_date

    Optional. Date when the gift can be transferred. If it’s in the past, then the gift can be transferred now. The default timezone of the bot is used for localization, which is UTC unless `telegram.ext.Defaults.tzinfo` is used. .. versionadded:: 22.3

    Type:

      `datetime.datetime`

  classmethod de_json(data, bot=None)

    See `telegram.OwnedGift.de_json()`.