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
})();

TL schema

account.takeout#4dba4501 id:long = account.Takeout;
---functions---
account.initTakeoutSession#f05b4804 flags:# contacts:flags.0?true message_users:flags.1?true message_chats:flags.2?true message_megagroups:flags.3?true message_channels:flags.4?true files:flags.5?true file_max_size:flags.5?int = account.Takeout;

Parameters

Name

Type

Description

flags

contacts

Whether to export contacts

message_users

Whether to export messages in private chats

message_chats

message_megagroups

message_channels

files

Whether to export files

file_max_size

Maximum size of files to export

Result

account.Takeout

Possible errors

Code

Type

Description

420

TAKEOUT_INIT_DELAY_X

Wait X seconds before initing takeout

Can bots use this methd ?

yes

How to handle channels, supergroups, groups, and what's the difference between them.

Last updated