get_saved_history()

async Client.get_saved_history()

Get saved messages history for a specific peer.

Usable by Users Bots
Parameters:
  • parent_peer (int | str) – The parent peer (usually “me”).

  • peer (int | str) – The peer whose saved messages to retrieve.

  • offset_id (int, optional) – Only return messages starting from the specified id.

  • offset_date (int, optional) – Only return messages starting from the specified date.

  • add_offset (int, optional) – Number of list elements to skip.

  • limit (int, optional) – Number of results to return. Defaults to 100.

  • max_id (int, optional) – If positive, the server will return only messages with IDs less than max_id.

  • min_id (int, optional) – If positive, only messages with IDs bigger than min_id will be returned.

  • hash (int, optional) – Hash for caching.

Returns:

Messages – The messages object.

Example

history = await app.get_saved_history("me", user_id)