Переглянути джерело

[Bugfix] Add sleep when Discord rate limit

Foppe Hemminga 5 роки тому
батько
коміт
4905305c0c
1 змінених файлів з 1 додано та 0 видалено
  1. 1 0
      cron.py

+ 1 - 0
cron.py

@@ -36,6 +36,7 @@ def _send(maintainer, message):
     response = requests.post(discord, json=message_json)
     if response.status_code in [200, 204]:
         print("Webhook executed")
+        sleep(1)
     else:
         print("status code {}: {}".format(response.status_code, response.content.decode("utf-8")))
         time.sleep(10)