2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 13:27:47 +00:00

The restriction_reason field is not always available

This commit is contained in:
Dan 2018-10-21 09:43:22 +02:00
parent 1fe46610cd
commit 35e3471961

View File

@ -215,7 +215,7 @@ def parse_channel_chat(channel: types.Channel) -> pyrogram_types.Chat:
title=channel.title, title=channel.title,
username=getattr(channel, "username", None), username=getattr(channel, "username", None),
photo=parse_chat_photo(getattr(channel, "photo", None)), photo=parse_chat_photo(getattr(channel, "photo", None)),
restriction_reason=channel.restriction_reason restriction_reason=getattr(channel, "restriction_reason")
) )