account.saveAutoDownloadSettings

Change media autodownload settings

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.saveAutoDownloadSettings({
        low: true,
        high: true,
        settings: new Api.AutoDownloadSettings({...}),
        }));
    console.log(result); // prints the result
})();

TL schema

boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;
---functions---
account.saveAutoDownloadSettings#76f36233 flags:# low:flags.0?true high:flags.1?true settings:AutoDownloadSettings = Bool;

Parameters

Name

Type

Description

flags

low

Whether to save settings in the low data usage preset

high

Whether to save settings in the high data usage preset

settings

Media autodownload settings

Result

Bool

Possible errors

Code

Type

Description

Can bots use this methd ?

yes

Last updated