Fix member lookup in SanitizeEveryoneMaybe
This commit is contained in:
parent
e133bd657d
commit
d0f1aeb548
@ -215,9 +215,8 @@ namespace PluralKit.Bot
|
|||||||
private static async Task<string> SanitizeEveryoneMaybe(DiscordMessage message,
|
private static async Task<string> SanitizeEveryoneMaybe(DiscordMessage message,
|
||||||
string messageContents)
|
string messageContents)
|
||||||
{
|
{
|
||||||
var member = await message.Channel.Guild.GetMemberAsync(message.Author.Id);
|
var permissions = await message.Channel.PermissionsIn(message.Author);
|
||||||
if ((member.PermissionsIn(message.Channel) & Permissions.MentionEveryone) == 0) return messageContents.SanitizeEveryone();
|
return (permissions & Permissions.MentionEveryone) == 0 ? messageContents.SanitizeEveryone() : messageContents;
|
||||||
return messageContents;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<bool> EnsureBotPermissions(DiscordChannel channel)
|
private async Task<bool> EnsureBotPermissions(DiscordChannel channel)
|
||||||
|
Loading…
Reference in New Issue
Block a user