From 18289f96b58e26e2a6a107dcc60f1d2c90e6a6d0 Mon Sep 17 00:00:00 2001 From: XiaoCai <52635310+X1A0CA1@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:11:24 +0800 Subject: [PATCH] fix: Fix AttributeError when calling get_send_as_chats() --- pyrogram/methods/chats/get_send_as_chats.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyrogram/methods/chats/get_send_as_chats.py b/pyrogram/methods/chats/get_send_as_chats.py index 8f80d9c1c..fce1abe98 100644 --- a/pyrogram/methods/chats/get_send_as_chats.py +++ b/pyrogram/methods/chats/get_send_as_chats.py @@ -59,9 +59,9 @@ async def get_send_as_chats( send_as_chats = types.List() for p in r.peers: - if isinstance(p, raw.types.PeerUser): - send_as_chats.append(types.Chat._parse_chat(self, users[p.user_id])) + if isinstance(p.peer, raw.types.PeerUser): + send_as_chats.append(types.Chat._parse_chat(self, users[p.peer.user_id])) else: - send_as_chats.append(types.Chat._parse_chat(self, chats[p.channel_id])) + send_as_chats.append(types.Chat._parse_chat(self, chats[p.peer.channel_id])) return send_as_chats