fix: Fix AttributeError when calling get_send_as_chats()

This commit is contained in:
XiaoCai 2024-03-01 16:11:24 +08:00 committed by GitHub
parent dee698fc45
commit 18289f96b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -59,9 +59,9 @@ class GetSendAsChats:
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