From 96af2ebcf26d153a5219bbd18af57c3bf95f178c Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 3 Nov 2018 17:04:04 +0100 Subject: [PATCH] Fix getattr failing for ChannelForbidden objects --- pyrogram/client/ext/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrogram/client/ext/utils.py b/pyrogram/client/ext/utils.py index a2f1c3db..696174a7 100644 --- a/pyrogram/client/ext/utils.py +++ b/pyrogram/client/ext/utils.py @@ -215,7 +215,7 @@ def parse_channel_chat(channel: types.Channel) -> pyrogram_types.Chat: title=channel.title, username=getattr(channel, "username", None), photo=parse_chat_photo(getattr(channel, "photo", None)), - restriction_reason=getattr(channel, "restriction_reason") + restriction_reason=getattr(channel, "restriction_reason", None) )