From bd0fc27a61b1eb4d3726434ec00326b35d78b991 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 26 Apr 2018 11:09:19 +0200 Subject: [PATCH] Add support for blocked channels/supergroups. Fixes #56 --- pyrogram/client/message_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/message_parser.py b/pyrogram/client/message_parser.py index 3072b6f5..83d56009 100644 --- a/pyrogram/client/message_parser.py +++ b/pyrogram/client/message_parser.py @@ -140,8 +140,8 @@ def parse_channel_chat(channel: types.Channel) -> pyrogram_types.Chat: id=int("-100" + str(channel.id)), type="supergroup" if channel.megagroup else "channel", title=channel.title, - username=channel.username, - photo=parse_chat_photo(channel.photo) + username=getattr(channel, "username", None), + photo=parse_chat_photo(getattr(channel, "photo", None)) )