From 35e347196137b0c2fafe3fb858335cb942c802f0 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 21 Oct 2018 09:43:22 +0200 Subject: [PATCH] The restriction_reason field is not always available --- 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 3f689f41..94be83f5 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=channel.restriction_reason + restriction_reason=getattr(channel, "restriction_reason") )