random checks
This commit is contained in:
parent
1e679ff0c6
commit
5593664df5
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user