Layer 220
method Users
account.sendChangePhoneCode#82574ae5 phone_number:string settings:CodeSettings = auth.SentCode;

Parameters

Name Type Description
PhoneNumber string New phone number
Settings CodeSettings Phone code settings

Returns

auth.SentCode

Possible Errors

Code Type Description
406 FRESH_CHANGE_PHONE_FORBIDDEN You can't change phone number right after logging in, please wait at least 24 hours.
400 PHONE_NUMBER_BANNED The provided phone number is banned from telegram.
406 PHONE_NUMBER_INVALID The phone number is invalid.
400 PHONE_NUMBER_OCCUPIED The phone number is already in use.

Gogram Example

// AccountSendChangePhoneCode - positional arguments
result, err := client.AccountSendChangePhoneCode("...", &tg.CodeSettings{})
if err != nil {
    // handle error
}
// result is *tg.AuthSentCode