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": 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: