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

Result

EncryptedFile

Possible errors

Can bots use this methd ?

yes

Last updated