mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-05 23:04:51 +00:00
pyrofork: remove sticker field from GiftedPremium
not exist in raw types Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
955b261101
commit
bb29cc86bc
1 changed files with 2 additions and 14 deletions
|
|
@ -44,10 +44,6 @@ class GiftedPremium(Object):
|
||||||
|
|
||||||
month_count (``int``):
|
month_count (``int``):
|
||||||
Number of months the Telegram Premium subscription will be active
|
Number of months the Telegram Premium subscription will be active
|
||||||
|
|
||||||
sticker (:obj:`~pyrogram.types.Sticker`):
|
|
||||||
A sticker to be shown in the message; may be null if unknown
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
|
@ -58,8 +54,7 @@ class GiftedPremium(Object):
|
||||||
amount: int = None,
|
amount: int = None,
|
||||||
cryptocurrency: str = None,
|
cryptocurrency: str = None,
|
||||||
cryptocurrency_amount: int = None,
|
cryptocurrency_amount: int = None,
|
||||||
month_count: int = None,
|
month_count: int = None
|
||||||
sticker: "types.Sticker" = None,
|
|
||||||
):
|
):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
|
|
@ -69,7 +64,6 @@ class GiftedPremium(Object):
|
||||||
self.cryptocurrency = cryptocurrency
|
self.cryptocurrency = cryptocurrency
|
||||||
self.cryptocurrency_amount = cryptocurrency_amount
|
self.cryptocurrency_amount = cryptocurrency_amount
|
||||||
self.month_count = month_count
|
self.month_count = month_count
|
||||||
self.sticker = sticker
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
async def _parse(
|
async def _parse(
|
||||||
|
|
@ -77,17 +71,11 @@ class GiftedPremium(Object):
|
||||||
gifted_premium: "raw.types.MessageActionGiftPremium",
|
gifted_premium: "raw.types.MessageActionGiftPremium",
|
||||||
gifter_user_id: int
|
gifter_user_id: int
|
||||||
) -> "GiftedPremium":
|
) -> "GiftedPremium":
|
||||||
sticker = None
|
|
||||||
stickers, _ = await client._get_raw_stickers(
|
|
||||||
raw.types.InputStickerSetPremiumGifts()
|
|
||||||
)
|
|
||||||
sticker = choice(stickers)
|
|
||||||
return GiftedPremium(
|
return GiftedPremium(
|
||||||
gifter_user_id=gifter_user_id,
|
gifter_user_id=gifter_user_id,
|
||||||
currency=gifted_premium.currency,
|
currency=gifted_premium.currency,
|
||||||
amount=gifted_premium.amount,
|
amount=gifted_premium.amount,
|
||||||
cryptocurrency=getattr(gifted_premium, "crypto_currency", None),
|
cryptocurrency=getattr(gifted_premium, "crypto_currency", None),
|
||||||
cryptocurrency_amount=getattr(gifted_premium, "crypto_amount", None),
|
cryptocurrency_amount=getattr(gifted_premium, "crypto_amount", None),
|
||||||
month_count=gifted_premium.months,
|
month_count=gifted_premium.months
|
||||||
sticker=sticker
|
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue