fix the quote/command correct order thing

This commit is contained in:
reality 2013-08-17 18:13:38 +00:00
parent 52d38aa1e7
commit 6fb7c8e91f
3 changed files with 37 additions and 32 deletions

View File

@ -16,7 +16,12 @@ var command = function(dbot) {
return;
}
if(!_.has(dbot.commands, commandName)) {
if(_.has(dbot.modules, 'spelling')) {
if(_.has(dbot.modules, 'quotes')) {
var key = event.message.substring(1);
dbot.api.quotes.getInterpolatedQuote(event.server, event.channel.name, key, function(quote) {
if(quote) {
event.reply(key + ': ' + quote);
} else if(_.has(dbot.modules, 'spelling')) {
var commands = _.keys(dbot.commands)
winner = false,
closestMatch = Infinity;
@ -33,11 +38,22 @@ var command = function(dbot) {
event.reply(commandName + ' not found. Did you mean ' + winner + '?');
return;
} else if(_.has(dbot.modules, 'quotes')) {
commandName = '~';
dbot.api.link.udLookup(key, function(word, definition) {
if(word) {
event.reply(key + '[UD]: ' + definition);
} else {
event.reply(dbot.t('category_not_found', { 'category': key }));
}
});
} else {
return;
}
} else if(_.has(dbot.modules, 'quotes')) {
}
});
return;
}
else if(_.has(dbot.modules, 'quotes')) {
commandName = '~';
} else {
return;

View File

@ -37,19 +37,9 @@ var commands = function(dbot) {
this.api.getInterpolatedQuote(event.server, event.channel, key, function(quote) {
if(quote) {
event.reply(key + ': ' + quote);
} else {
if(this.config.udFallback === true && _.has(dbot.modules, 'link')) {
dbot.api.link.udLookup(key, function(word, definition) {
if(word) {
event.reply(key + '[UD]: ' + definition);
} else {
event.reply(dbot.t('category_not_found', { 'category': key }));
}
});
} else {
event.reply(dbot.t('category_not_found', { 'category': key }));
}
}
}.bind(this));
},

View File

@ -3,6 +3,5 @@
"dependencies": [ "users", "event" ],
"rmLimit": 10,
"ignorable": true,
"quotesOnJoin": false,
"udFallback": false
"quotesOnJoin": false
}