mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-12-03 19:04:33 +00:00
Fix 'Chats' object is not iterable
This commit is contained in:
parent
230f5d7686
commit
0fad5ad10c
@ -107,27 +107,22 @@ class ResolvePeer:
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
elif peer_type == "chat":
|
elif peer_type == "chat":
|
||||||
await self.fetch_peers(
|
await self.invoke(
|
||||||
await self.invoke(
|
raw.functions.messages.GetChats(
|
||||||
raw.functions.messages.GetChats(
|
id=[-peer_id]
|
||||||
id=[-peer_id]
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
await self.fetch_peers(
|
await self.invoke(
|
||||||
await self.invoke(
|
raw.functions.channels.GetChannels(
|
||||||
raw.functions.channels.GetChannels(
|
id=[
|
||||||
id=[
|
raw.types.InputChannel(
|
||||||
raw.types.InputChannel(
|
channel_id=utils.get_channel_id(peer_id),
|
||||||
channel_id=utils.get_channel_id(peer_id),
|
access_hash=0
|
||||||
access_hash=0
|
)
|
||||||
)
|
]
|
||||||
]
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return await self.storage.get_peer_by_id(peer_id)
|
return await self.storage.get_peer_by_id(peer_id)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
Loading…
Reference in New Issue
Block a user