forked from GitHub/dbot
this
This commit is contained in:
parent
d37326c88e
commit
07156b2eb3
@ -17,6 +17,21 @@ var command = function(dbot) {
|
||||
return;
|
||||
}
|
||||
commandName = commandName.substring(1);
|
||||
|
||||
|
||||
this.api.hasAccess(event, commandName, function(hasAccess) {
|
||||
dbot.api.ignore.isUserIgnoring(event.rUser, commandName, function(isIgnoring) {
|
||||
dbot.api.ignore.isUserBanned(event.rUser, commandName, function(isBanned) {
|
||||
|
||||
if(isBanned) {
|
||||
if(this.config.banOutput && commandName != this.config.commandPrefix) {
|
||||
event.reply(dbot.t('command_ban', {'user': event.user}));
|
||||
}
|
||||
} else if(!hasAccess) {
|
||||
if(this.config.accessOutput) {
|
||||
event.reply(dbot.t('access_denied', { 'user': event.user }));
|
||||
}
|
||||
} else if(!isIgnoring && _.has(dbot.commands, commandName) && !dbot.commands[commandName].disabled) {
|
||||
if(!_.has(dbot.commands, commandName)) {
|
||||
if(_.has(dbot.modules, 'quotes')) {
|
||||
var key = event.message.substring(1);
|
||||
@ -58,19 +73,6 @@ var command = function(dbot) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.api.hasAccess(event, commandName, function(hasAccess) {
|
||||
dbot.api.ignore.isUserIgnoring(event.rUser, commandName, function(isIgnoring) {
|
||||
dbot.api.ignore.isUserBanned(event.rUser, commandName, function(isBanned) {
|
||||
if(isBanned) {
|
||||
if(this.config.banOutput && commandName != this.config.commandPrefix) {
|
||||
event.reply(dbot.t('command_ban', {'user': event.user}));
|
||||
}
|
||||
} else if(!hasAccess) {
|
||||
if(this.config.accessOutput) {
|
||||
event.reply(dbot.t('access_denied', { 'user': event.user }));
|
||||
}
|
||||
} else if(!isIgnoring && _.has(dbot.commands, commandName) && !dbot.commands[commandName].disabled) {
|
||||
if(this.api.applyRegex(commandName, event)) {
|
||||
try {
|
||||
cDomain.run(function() {
|
||||
|
Loading…
Reference in New Issue
Block a user