Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dialogs = []
- limit = 100
- offset_date = 0
- while True:
- try:
- d = app.send(functions.messages.GetDialogs(offset_date=offset_date, offset_id=0, limit=limit, offset_peer=types.InputPeerEmpty()))
- except FloodWait as e:
- time.sleep(e.x)
- logging.error('Код ошибки 420.')
- print("\nПодождите {} секунд(ы)".format(e.x), end='\r', flush=True)
- continue
- if not d.dialogs:
- break
- dialogs += d.dialogs
- offset_date = d.messages[-1].date
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement