mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
Rename get_dialogs
This commit is contained in:
parent
52f1f390ca
commit
1d7c857e9f
@ -235,7 +235,7 @@ class Client(Methods, BaseClient):
|
|||||||
self.get_contacts()
|
self.get_contacts()
|
||||||
else:
|
else:
|
||||||
self.send(functions.messages.GetPinnedDialogs())
|
self.send(functions.messages.GetPinnedDialogs())
|
||||||
self.get_dialogs_chunk(0)
|
self.get_initial_dialogs_chunk()
|
||||||
else:
|
else:
|
||||||
self.send(functions.updates.GetState())
|
self.send(functions.updates.GetState())
|
||||||
|
|
||||||
@ -978,7 +978,7 @@ class Client(Methods, BaseClient):
|
|||||||
indent=4
|
indent=4
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_dialogs_chunk(self, offset_date):
|
def get_initial_dialogs_chunk(self, offset_date: int = 0):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
r = self.send(
|
r = self.send(
|
||||||
@ -1001,14 +1001,14 @@ class Client(Methods, BaseClient):
|
|||||||
def get_initial_dialogs(self):
|
def get_initial_dialogs(self):
|
||||||
self.send(functions.messages.GetPinnedDialogs())
|
self.send(functions.messages.GetPinnedDialogs())
|
||||||
|
|
||||||
dialogs = self.get_dialogs_chunk(0)
|
dialogs = self.get_initial_dialogs_chunk()
|
||||||
offset_date = utils.get_offset_date(dialogs)
|
offset_date = utils.get_offset_date(dialogs)
|
||||||
|
|
||||||
while len(dialogs.dialogs) == self.DIALOGS_AT_ONCE:
|
while len(dialogs.dialogs) == self.DIALOGS_AT_ONCE:
|
||||||
dialogs = self.get_dialogs_chunk(offset_date)
|
dialogs = self.get_initial_dialogs_chunk(offset_date)
|
||||||
offset_date = utils.get_offset_date(dialogs)
|
offset_date = utils.get_offset_date(dialogs)
|
||||||
|
|
||||||
self.get_dialogs_chunk(0)
|
self.get_initial_dialogs_chunk()
|
||||||
|
|
||||||
def resolve_peer(self, peer_id: int or str):
|
def resolve_peer(self, peer_id: int or str):
|
||||||
"""Use this method to get the *InputPeer* of a known *peer_id*.
|
"""Use this method to get the *InputPeer* of a known *peer_id*.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user