Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. dialogs = []
  2. limit = 100    
  3. offset_date = 0
  4. while True:
  5.   try:
  6.     d = app.send(functions.messages.GetDialogs(offset_date=offset_date, offset_id=0, limit=limit, offset_peer=types.InputPeerEmpty()))
  7.   except FloodWait as e:
  8.     time.sleep(e.x)
  9.     logging.error('Код ошибки 420.')
  10.     print("\nПодождите {} секунд(ы)".format(e.x), end='\r', flush=True)
  11.     continue
  12.  
  13.   if not d.dialogs:
  14.     break
  15.  
  16.   dialogs += d.dialogs
  17.   offset_date = d.messages[-1].date
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement