Handle cases where denied_permissions might be None

This commit is contained in:
Dan 2019-08-03 19:50:12 +02:00
parent 937987a361
commit 8a99f996ab

View File

@ -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,