fix cbl and cubl commands

added verification on cubl
This commit is contained in:
MasterDomino 2016-08-05 20:56:41 +02:00
parent 4fba9041c2
commit 9f68416ad3

View File

@ -726,7 +726,7 @@ namespace NadekoBot.Modules.Permissions
{ {
if (!e.Message.MentionedChannels.Any()) return; if (!e.Message.MentionedChannels.Any()) return;
var ch = e.Message.MentionedChannels.First(); var ch = e.Message.MentionedChannels.First();
NadekoBot.Config.UserBlacklist.Add(ch.Id); NadekoBot.Config.ChannelBlacklist.Add(ch.Id);
await ConfigHandler.SaveConfig().ConfigureAwait(false); await ConfigHandler.SaveConfig().ConfigureAwait(false);
await e.Channel.SendMessage($"`Sucessfully blacklisted channel {ch.Name}`").ConfigureAwait(false); await e.Channel.SendMessage($"`Sucessfully blacklisted channel {ch.Name}`").ConfigureAwait(false);
}).ConfigureAwait(false); }).ConfigureAwait(false);
@ -741,9 +741,14 @@ namespace NadekoBot.Modules.Permissions
{ {
if (!e.Message.MentionedChannels.Any()) return; if (!e.Message.MentionedChannels.Any()) return;
var ch = e.Message.MentionedChannels.First(); var ch = e.Message.MentionedChannels.First();
NadekoBot.Config.UserBlacklist.Remove(ch.Id); if (NadekoBot.Config.ChannelBlacklist.Contains(ch.Id))
await ConfigHandler.SaveConfig().ConfigureAwait(false); {
await e.Channel.SendMessage($"`Sucessfully blacklisted channel {ch.Name}`").ConfigureAwait(false); NadekoBot.Config.ChannelBlacklist.Remove(ch.Id);
await ConfigHandler.SaveConfig().ConfigureAwait(false);
await e.Channel.SendMessage($"`Sucessfully unblacklisted channel {ch.Name}`").ConfigureAwait(false);
}
else
await e.Channel.SendMessage($"`{ch.Name} was not in blacklist`").ConfigureAwait(false);
}).ConfigureAwait(false); }).ConfigureAwait(false);
}); });