messages.uploadEncryptedFile

Upload encrypted file and associate it to a secret chat

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.messages.uploadEncryptedFile({
        peer: new Api.InputEncryptedChat({...}),
        file: new Api.InputEncryptedFile({...}),
        }));
    console.log(result); // prints the result
})();

TL schema

encryptedFileEmpty#c21f497e = EncryptedFile;
encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;
---functions---
messages.uploadEncryptedFile#5057c497 peer:InputEncryptedChat file:InputEncryptedFile = EncryptedFile;

Parameters

Name

Type

Description

peer

The secret chat to associate the file to

file

The file

Result

EncryptedFile

Possible errors

Code

Type

Description

Can bots use this methd ?

yes

Last updated