From a4313ee665e3e7ec5ba19666455b74742f27e1cb Mon Sep 17 00:00:00 2001 From: Psychedelic Squid Date: Wed, 14 Mar 2012 13:59:26 +0000 Subject: [PATCH] '~CATEGORY' now dispatches a '~q CATEGORY' command. --- modules/command.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/command.js b/modules/command.js index 7c23cec..df617bf 100644 --- a/modules/command.js +++ b/modules/command.js @@ -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;