From afcde95b30f25eacce718454d9a956461185be85 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 21 Mar 2019 17:03:35 +0100 Subject: [PATCH] Fix parsing ChannelForbidden; it doesn't have default permissions --- pyrogram/client/types/user_and_chats/chat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/types/user_and_chats/chat.py b/pyrogram/client/types/user_and_chats/chat.py index 5488b846..a13f8a2b 100644 --- a/pyrogram/client/types/user_and_chats/chat.py +++ b/pyrogram/client/types/user_and_chats/chat.py @@ -144,7 +144,7 @@ class Chat(PyrogramType): type="group", title=chat.title, photo=ChatPhoto._parse(client, getattr(chat, "photo", None)), - permissions=ChatPermissions._parse(chat.default_banned_rights), + permissions=ChatPermissions._parse(getattr(chat, "default_banned_rights", None)), client=client ) @@ -157,7 +157,7 @@ class Chat(PyrogramType): username=getattr(channel, "username", None), photo=ChatPhoto._parse(client, getattr(channel, "photo", None)), restriction_reason=getattr(channel, "restriction_reason", None), - permissions=ChatPermissions._parse(channel.default_banned_rights), + permissions=ChatPermissions._parse(getattr(channel, "default_banned_rights", None)), client=client )