peyk.platforms.telegram.types.gift

Classes

Gift(id, sticker, star_count[, ...])

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

class peyk.platforms.telegram.types.gift.Gift(id: str, sticker: Sticker, star_count: int, upgrade_star_count: int | None = None, is_premium: bool | None = None, has_colors: bool | None = None, total_count: int | None = None, remaining_count: int | None = None, personal_total_count: int | None = None, personal_remaining_count: int | None = None, background: GiftBackground | None = None, unique_gift_variant_count: int | None = None, publisher_chat: Chat | None = None)[source]

Bases: object

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

Variables:
  • id (str) – Unique identifier of the gift

  • sticker (peyk.platforms.telegram.types.sticker.Sticker) – The sticker that represents the gift

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

  • upgrade_star_count (int | None) – The number of Telegram Stars that must be paid to upgrade the gift to a unique one

  • is_premium (bool | None) – True, if the gift can only be purchased by Telegram Premium subscribers

  • has_colors (bool | None) – True, if the gift can be used (after being upgraded) to customize a user’s appearance

  • total_count (int | None) – The total number of gifts of this type that can be sent by all users; for limited gifts only

  • remaining_count (int | None) – The number of remaining gifts of this type that can be sent by all users; for limited gifts only

  • personal_total_count (int | None) – The total number of gifts of this type that can be sent by the bot; for limited gifts only

  • personal_remaining_count (int | None) – The number of remaining gifts of this type that can be sent by the bot; for limited gifts only

  • background (peyk.platforms.telegram.types.gift_background.GiftBackground | None) – Background of the gift

  • unique_gift_variant_count (int | None) – The total number of different unique gifts that can be obtained by upgrading the gift

  • publisher_chat (peyk.platforms.telegram.types.chat.Chat | None) – Information about the chat that published the gift

id: str
sticker: Sticker
star_count: int
upgrade_star_count: int | None = None
is_premium: bool | None = None
has_colors: bool | None = None
total_count: int | None = None
remaining_count: int | None = None
personal_total_count: int | None = None
personal_remaining_count: int | None = None
background: GiftBackground | None = None
unique_gift_variant_count: int | None = None
publisher_chat: Chat | None = None
classmethod from_dict(data: dict | None) Gift | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.