mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 12:51:18 +00:00
Handle GetDialogs FloodWait errors
This commit is contained in:
parent
6783d7b16f
commit
403a37692c
@ -495,12 +495,17 @@ class Client:
|
||||
log.info("Dialogs count: {}".format(len(peers)))
|
||||
|
||||
while len(dialogs.dialogs) == self.DIALOGS_AT_ONCE:
|
||||
dialogs = self.send(
|
||||
functions.messages.GetDialogs(
|
||||
offset_date, 0, types.InputPeerEmpty(),
|
||||
self.DIALOGS_AT_ONCE, True
|
||||
try:
|
||||
dialogs = self.send(
|
||||
functions.messages.GetDialogs(
|
||||
offset_date, 0, types.InputPeerEmpty(),
|
||||
self.DIALOGS_AT_ONCE, True
|
||||
)
|
||||
)
|
||||
)
|
||||
except FloodWait as e:
|
||||
log.info("Get dialogs flood wait: {}".format(e.x))
|
||||
time.sleep(e.x)
|
||||
continue
|
||||
|
||||
offset_date = parse_dialogs(dialogs)
|
||||
log.info("Dialogs count: {}".format(len(peers)))
|
||||
|
Loading…
Reference in New Issue
Block a user