peyk.platforms.telegram.types.unique_gift_info

Classes

UniqueGiftInfo(gift, origin[, text, ...])

Describes a service message about a unique gift that was sent or received.

class peyk.platforms.telegram.types.unique_gift_info.UniqueGiftInfo(gift: UniqueGift, origin: str, text: str | None = None, entities: List[MessageEntity] | None = None, is_private: bool | None = None, last_resale_currency: str | None = None, last_resale_amount: int | None = None, owned_gift_id: str | None = None, transfer_star_count: int | None = None, next_transfer_date: int | None = None)[source]

Bases: object

Describes a service message about a unique gift that was sent or received.

Variables:
  • gift (peyk.platforms.telegram.types.unique_gift.UniqueGift) – Information about the gift

  • origin (str) – Origin of the gift. Currently, either ‘upgrade’ for gifts upgraded from regular gifts, ‘transfer’ for gifts transferred from other users or channels, ‘resale’ for gifts bought from other users, ‘gifted_upgrade’ for upgrades purchased after the gift was sent, or ‘offer’ for gifts bought or sold through gift purchase offers.

  • last_resale_currency (str | None) – For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of ‘XTR’ for Telegram Stars or ‘TON’ for TON grams.

  • last_resale_amount (int | None) – For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanograms

  • owned_gift_id (str | None) – Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts

  • transfer_star_count (int | None) – Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift

  • next_transfer_date (int | None) – Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now.

  • last_resale_star_count – For gifts bought from other users, the price paid for the gift

gift: UniqueGift
origin: str
text: str | None = None
entities: List[MessageEntity] | None = None
is_private: bool | None = None
last_resale_currency: str | None = None
last_resale_amount: int | None = None
owned_gift_id: str | None = None
transfer_star_count: int | None = None
next_transfer_date: int | None = None
classmethod from_dict(data: dict | None) UniqueGiftInfo | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.