messages.readEncryptedHistory

Marks message history within a secret chat as read.

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.readEncryptedHistory({
        peer: new Api.InputEncryptedChat({...}),
        maxDate: 1860430,
        }));
    console.log(result); // prints the result
})();

TL schema

boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;
---functions---
messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;

Parameters

Name

Type

Description

peer

Secret chat ID

max_date

Maximum date value for received messages in history

Result

Bool

Possible errors

Code

Type

Description

400

MSG_WAIT_FAILED

A waiting call returned an error

Can bots use this methd ?

yes

Last updated