random checks

This commit is contained in:
Master Kwoth 2016-03-14 15:41:23 +01:00
parent 1e679ff0c6
commit 5593664df5

View File

@ -29,6 +29,9 @@ namespace NadekoBot.Classes.Permissions {
public bool CanRun(Command command, User user, Channel channel, out string error) { public bool CanRun(Command command, User user, Channel channel, out string error) {
error = String.Empty; error = String.Empty;
if (channel.IsPrivate || channel.Server == null)
return command.Category == "Help";
if (ConfigHandler.IsUserBlacklisted(user.Id) || if (ConfigHandler.IsUserBlacklisted(user.Id) ||
(!channel.IsPrivate && (!channel.IsPrivate &&
(ConfigHandler.IsServerBlacklisted(channel.Server.Id) || ConfigHandler.IsChannelBlacklisted(channel.Id)))) { (ConfigHandler.IsServerBlacklisted(channel.Server.Id) || ConfigHandler.IsChannelBlacklisted(channel.Id)))) {
@ -38,9 +41,6 @@ namespace NadekoBot.Classes.Permissions {
if (timeBlackList.ContainsKey(user)) if (timeBlackList.ContainsKey(user))
return false; return false;
if (channel.IsPrivate)
return command.Category == "Help";
timeBlackList.TryAdd(user, DateTime.Now); timeBlackList.TryAdd(user, DateTime.Now);
try { try {