CheckUsernameRequest
Only users can use this method. See code examples.
---functions--- account.checkUsername#2714d86c username:string = Bool
Returns
| Bool |
This type has no instances available.
Parameters
| username | string |
Known RPC errors
This request can cause 1 known error:
UsernameInvalidError | Nobody is using this username, or the username is unacceptable. If the latter, it must match r"[a-zA-Z][\w\d]{3,30}[a-zA-Z\d]". |
You can import these from telethon.errors.
Example
from telethon.sync import TelegramClient
from telethon import functions, types
with TelegramClient(name, api_id, api_hash) as client:
result = client(functions.account.CheckUsernameRequest(
username='some string here'
))
print(result)