mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 19:33:45 +03:00
Move me/self check on get_input_entity to the beginning
It would otherwise fail since the addition of getting entity by exact name if someone had 'me' or 'self' as their name.
This commit is contained in:
parent
8d652c35a1
commit
7b94530bfc
|
@ -2425,6 +2425,9 @@ class TelegramClient(TelegramBareClient):
|
|||
Returns:
|
||||
:tl:`InputPeerUser`, :tl:`InputPeerChat` or :tl:`InputPeerChannel`.
|
||||
"""
|
||||
if peer in ('me', 'self'):
|
||||
return InputPeerSelf()
|
||||
|
||||
try:
|
||||
# First try to get the entity from cache, otherwise figure it out
|
||||
return self.session.get_input_entity(peer)
|
||||
|
@ -2432,8 +2435,6 @@ class TelegramClient(TelegramBareClient):
|
|||
pass
|
||||
|
||||
if isinstance(peer, str):
|
||||
if peer in ('me', 'self'):
|
||||
return InputPeerSelf()
|
||||
return utils.get_input_peer(self._get_entity_from_string(peer))
|
||||
|
||||
original_peer = peer
|
||||
|
|
Loading…
Reference in New Issue
Block a user