account.confirmPhone
Confirm a phone number to cancel account deletion, for more info click here »
Example
const {Api, TelegramClient} = require('telegram');
const {StringSession} = require('telegram/sessions');
const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});
(async function run() {
const result = await client.invoke(new Api.account.confirmPhone({
phoneCodeHash: 'random string here',
phoneCode: 'random string here',
}));
console.log(result); // prints the result
})();
TL schema
boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;
---functions---
account.confirmPhone#5f2178c3 phone_code_hash:string phone_code:string = Bool;
Parameters
Name
Type
Description
Result
Possible errors
Code
Type
Description
400
CODE_HASH_INVALID
Code hash invalid
400
PHONE_CODE_EMPTY
phone_code is missing
Can bots use this methd ?
yes
Related pages
How to reset an account if the 2FA password was forgotten.
Last updated
Was this helpful?