upload.getCdnFile

Download a CDN file.

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.upload.getCdnFile({
        fileToken: Buffer.from('some bytes here'),
        offset: 1130267,
        limit: 8166765,
        }));
    console.log(result); // prints the result
})();

TL schema

upload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile;
upload.cdnFile#a99fca4f bytes:bytes = upload.CdnFile;
---functions---
upload.getCdnFile#2000bcc3 file_token:bytes offset:int limit:int = upload.CdnFile;

Parameters

Name

Type

Description

file_token

File token

offset

Offset of chunk to download

limit

Length of chunk to download

Result

upload.CdnFile

Possible errors

Code

Type

Description

Can bots use this methd ?

yes

Last updated