mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-03-03 19:00:21 +03:00
Clearer variable names in get_input_entity (#738)
This commit is contained in:
parent
cb226e7f45
commit
a1448f3da8
|
@ -196,14 +196,15 @@ class MemorySession(Session):
|
||||||
result = self.get_entity_rows_by_name(key)
|
result = self.get_entity_rows_by_name(key)
|
||||||
|
|
||||||
if result:
|
if result:
|
||||||
i, h = result # unpack resulting tuple
|
entity_id, entity_hash = result # unpack resulting tuple
|
||||||
i, k = utils.resolve_id(i) # removes the mark and returns kind
|
entity_id, kind = utils.resolve_id(entity_id)
|
||||||
if k == PeerUser:
|
# removes the mark and returns type of entity
|
||||||
return InputPeerUser(i, h)
|
if kind == PeerUser:
|
||||||
elif k == PeerChat:
|
return InputPeerUser(entity_id, entity_hash)
|
||||||
return InputPeerChat(i)
|
elif kind == PeerChat:
|
||||||
elif k == PeerChannel:
|
return InputPeerChat(entity_id)
|
||||||
return InputPeerChannel(i, h)
|
elif kind == PeerChannel:
|
||||||
|
return InputPeerChannel(entity_id, entity_hash)
|
||||||
else:
|
else:
|
||||||
raise ValueError('Could not find input entity with key ', key)
|
raise ValueError('Could not find input entity with key ', key)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user