@@ -77,8 +77,8 @@ class ChatPermissions(Object):
7777 can_edit_tag (``bool``, *optional*):
7878 True, if the user may change the tag of self.
7979
80- can_send_reactions (``bool``, *optional*):
81- True, if the user is allowed to react on messages.
80+ can_react_to_messages (``bool``, *optional*):
81+ True, if the user is allowed to react to messages. If omitted, defaults to the value of *can_send_messages* .
8282
8383 """
8484
@@ -101,7 +101,7 @@ def __init__(
101101 can_manage_topics : bool = None ,
102102 can_send_media_messages : bool = None , # Audio files, documents, photos, videos, video notes and voice notes
103103 can_edit_tag : bool = None ,
104- can_send_reactions : bool = None ,
104+ can_react_to_messages : bool = None ,
105105 ):
106106 super ().__init__ (None )
107107
@@ -121,7 +121,7 @@ def __init__(
121121 self .can_manage_topics = can_manage_topics
122122 self .can_send_media_messages = can_send_media_messages
123123 self .can_edit_tag = can_edit_tag
124- self .can_send_reactions = can_send_reactions
124+ self .can_react_to_messages = can_react_to_messages
125125
126126 @staticmethod
127127 def _parse (denied_permissions : "raw.base.ChatBannedRights" ) -> "ChatPermissions" :
@@ -141,7 +141,7 @@ def _parse(denied_permissions: "raw.base.ChatBannedRights") -> "ChatPermissions"
141141 can_manage_topics = False
142142 can_send_media_messages = False
143143 can_edit_tag = False
144- can_send_reactions = False
144+ can_react_to_messages = False
145145
146146 if isinstance (denied_permissions , raw .types .ChatBannedRights ):
147147 can_send_messages = not denied_permissions .send_messages
@@ -183,7 +183,7 @@ def _parse(denied_permissions: "raw.base.ChatBannedRights") -> "ChatPermissions"
183183 can_send_video_notes = can_send_media_messages
184184 can_send_voice_notes = can_send_media_messages
185185 can_edit_tag = not denied_permissions .edit_rank
186- can_send_reactions = not denied_permissions .send_reactions
186+ can_react_to_messages = not denied_permissions .send_reactions
187187
188188 return ChatPermissions (
189189 can_send_messages = can_send_messages ,
@@ -202,7 +202,7 @@ def _parse(denied_permissions: "raw.base.ChatBannedRights") -> "ChatPermissions"
202202 can_manage_topics = can_manage_topics ,
203203 can_send_media_messages = can_send_media_messages ,
204204 can_edit_tag = can_edit_tag ,
205- can_send_reactions = can_send_reactions
205+ can_react_to_messages = can_react_to_messages
206206 )
207207
208208 def write (
@@ -235,6 +235,6 @@ def write(
235235 send_roundvideos = not permissions .can_send_video_notes ,# TODO
236236 send_voices = not permissions .can_send_voice_notes ,# TODO
237237 # send_plain:flags.25?true
238- edit_rank = permissions .can_edit_tag ,
239- send_reactions = permissions .can_send_reactions ,
238+ edit_rank = not permissions .can_edit_tag ,
239+ send_reactions = not permissions .can_react_to_messages if permissions . can_react_to_messages is not None else not permissions . can_send_messages ,
240240 )
0 commit comments