From d657e9813ddf9f6a991a55bf3cca7c194f697fb0 Mon Sep 17 00:00:00 2001 From: Ske Date: Sat, 23 May 2020 01:51:02 +0200 Subject: [PATCH] Properly handle executing missing webhooks --- PluralKit.Bot/Services/WebhookExecutorService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Services/WebhookExecutorService.cs b/PluralKit.Bot/Services/WebhookExecutorService.cs index bc27dd6d..f398fa90 100644 --- a/PluralKit.Bot/Services/WebhookExecutorService.cs +++ b/PluralKit.Bot/Services/WebhookExecutorService.cs @@ -89,7 +89,8 @@ namespace PluralKit.Bot } catch (NotFoundException e) { - if (e.JsonMessage != null && e.JsonMessage.Contains("10015") && !hasRetried) + var errorText = e.WebResponse?.Response; + if (errorText != null && errorText.Contains("10015") && !hasRetried) { // Error 10015 = "Unknown Webhook" - this likely means the webhook was deleted // but is still in our cache. Invalidate, refresh, try again