Fix 'Chats' object is not iterable

This commit is contained in:
KurimuzonAkuma 2024-11-03 11:43:32 +03:00
parent 230f5d7686
commit 0fad5ad10c

View File

@ -107,27 +107,22 @@ class ResolvePeer:
)
)
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: