diff --git a/PluralKit.Bot/PluralKit.Bot.csproj b/PluralKit.Bot/PluralKit.Bot.csproj index 63a42bde..354bcee8 100644 --- a/PluralKit.Bot/PluralKit.Bot.csproj +++ b/PluralKit.Bot/PluralKit.Bot.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/PluralKit.Bot/Utils/DiscordUtils.cs b/PluralKit.Bot/Utils/DiscordUtils.cs index 47cde49d..03fcbf2d 100644 --- a/PluralKit.Bot/Utils/DiscordUtils.cs +++ b/PluralKit.Bot/Utils/DiscordUtils.cs @@ -106,12 +106,9 @@ namespace PluralKit.Bot return input?.Replace("%20", "+"); } - // Passing an empty list (counter-intuitively) *allows* all mentions through (even if non-null) - // So we add a single "bogus" user mention for ID=1 that'll never actually resolve, and thus block all (other) mentions - private static readonly IEnumerable DenyAllMentions = new IMention[] {new UserMention(1)}; - public static Task SendMessageFixedAsync(this DiscordChannel channel, string content = null, DiscordEmbed embed = null, IEnumerable mentions = null) => - channel.SendMessageAsync(content, embed: embed, mentions: mentions ?? DenyAllMentions); + // Passing an empty list blocks all mentions by default (null allows all through) + channel.SendMessageAsync(content, embed: embed, mentions: mentions ?? new IMention[0]); // This doesn't do anything by itself (DiscordMember.SendMessageAsync doesn't take a mentions argument) // It's just here for consistency so we don't use the standard SendMessageAsync method >.>