From 6668cd8d2d60834d003735b572477f2062d77e25 Mon Sep 17 00:00:00 2001 From: Ske Date: Mon, 15 Jul 2019 21:36:12 +0200 Subject: [PATCH] Swallow 404 when deleting proxied message --- PluralKit.Bot/Services/ProxyService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Services/ProxyService.cs b/PluralKit.Bot/Services/ProxyService.cs index 0c099224..6efcb5d1 100644 --- a/PluralKit.Bot/Services/ProxyService.cs +++ b/PluralKit.Bot/Services/ProxyService.cs @@ -8,6 +8,7 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using Dapper; using Discord; +using Discord.Net; using Discord.Webhook; using Discord.WebSocket; @@ -106,7 +107,11 @@ namespace PluralKit.Bot // Wait a second or so before deleting the original message await Task.Delay(1000); - await message.DeleteAsync(); + + try + { + await message.DeleteAsync(); + } catch (HttpException) {} // If it's already deleted, we just swallow the exception } private async Task EnsureBotPermissions(ITextChannel channel)