mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Change get_dialogs behaviour
It now accepts an offset_date instead of an offset_dialog
This commit is contained in:
parent
decaa9e7f0
commit
3814471af4
@ -23,7 +23,7 @@ from ...ext import BaseClient
|
|||||||
|
|
||||||
class GetDialogs(BaseClient):
|
class GetDialogs(BaseClient):
|
||||||
def get_dialogs(self,
|
def get_dialogs(self,
|
||||||
offset_dialog: "pyrogram.Dialog" = None,
|
offset_date: int = 0,
|
||||||
limit: int = 100,
|
limit: int = 100,
|
||||||
pinned_only: bool = False) -> "pyrogram.Dialogs":
|
pinned_only: bool = False) -> "pyrogram.Dialogs":
|
||||||
"""Use this method to get the user's 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.
|
You can get up to 100 dialogs at once.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
offset_dialog (:obj:`Dialog`):
|
offset_date (``int``):
|
||||||
Sequential Dialog of the first dialog to be returned.
|
The offset date in Unix time taken from the top message of a :obj:`Dialog`.
|
||||||
Defaults to None (start from the beginning).
|
Defaults to 0. Valid for non-pinned dialogs only.
|
||||||
|
|
||||||
limit (``str``, *optional*):
|
limit (``str``, *optional*):
|
||||||
Limits the number of dialogs to be retrieved.
|
Limits the number of dialogs to be retrieved.
|
||||||
Defaults to 100.
|
Defaults to 100. Valid for non-pinned dialogs only.
|
||||||
|
|
||||||
pinned_only (``bool``, *optional*):
|
pinned_only (``bool``, *optional*):
|
||||||
Pass True if you want to get only pinned dialogs.
|
Pass True if you want to get only pinned dialogs.
|
||||||
@ -55,7 +55,7 @@ class GetDialogs(BaseClient):
|
|||||||
else:
|
else:
|
||||||
r = self.send(
|
r = self.send(
|
||||||
functions.messages.GetDialogs(
|
functions.messages.GetDialogs(
|
||||||
offset_date=offset_dialog.top_message.date if offset_dialog else 0,
|
offset_date=offset_date,
|
||||||
offset_id=0,
|
offset_id=0,
|
||||||
offset_peer=types.InputPeerEmpty(),
|
offset_peer=types.InputPeerEmpty(),
|
||||||
limit=limit,
|
limit=limit,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user