account.initTakeoutSession
Intialize account takeout session
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.initTakeoutSession({
contacts: true,
messageUsers: true,
messageChats: true,
messageMegagroups: true,
messageChannels: true,
files: true,
fileMaxSize: 7615220,
}));
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.account.Takeout = await client.invoke(new Api.account.initTakeoutSession({
contacts: true,
messageUsers: true,
messageChats: true,
messageMegagroups: true,
messageChannels: true,
files: true,
fileMaxSize: 7615220,
}));
console.log(result); // prints the result
})();TL schema
Parameters
Name
Type
Description
Result
Possible errors
Code
Type
Description
420
TAKEOUT_INIT_DELAY_X
Wait X seconds before initing takeout
Can bots use this methd ?
yes
Related pages
How to handle channels, supergroups, groups, and what's the difference between them.
Last updated
Was this helpful?