feat(bot): ignore 409 responses from discord

This commit is contained in:
spiral 2022-12-14 14:51:32 +00:00
parent a70b6f31fc
commit c22de98271
No known key found for this signature in database
GPG Key ID: 244A11E4B0BCF40E

View File

@ -1,3 +1,4 @@
using System.Net;
using System.Net.Sockets;
using Myriad.Rest.Exceptions;
@ -40,6 +41,9 @@ public static class MiscUtils
// 5xxs? also not our problem :^)
if (e is UnknownDiscordRequestException udre && (int)udre.StatusCode >= 500) return false;
// 409s apparently happen for Discord internal issues.
if (e is UnknownDiscordRequestException udre2 && udre2.StatusCode == HttpStatusCode.Conflict) return false;
// Webhook server errors are also *not our problem*
// (this includes rate limit errors, WebhookRateLimited is a subclass)
if (e is WebhookExecutionErrorOnDiscordsEnd) return false;