Added fix to possible None comparison on HTTP status check

This commit is contained in:
Frisk 2022-02-24 07:16:43 +01:00
parent 1247e5f408
commit 23b5a5db1c
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC

View file

@ -116,6 +116,9 @@ def handle_discord_http(code, formatted_embed, result):
"Discord have trouble processing the event, and because the HTTP code returned is {} it means we blame them.".format(
code))
return 3
else:
logger.error("There was an unexpected HTTP code returned from Discord: {}".format(code))
return 1
def update_ratelimit(request):
@ -183,5 +186,5 @@ def send_to_discord(data: Optional[DiscordMessage], meta: DiscordMessageMetadata
elif code == 2:
time.sleep(5.0)
messagequeue.add_message((data, meta))
elif code < 2:
elif code is None or code < 2:
pass