mirror of https://github.com/tqdm/tqdm.git
handle rate limit
This commit is contained in:
parent
670840021d
commit
61365d8321
|
@ -48,8 +48,9 @@ class DiscordIO(MonoWorker):
|
|||
except Exception as e:
|
||||
tqdm_auto.write(str(e))
|
||||
else:
|
||||
if 'id' not in res:
|
||||
warn("Message not sent", TqdmWarning, stacklevel=2)
|
||||
if res.get('error_code') == 429:
|
||||
warn("Creation rate limit: try increasing `mininterval`.",
|
||||
TqdmWarning, stacklevel=2)
|
||||
else:
|
||||
self._message_id = res['id']
|
||||
return self._message_id
|
||||
|
|
Loading…
Reference in New Issue