auth.importLoginToken
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.importLoginToken({
token: Buffer.from('some bytes 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.LoginToken = await client.invoke(new Api.auth.importLoginToken({
token: Buffer.from('some bytes here'),
}));
console.log(result); // prints the result
})();TL schema
auth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken;
auth.loginTokenMigrateTo#68e9916 dc_id:int token:bytes = auth.LoginToken;
auth.loginTokenSuccess#390d5c5e authorization:auth.Authorization = auth.LoginToken;
---functions---
auth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;Parameters
Result
Possible errors
Can bots use this methd ?
yes
Related pages
Last updated