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

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

Was this helpful?