Skip to content
Back to top
View this page

# Gift

class telegram.Gift(id, sticker, star_count, total_count=None, remaining_count=None, upgrade_star_count=None, publisher_chat=None, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

  This object represents a gift that can be sent by the bot.

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

  Use In

  `telegram.Bot.send_gift()`

  Available In

  - `telegram.GiftInfo.gift`

  - `telegram.Gifts.gifts`

  - `telegram.OwnedGiftRegular.gift`

  - `telegram.TransactionPartnerChat.gift`

  - `telegram.TransactionPartnerUser.gift`

  Added in version 21.8.

  Parameters:

    - id (`str`) – Unique identifier of the gift.

    - sticker (`Sticker`) – The sticker that represents the gift.

    - star_count (`int`) – The number of Telegram Stars that must be paid to send the sticker.

    - total_count (`int`, optional) – The total number of the gifts of this type that can be sent; for limited gifts only.

    - remaining_count (`int`, optional) – The number of remaining gifts of this type that can be sent; for limited gifts only.

    - upgrade_star_count (`int`, optional) –

      The number of Telegram Stars that must be paid to upgrade the gift to a unique one.

      Added in version 21.10.

    - publisher_chat (`telegram.Chat`, optional) –

      Information about the chat that published the gift.

      Added in version 22.4.

  id

    Unique identifier of the gift.

    Type:

      `str`

  sticker

    The sticker that represents the gift.

    Type:

      `Sticker`

  star_count

    The number of Telegram Stars that must be paid to send the sticker.

    Type:

      `int`

  total_count

    Optional. The total number of the gifts of this type that can be sent; for limited gifts only.

    Type:

      `int`

  remaining_count

    Optional. The number of remaining gifts of this type that can be sent; for limited gifts only.

    Type:

      `int`

  upgrade_star_count

    Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one.

    Added in version 21.10.

    Type:

      `int`

  publisher_chat

    Optional. Information about the chat that published the gift.

    Added in version 22.4.

    Type:

      `telegram.Chat`

  classmethod de_json(data, bot=None)

    See `telegram.TelegramObject.de_json()`.