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
messages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
messages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs;
---functions---
messages.getDialogs#a0ee3b73 flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:int = messages.Dialogs;
Parameters
Name
Type
Description
Result
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
Related pages
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?