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