From fa4495326f13b4109686d6190883e9e9048958ba Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Wed, 17 Aug 2011 17:31:22 +0100 Subject: [PATCH] ~qcount command --- run.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/run.js b/run.js index a939809..1dc0335 100644 --- a/run.js +++ b/run.js @@ -89,7 +89,9 @@ instance.addListener('PRIVMSG', function(data) { }); instance.addListener('PRIVMSG', function(data) { - if(instance.inChannel(data.channel) && data.message.startsWith('~')) { + if(data.channel == name) data.channel = data.user; + + if(data.message.startsWith('~')) { var params = data.message.split(' '); switch(params[0]) { case '~kc': @@ -130,6 +132,14 @@ instance.addListener('PRIVMSG', function(data) { instance.say(data.channel, 'Burn the invalid syntax!'); } break; + case '~qcount': + var qcount = data.message.match(/~qcount ([\d\w\s]*)/)[1].trim(); + if(db.quoteArrs[qcount] != undefined) { + instance.say(data.channel, qcount + ' has ' + db.quoteArrs[qcount].length + ' quotes.'); + } else { + instance.say(data.channel, qcount + ' doesn\'t exist.'); + } + break; case '~lamp': instance.say(data.channel, db.lampPuns.random()); break;