auth.resendCode
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.auth.resendCode({
phoneNumber: 'random string here',
phoneCodeHash: 'random string here',
}));
console.log(result); // prints the result
})();import {Api, TelegramClient} from 'telegram';
import {StringSession} from 'telegram/sessions';
const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});
(async function run() {
const result: Api.auth.SentCode = await client.invoke(new Api.auth.resendCode({
phoneNumber: 'random string here',
phoneCodeHash: 'random string here',
}));
console.log(result); // prints the result
})();TL schema
auth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode;
---functions---
auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode;Parameters
Result
Possible errors
Can bots use this methd ?
yes
Related pages
Last updated