Optionalparams: {Fetch parameters
Optionalarchived?: "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=keepwill act asonlybecause of Telegram API limitations.
OptionalchunkSize?: numberChunk size which will be passed to messages.getDialogs.
You shouldn't usually care about this.
Optionalfilter?: 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.
Optionalfolder?: 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
Optionallimit?: numberLimits the number of dialogs to be received.
OptionaloffsetDate?: number | DateOffset message date used as an anchor for pagination.
OptionaloffsetId?: numberOffset message ID used as an anchor for pagination
OptionaloffsetPeer?: TypeInputPeerOffset peer used as an anchor for pagination
Optionalpinned?: "include" | "exclude" | "only" | "keep"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
includemode 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.