Skip to content

Commit

Permalink
fix: Fix AttributeError when calling get_send_as_chats()
Browse files Browse the repository at this point in the history
(cherry picked from commit 18289f9)
  • Loading branch information
X1A0CA1 authored and eyMarv committed Mar 1, 2024
1 parent a8ba59c commit 2a85b3b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyrogram/methods/chats/get_send_as_chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,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

0 comments on commit 2a85b3b

Please sign in to comment.