account.uploadTheme

Upload theme

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.uploadTheme({
        file: new Api.InputFile({...}),
        thumb: new Api.InputFile({...}),
        fileName: 'random string here',
        mimeType: 'random string here',
        }));
    console.log(result); // prints the result
})();

TL schema

documentEmpty#36f8c871 id:long = Document;
document#1e87342b flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:int thumbs:flags.0?Vector<PhotoSize> video_thumbs:flags.1?Vector<VideoSize> dc_id:int attributes:Vector<DocumentAttribute> = Document;
---functions---
account.uploadTheme#1c3db333 flags:# file:InputFile thumb:flags.0?InputFile file_name:string mime_type:string = Document;

Parameters

Name

Type

Description

flags

file

Theme file uploaded as described in files »

thumb

Thumbnail

file_name

File name

mime_type

MIME type, must be application/x-tgtheme-{format}, where format depends on the client

Result

Document

Possible errors

Code

Type

Description

400

THEME_FILE_INVALID

Invalid theme file provided

Can bots use this methd ?

yes

How to transfer large data batches correctly.

Last updated