'~CATEGORY' now dispatches a '~q CATEGORY' command.

This commit is contained in:
Psychedelic Squid 2012-03-14 13:59:26 +00:00
parent 27baefb6ce
commit a4313ee665

View File

@ -66,8 +66,14 @@ var command = function(dbot) {
} else {
q[1] = q[1].trim();
key = dbot.cleanNick(q[1])
if(dbot.db.quoteArrs.hasOwnProperty(key)) {
dbot.say(data.channel, q[1] + ': ' + dbot.interpolatedQuote(key));
if(dbot.db.quoteArrs.hasOwnProperty(key) && dbot.moduleNames.include('quotes')) {
var params = ['~q'];
key.split(' ').each((function(word) {
this.push(word);
}).bind(params));
data.message = params.join(' ');
dbot.commands[params[0]](data, params);
dbot.save();
} else {
// See if it's similar to anything
var winnerDistance = Infinity;