messages.getUnreadMentions

Get unread messages where we were mentioned

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.getUnreadMentions({
        peer: new Api.InputPeer({...}),
        offsetId: 2543174,
        addOffset: 4403363,
        limit: 3577797,
        maxId: 9456904,
        minId: 282118,
        }));
    console.log(result); // prints the result
})();

TL schema

Parameters

Name

Type

Description

peer

Peer where to look for mentions

limit

Maximum number of results to return, see pagination

max_id

Maximum message ID to return, see pagination

min_id

Minimum message ID to return, see pagination

Result

messages.Messages

Possible errors

Code

Type

Description

400

CHANNEL_INVALID

The provided channel is invalid

400

CHANNEL_PRIVATE

You haven't joined this channel/supergroup

400

PEER_ID_INVALID

The provided peer id is invalid

Can bots use this methd ?

yes

How to fetch results from large lists of objects.

Last updated

Was this helpful?