mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 12:51:18 +00:00
Handle cases where denied_permissions might be None
This commit is contained in:
parent
937987a361
commit
8a99f996ab
@ -81,6 +81,7 @@ class ChatPermissions(Object):
|
||||
|
||||
@staticmethod
|
||||
def _parse(denied_permissions: types.ChatBannedRights) -> "ChatPermissions":
|
||||
if isinstance(denied_permissions, types.ChatBannedRights):
|
||||
return ChatPermissions(
|
||||
can_send_messages=not denied_permissions.send_messages,
|
||||
can_send_media_messages=not denied_permissions.send_media,
|
||||
|
Loading…
Reference in New Issue
Block a user