messages.getDialogs

Returns the current user dialog list.

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.getDialogs({
        excludePinned: true,
        folderId: 1470086,
        offsetDate: 2226947,
        offsetId: 483369,
        offsetPeer: new Api.InputPeer({...}),
        limit: 5241323,
        hash: 7683946,
        }));
    console.log(result); // prints the result
})();

TL schema

Parameters

Result

messages.Dialogs

Possible errors

Code

Type

Description

400

FOLDER_ID_INVALID

Invalid folder ID

400

INPUT_CONSTRUCTOR_INVALID

The provided constructor is invalid

400

OFFSET_PEER_ID_INVALID

The provided offset peer is invalid

Can bots use this methd ?

yes

Telegram allows placing chats into folders, based on their type, mute status, or other custom criteria, thanks to folder blacklists and whitelists.

How to fetch results from large lists of objects.

Last updated

Was this helpful?