mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-04 20:20:23 +03:00
Make find_user_or_chat work for message.id again
This commit is contained in:
parent
9445d2ba53
commit
534b0800ad
|
@ -304,12 +304,16 @@ def find_user_or_chat(peer, users, chats):
|
||||||
Returns None if it was not found"""
|
Returns None if it was not found"""
|
||||||
if isinstance(peer, PeerUser):
|
if isinstance(peer, PeerUser):
|
||||||
peer, where = peer.user_id, users
|
peer, where = peer.user_id, users
|
||||||
|
elif isinstance(peer, PeerChat):
|
||||||
|
peer, where = peer.chat_id, chats
|
||||||
|
elif isinstance(peer, PeerChannel):
|
||||||
|
peer, where = peer.channel_id, chats
|
||||||
else:
|
else:
|
||||||
where = chats
|
if isinstance(users, dict) and isinstance(chats, dict):
|
||||||
if isinstance(peer, PeerChat):
|
where = users
|
||||||
peer = peer.chat_id
|
where.update(chats)
|
||||||
elif isinstance(peer, PeerChannel):
|
else:
|
||||||
peer = peer.channel_id
|
where = users + chats
|
||||||
|
|
||||||
if isinstance(peer, int):
|
if isinstance(peer, int):
|
||||||
if isinstance(where, dict):
|
if isinstance(where, dict):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user