Skip to content

Commit b98708f

Browse files
0zd0alissonlauffer
authored andcommitted
fix: crash caused by an update with paid reactions
1 parent 58c1730 commit b98708f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

hydrogram/types/messages_and_media/reaction.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ class Reaction(Object):
4040
chosen_order (``int``, *optional*):
4141
Chosen reaction order.
4242
Available for chosen reactions.
43+
44+
is_paid (``bool``, *optional*):
45+
True, if the reaction is a paid star reaction.
4346
"""
4447

4548
def __init__(
@@ -50,13 +53,15 @@ def __init__(
5053
custom_emoji_id: int | None = None,
5154
count: int | None = None,
5255
chosen_order: int | None = None,
56+
is_paid: bool | None = None,
5357
):
5458
super().__init__(client)
5559

5660
self.emoji = emoji
5761
self.custom_emoji_id = custom_emoji_id
5862
self.count = count
5963
self.chosen_order = chosen_order
64+
self.is_paid = is_paid
6065

6166
@staticmethod
6267
def _parse(client: hydrogram.Client, reaction: raw.base.Reaction) -> Reaction:
@@ -65,7 +70,11 @@ def _parse(client: hydrogram.Client, reaction: raw.base.Reaction) -> Reaction:
6570

6671
if isinstance(reaction, raw.types.ReactionCustomEmoji):
6772
return Reaction(client=client, custom_emoji_id=reaction.document_id)
68-
return None
73+
74+
if isinstance(reaction, raw.types.ReactionPaid):
75+
return Reaction(client=client, is_paid=True)
76+
77+
return Reaction(client=client)
6978

7079
@staticmethod
7180
def _parse_count(client: hydrogram.Client, reaction_count: raw.base.ReactionCount) -> Reaction:

0 commit comments

Comments
 (0)