Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions pyrogram/types/payments/gifted_premium.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ class GiftedPremium(Object):
The paid amount, in the smallest units of the cryptocurrency; 0 if none

month_count (``int``):
Number of months the Telegram Premium subscription will be active
Number of months the Telegram Premium subscription will be active (int(days/30))

day_count (``int``):
Number of days the Telegram Premium subscription will be active
"""

def __init__(
Expand All @@ -52,7 +55,8 @@ def __init__(
amount: int = None,
cryptocurrency: str = None,
cryptocurrency_amount: int = None,
month_count: int = None
month_count: int = None,
day_count: int = None
):
super().__init__()

Expand All @@ -62,6 +66,7 @@ def __init__(
self.cryptocurrency = cryptocurrency
self.cryptocurrency_amount = cryptocurrency_amount
self.month_count = month_count
self.day_count = day_count

@staticmethod
async def _parse(
Expand All @@ -75,5 +80,6 @@ async def _parse(
amount=gifted_premium.amount,
cryptocurrency=getattr(gifted_premium, "crypto_currency", None),
cryptocurrency_amount=getattr(gifted_premium, "crypto_amount", None),
month_count=gifted_premium.months
month_count=int(gifted_premium.days / 30),
day_count=gifted_premium.days
)
Loading