From 1c2ebdc6585510a837b7ded118176202bb567f79 Mon Sep 17 00:00:00 2001 From: Ske Date: Sat, 13 Jun 2020 19:19:13 +0200 Subject: [PATCH] Fix proxy blacklist command --- PluralKit.Bot/Commands/ServerConfig.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PluralKit.Bot/Commands/ServerConfig.cs b/PluralKit.Bot/Commands/ServerConfig.cs index 028da9b4..95e63e85 100644 --- a/PluralKit.Bot/Commands/ServerConfig.cs +++ b/PluralKit.Bot/Commands/ServerConfig.cs @@ -75,7 +75,7 @@ namespace PluralKit.Bot (logChannel == null ? $"\n{Emojis.Warn} Please note that no logging channel is set, so there is nowhere to log messages to. You can set a logging channel using `pk;log channel #your-log-channel`." : "")); } - public async Task SetBlacklisted(Context ctx, bool onBlacklist) + public async Task SetBlacklisted(Context ctx, bool shouldAdd) { ctx.CheckGuildContext().CheckAuthorPermission(Permissions.ManageGuild, "Manage Server"); @@ -94,15 +94,15 @@ namespace PluralKit.Bot { var guild = await conn.QueryOrInsertGuildConfig(ctx.Guild.Id); var blacklist = guild.Blacklist.ToHashSet(); - if (onBlacklist) - blacklist.ExceptWith(affectedChannels.Select(c => c.Id)); - else + if (shouldAdd) blacklist.UnionWith(affectedChannels.Select(c => c.Id)); + else + blacklist.ExceptWith(affectedChannels.Select(c => c.Id)); await conn.ExecuteAsync("update servers set blacklist = @Blacklist where id = @Id", new {ctx.Guild.Id, Blacklist = blacklist.ToArray()}); } - await ctx.Reply($"{Emojis.Success} Channels {(onBlacklist ? "added to" : "removed from")} the proxy blacklist."); + await ctx.Reply($"{Emojis.Success} Channels {(shouldAdd ? "added to" : "removed from")} the proxy blacklist."); } public async Task SetLogCleanup(Context ctx)