2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 12:57:52 +00:00

Change get_dialogs behaviour

It now accepts an offset_date instead of an offset_dialog
This commit is contained in:
Dan 2018-12-27 23:56:45 +01:00
parent decaa9e7f0
commit 3814471af4

View File

@ -23,7 +23,7 @@ from ...ext import BaseClient
class GetDialogs(BaseClient):
def get_dialogs(self,
offset_dialog: "pyrogram.Dialog" = None,
offset_date: int = 0,
limit: int = 100,
pinned_only: bool = False) -> "pyrogram.Dialogs":
"""Use this method to get the user's dialogs
@ -31,13 +31,13 @@ class GetDialogs(BaseClient):
You can get up to 100 dialogs at once.
Args:
offset_dialog (:obj:`Dialog`):
Sequential Dialog of the first dialog to be returned.
Defaults to None (start from the beginning).
offset_date (``int``):
The offset date in Unix time taken from the top message of a :obj:`Dialog`.
Defaults to 0. Valid for non-pinned dialogs only.
limit (``str``, *optional*):
Limits the number of dialogs to be retrieved.
Defaults to 100.
Defaults to 100. Valid for non-pinned dialogs only.
pinned_only (``bool``, *optional*):
Pass True if you want to get only pinned dialogs.
@ -55,7 +55,7 @@ class GetDialogs(BaseClient):
else:
r = self.send(
functions.messages.GetDialogs(
offset_date=offset_dialog.top_message.date if offset_dialog else 0,
offset_date=offset_date,
offset_id=0,
offset_peer=types.InputPeerEmpty(),
limit=limit,