Gift¶
- class telegram.Gift(id, sticker, star_count, total_count=None, remaining_count=None, upgrade_star_count=None, publisher_chat=None, personal_total_count=None, personal_remaining_count=None, background=None, is_premium=None, has_colors=None, unique_gift_variant_count=None, *, api_kwargs=None)[source]¶
Bases:
telegram.TelegramObjectThis 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
idis equal.Use In
Available In
Added in version 21.8.
- Parameters:
id (
str) – Unique identifier of 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 by all users; for limited gifts only.remaining_count (
int, optional) – The number of remaining gifts of this type that can be sent by all users; 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.
personal_total_count (
int, optional) –The total number of gifts of this type that can be sent by the bot; for limited gifts only.
Added in version 22.6.
personal_remaining_count (
int, optional) –The number of remaining gifts of this type that can be sent by the bot; for limited gifts only.
Added in version 22.6.
background (
GiftBackground, optional) –Background of the gift.
Added in version 22.6.
is_premium (
bool, optional) –True, if the gift can only be purchased by Telegram Premium subscribers.Added in version 22.6.
has_colors (
bool, optional) –True, if the gift can be used (after being upgraded) to customize a user’s appearance.Added in version 22.6.
unique_gift_variant_count (
int, optional) –The total number of different unique gifts that can be obtained by upgrading the gift.
Added in version 22.6.
- total_count[source]¶
Optional. The total number of the gifts of this type that can be sent by all users; for limited gifts only.
- Type:
int
- remaining_count[source]¶
Optional. The number of remaining gifts of this type that can be sent by all users; for limited gifts only.
- Type:
int
- upgrade_star_count[source]¶
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[source]¶
Optional. Information about the chat that published the gift.
Added in version 22.4.
- Type:
- personal_total_count[source]¶
Optional. The total number of gifts of this type that can be sent by the bot; for limited gifts only.
Added in version 22.6.
- Type:
int
- personal_remaining_count[source]¶
Optional. The number of remaining gifts of this type that can be sent by the bot; for limited gifts only.
Added in version 22.6.
- Type:
int
Optional.
True, if the gift can only be purchased by Telegram Premium subscribers.Added in version 22.6.
- Type:
bool
- has_colors[source]¶
Optional.
True, if the gift can be used (after being upgraded) to customize a user’s appearance.Added in version 22.6.
- Type:
bool
- unique_gift_variant_count[source]¶
Optional. The total number of different unique gifts that can be obtained by upgrading the gift.
Added in version 22.6.
- Type:
int