3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-01 00:19:29 +01:00

'~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 { } else {
q[1] = q[1].trim(); q[1] = q[1].trim();
key = dbot.cleanNick(q[1]) key = dbot.cleanNick(q[1])
if(dbot.db.quoteArrs.hasOwnProperty(key)) { if(dbot.db.quoteArrs.hasOwnProperty(key) && dbot.moduleNames.include('quotes')) {
dbot.say(data.channel, q[1] + ': ' + dbot.interpolatedQuote(key)); 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 { } else {
// See if it's similar to anything // See if it's similar to anything
var winnerDistance = Infinity; var winnerDistance = Infinity;