get_dialogs()

Client.get_dialogs()

Get a chunk of the user’s dialogs.

You can get up to 100 dialogs at once. For a more convenient way of getting a user’s dialogs see iter_dialogs().

Parameters
  • offset_date (int) – The offset date in Unix time taken from the top message of a Dialog. Defaults to 0. Valid for non-pinned dialogs only.

  • limit (str, optional) – Limits the number of dialogs to be retrieved. Defaults to 100. Valid for non-pinned dialogs only.

  • pinned_only (bool, optional) – Pass True if you want to get only pinned dialogs. Defaults to False.

Returns

List of Dialog – On success, a list of dialogs is returned.

Example

# Get first 100 dialogs
app.get_dialogs()

# Get pinned dialogs
app.get_dialogs(pinned_only=True)