mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 11:23:46 +03:00
parent
0686ec4440
commit
a2bae8374e
|
@ -362,6 +362,8 @@ class UserMethods(TelegramBaseClient):
|
|||
except errors.BotMethodInvalidError:
|
||||
raise ValueError('Cannot get entity by phone number as a '
|
||||
'bot (try using integer IDs, not strings)')
|
||||
elif string.lower() in ('me', 'self'):
|
||||
return await self.get_me()
|
||||
else:
|
||||
username, is_join_chat = utils.parse_username(string)
|
||||
if is_join_chat:
|
||||
|
@ -376,9 +378,6 @@ class UserMethods(TelegramBaseClient):
|
|||
elif isinstance(invite, types.ChatInviteAlready):
|
||||
return invite.chat
|
||||
elif username:
|
||||
if username in ('me', 'self'):
|
||||
return await self.get_me()
|
||||
|
||||
try:
|
||||
result = await self(
|
||||
functions.contacts.ResolveUsernameRequest(username))
|
||||
|
|
Loading…
Reference in New Issue
Block a user