From d0f1aeb54807fd7f24cfda5e177a80cb1599afdb Mon Sep 17 00:00:00 2001 From: Ske Date: Fri, 1 May 2020 17:03:43 +0200 Subject: [PATCH] Fix member lookup in SanitizeEveryoneMaybe --- PluralKit.Bot/Services/ProxyService.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PluralKit.Bot/Services/ProxyService.cs b/PluralKit.Bot/Services/ProxyService.cs index c9e623e0..31d3ccbe 100644 --- a/PluralKit.Bot/Services/ProxyService.cs +++ b/PluralKit.Bot/Services/ProxyService.cs @@ -215,9 +215,8 @@ namespace PluralKit.Bot private static async Task SanitizeEveryoneMaybe(DiscordMessage message, string messageContents) { - var member = await message.Channel.Guild.GetMemberAsync(message.Author.Id); - if ((member.PermissionsIn(message.Channel) & Permissions.MentionEveryone) == 0) return messageContents.SanitizeEveryone(); - return messageContents; + var permissions = await message.Channel.PermissionsIn(message.Author); + return (permissions & Permissions.MentionEveryone) == 0 ? messageContents.SanitizeEveryone() : messageContents; } private async Task EnsureBotPermissions(DiscordChannel channel)