Swallow 404 when deleting proxied message

This commit is contained in:
Ske 2019-07-15 21:36:12 +02:00
parent d47e7e7a06
commit 6668cd8d2d

View File

@ -8,6 +8,7 @@ using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using Dapper; using Dapper;
using Discord; using Discord;
using Discord.Net;
using Discord.Webhook; using Discord.Webhook;
using Discord.WebSocket; using Discord.WebSocket;
@ -106,7 +107,11 @@ namespace PluralKit.Bot
// Wait a second or so before deleting the original message // Wait a second or so before deleting the original message
await Task.Delay(1000); 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<bool> EnsureBotPermissions(ITextChannel channel) private async Task<bool> EnsureBotPermissions(ITextChannel channel)