Optional
params: { Fetch parameters
Optional
archived?: "exclude" | "only" | "keep"How to handle archived chats?
Whether to keep
them among other dialogs,
exclude
them from the list, or only
return archived dialogs
Ignored for folders, since folders themselves contain information about archived chats.
Note: when
pinned=only
,archived=keep
will act asonly
because of Telegram API limitations.
Optional
chunkChunk size which will be passed to messages.getDialogs
.
You shouldn't usually care about this.
Optional
filter?: Partial<Omit<RawDialogFilter, "_" | "id" | "title">>Additional filtering for the dialogs.
If folder
is not provided, this filter is used instead.
If folder
is provided, fields from this object are used
to override filters inside the folder.
Optional
folder?: InputDialogFolderFolder from which the dialogs will be fetched.
You can pass folder object, id or title
Note that passing anything except object will cause the list of the folders to be fetched, and passing a title may fetch from a wrong folder if you have multiple with the same title.
Also note that fetching dialogs in a folder is orders of magnitudes* slower than normal because of Telegram API limitations - we have to fetch all dialogs and filter the ones we need manually. If possible, use Dialog.filterFolder instead.
When a folder with given ID or title is not found, MtArgumentError is thrown
Optional
limit?: numberLimits the number of dialogs to be received.
Optional
offsetOffset message date used as an anchor for pagination.
Optional
offsetOffset message ID used as an anchor for pagination
Optional
offsetOffset peer used as an anchor for pagination
Optional
pinned?: How to handle pinned dialogs?
Whether to include
them at the start of the list,
exclude
them at all, or only
return pinned dialogs.
Additionally, for folders you can specify
keep
, which will return pinned dialogs
ordered by date among other non-pinned dialogs.
Note: When using
include
mode with folders, pinned dialogs will only be fetched if all offset parameters are unset.
Iterate over dialogs.
Note that due to Telegram API limitations, ordering here can only be anti-chronological (i.e. newest - first), and draft update date is not considered when sorting.