From a08e904ea674f40148a42ed5d6289479a9039609 Mon Sep 17 00:00:00 2001 From: Psychedelic Squid Date: Wed, 14 Mar 2012 14:20:59 +0000 Subject: [PATCH] Puns also changed to dispatch a '~q' --- modules/puns.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/puns.js b/modules/puns.js index 8578129..2b591ed 100644 --- a/modules/puns.js +++ b/modules/puns.js @@ -3,10 +3,14 @@ var puns = function(dbot) { return { 'listener': function(data) { - if(data.user == 'reality') { - dbot.instance.say(data.channel, dbot.interpolatedQuote('realityonce')); - } else if(dbot.db.quoteArrs.hasOwnProperty(data.user.toLowerCase())) { - dbot.say(data.channel, data.user + ': ' + dbot.interpolatedQuote(data.user.toLowerCase())); + if(dbot.moduleNames.include('quotes')) { + if(data.user == 'reality') { + data.message = '~q realityonce'; + } else if(dbot.db.quoteArrs.hasOwnProperty(data.user.toLowerCase())) { + data.message = '~q ' + data.user.toLowerCase(); + } + var params = data.message.split(' '); + dbot.commands[params[0]](data, params); } },