pyrofork: Add additional_price field to class Giveaway

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2024-08-14 23:54:35 +07:00
parent 4ac0fcc35f
commit 90dc694588
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5

View file

@ -45,6 +45,9 @@ class Giveaway(Object):
new_subscribers (``bool``):
True, if the giveaway only for new subscribers.
additional_price (``str``, *optional*):
Additional prize for the giveaway winner(s).
allowed_countries (List of ``str``, *optional*):
List of ISO country codes which eligible to join the giveaway.
@ -61,6 +64,7 @@ class Giveaway(Object):
months: int,
expire_date: datetime,
new_subscribers : bool,
additional_price: str = None,
allowed_countries: List[str] = None,
private_channel_ids: List[int] = None
):
@ -71,6 +75,7 @@ class Giveaway(Object):
self.months = months
self.expire_date = expire_date
self.new_subscribers = new_subscribers
self.additional_price = additional_price
self.allowed_countries = allowed_countries
self.private_channel_ids = private_channel_ids
@ -100,6 +105,7 @@ class Giveaway(Object):
months=giveaway.months,
expire_date=utils.timestamp_to_datetime(giveaway.until_date),
new_subscribers=giveaway.only_new_subscribers,
additional_price=giveaway.prize_description,
allowed_countries=giveaway.countries_iso2 if len(giveaway.countries_iso2) > 0 else None,
private_channel_ids=private_ids if len(private_ids) > 0 else None,
client=client