Skip to content

Commit

Permalink
Fix 'Chats' object is not iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
KurimuzonAkuma committed Nov 3, 2024
1 parent 230f5d7 commit 0fad5ad
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions pyrogram/methods/advanced/resolve_peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,27 +107,22 @@ async def resolve_peer(
)
)
elif peer_type == "chat":
await self.fetch_peers(
await self.invoke(
raw.functions.messages.GetChats(
id=[-peer_id]
)
await self.invoke(
raw.functions.messages.GetChats(
id=[-peer_id]
)
)
else:
await self.fetch_peers(
await self.invoke(
raw.functions.channels.GetChannels(
id=[
raw.types.InputChannel(
channel_id=utils.get_channel_id(peer_id),
access_hash=0
)
]
)
await self.invoke(
raw.functions.channels.GetChannels(
id=[
raw.types.InputChannel(
channel_id=utils.get_channel_id(peer_id),
access_hash=0
)
]
)
)

try:
return await self.storage.get_peer_by_id(peer_id)
except KeyError:
Expand Down

0 comments on commit 0fad5ad

Please sign in to comment.