ChangePhoneRequest

Only users can use this request. See code examples.

---functions---
account.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User

Returns

User

This type can be an instance of either:

UserUserEmpty

Parameters

phone_numberstring
phone_code_hashstring
phone_codestring

Known RPC errors

This request can cause 1 known error:

PhoneNumberInvalidErrorThe phone number is invalid.

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.ChangePhoneRequest(
        phone_number='some string here',
        phone_code_hash='some string here',
        phone_code='some string here'
    ))
    print(result.stringify())