Skip to content

Commit

Permalink
pyrofork: Add upgrade_star_count and is_for_birthday in Gift
Browse files Browse the repository at this point in the history
Signed-off-by: Yasir Aris <git@yasir.id>
  • Loading branch information
yasirarism committed Jan 4, 2025
1 parent 5c93020 commit 1ddc2d2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pyrogram/types/payments/gift.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ class Gift(Object):
total_count (``int``, *optional*):
Number of total times the gift can be purchased by all users; None if not limited.
upgrade_star_count (``int``, *optional*):
Number of Telegram Stars that must be paid to upgrade the gift; 0 if upgrade isn't possible.
is_for_birthday (``bool``, *optional*):
True, if the gift is a birthday gift.
first_send_date (:py:obj:`~datetime.datetime`, *optional*):
Point in time (Unix timestamp) when the gift was send for the first time; for sold out gifts only.
Expand All @@ -70,6 +76,8 @@ def __init__(
default_sell_star_count: int,
remaining_count: Optional[int] = None,
total_count: Optional[int] = None,
upgrade_star_count: int,
is_for_birthday: Optional[bool] = None,
first_send_date: Optional[datetime] = None,
last_send_date: Optional[datetime] = None,
is_limited: Optional[bool] = None,
Expand All @@ -83,6 +91,8 @@ def __init__(
self.default_sell_star_count = default_sell_star_count
self.remaining_count = remaining_count
self.total_count = total_count
self.upgrade_star_count = upgrade_star_count
self.is_for_birthday = is_for_birthday
self.first_send_date = first_send_date
self.last_send_date = last_send_date
self.is_limited = is_limited
Expand All @@ -107,5 +117,7 @@ async def _parse(
last_send_date=utils.timestamp_to_datetime(getattr(star_gift, "last_sale_date", None)),
is_limited=getattr(star_gift, "limited", None),
is_sold_out=getattr(star_gift, "sold_out", None),
upgrade_star_count=getattr(star_gift, "upgrade_stars", 0),
is_for_birthday=getattr(star_gift, "birthday", None),
client=client
)

0 comments on commit 1ddc2d2

Please sign in to comment.