diff --git a/modules/command/command.js b/modules/command/command.js index 1066018..b238ce7 100644 --- a/modules/command/command.js +++ b/modules/command/command.js @@ -25,9 +25,11 @@ var command = function(dbot) { dbot.api.ignore.isUserBanned(event.server, event.user, commandName, function(isBanned) { if(isBanned) { event.reply(dbot.t('command_ban', {'user': event.user})); - } else if(!isIgnoring && - hasAccess && - dbot.commands[commandName].disabled !== true) { + } else if(!hasAccess) { + if(this.config.accessOutput) { + event.reply(dbot.t('access_denied', { 'user': event.user })); + } + } else if(!isIgnoring && !dbot.commands[commandName].disabled) { if(this.api.applyRegex(commandName, event)) { try { var command = dbot.commands[commandName]; @@ -45,7 +47,7 @@ var command = function(dbot) { }); } } - if(commandName != 'reload') dbot.api.event.emit('command', [ event ]); + if(_.include(commandName, ['reload', 'load', 'unload'])) dbot.api.event.emit('command', [ event ]); dbot.save(); } else { if(commandName !== '~') { diff --git a/modules/command/config.json b/modules/command/config.json index ead0df9..3cb33e0 100644 --- a/modules/command/config.json +++ b/modules/command/config.json @@ -1,5 +1,6 @@ { "ignorable": false, "dependencies": [ "event", "ignore", "users" ], - "useNickserv": false + "useNickserv": false, + "accessOutput": false } diff --git a/modules/command/strings.json b/modules/command/strings.json index d13553a..26f1b6c 100644 --- a/modules/command/strings.json +++ b/modules/command/strings.json @@ -36,5 +36,8 @@ "loaded_modules": { "en": "Loaded modules: {modules}.", "nl": "Geladen modules: {modules}." + }, + "access_denied": { + "en": "{user}: You don't have the access level to run this command." } }