From 60018bf69d374c70441efc67ebd1c1f602eb8f81 Mon Sep 17 00:00:00 2001 From: Ske Date: Sat, 9 May 2020 15:51:26 +0200 Subject: [PATCH] Don't send ping message if bot doesn't have permissions --- PluralKit.Bot/Services/ProxyService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Services/ProxyService.cs b/PluralKit.Bot/Services/ProxyService.cs index f56b6a51..cf28b1d7 100644 --- a/PluralKit.Bot/Services/ProxyService.cs +++ b/PluralKit.Bot/Services/ProxyService.cs @@ -268,8 +268,9 @@ namespace PluralKit.Bot private async Task HandleMessagePingByReaction(MessageReactionAddEventArgs args) { - // Bail in DMs + // Bail in DMs or if we don't have send permission if (args.Channel.Type != ChannelType.Text) return; + if (!args.Channel.BotHasAllPermissions(Permissions.SendMessages)) return; // Find the message in the DB var msg = await _data.GetMessage(args.Message.Id);