mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-05 20:50:22 +03:00
Fix invalid async for when getting entities
This commit is contained in:
parent
2ee5201229
commit
ddf36c9cb0
|
@ -2446,11 +2446,11 @@ class TelegramClient(TelegramBareClient):
|
||||||
mark = not isinstance(peer, int) or peer < 0
|
mark = not isinstance(peer, int) or peer < 0
|
||||||
target_id = utils.get_peer_id(peer)
|
target_id = utils.get_peer_id(peer)
|
||||||
if mark:
|
if mark:
|
||||||
async for dialog in self.get_dialogs(100):
|
async for dialog in self.iter_dialogs(100):
|
||||||
if utils.get_peer_id(dialog.entity) == target_id:
|
if utils.get_peer_id(dialog.entity) == target_id:
|
||||||
return utils.get_input_peer(dialog.entity)
|
return utils.get_input_peer(dialog.entity)
|
||||||
else:
|
else:
|
||||||
async for dialog in self.get_dialogs(100):
|
async for dialog in self.iter_dialogs(100):
|
||||||
if dialog.entity.id == target_id:
|
if dialog.entity.id == target_id:
|
||||||
return utils.get_input_peer(dialog.entity)
|
return utils.get_input_peer(dialog.entity)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user