Skip to content

Commit

Permalink
Merge pull request #49 from X1A0CA1/main
Browse files Browse the repository at this point in the history
fix: Fix AttributeError when calling get_send_as_chats()
  • Loading branch information
wulan17 committed Mar 1, 2024
2 parents e74e54c + 18289f9 commit 484b58b
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 @@ -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

0 comments on commit 484b58b

Please sign in to comment.