From b1250e65751da992369cae8701eee5caa39c3fe7 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 29 Jan 2022 13:02:32 +0100 Subject: [PATCH] Fix accessing non-existent attribute Closes #865 --- pyrogram/types/user_and_chats/chat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyrogram/types/user_and_chats/chat.py b/pyrogram/types/user_and_chats/chat.py index a9d396eb..6dc3fb82 100644 --- a/pyrogram/types/user_and_chats/chat.py +++ b/pyrogram/types/user_and_chats/chat.py @@ -247,7 +247,8 @@ class Chat(Object): is_fake=getattr(channel, "fake", None), title=channel.title, username=getattr(channel, "username", None), - photo=types.ChatPhoto._parse(client, getattr(channel, "photo", None), peer_id, channel.access_hash), + photo=types.ChatPhoto._parse(client, getattr(channel, "photo", None), peer_id, + getattr(channel, "access_hash", 0)), restrictions=types.List([types.Restriction._parse(r) for r in restriction_reason]) or None, permissions=types.ChatPermissions._parse(getattr(channel, "default_banned_rights", None)), members_count=getattr(channel, "participants_count", None),