From 40015b798aa478d4e4cfd5633ebfa3cc29f2d5f1 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Tue, 30 Aug 2011 16:13:47 +0100 Subject: [PATCH] pick on spoony, make it dispense user comments on joining the room --- modules/puns.js | 6 +++--- modules/quotes.js | 2 +- modules/youare.js | 2 +- run.js | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/puns.js b/modules/puns.js index 969c399..49b2762 100644 --- a/modules/puns.js +++ b/modules/puns.js @@ -3,10 +3,10 @@ var puns = function(dbot) { return { 'listener': function(data) { - if(data.user == 'Lamp') { - dbot.say(data.channel, dbot.db.quoteArrs.lamp.random()); - } else if(data.user == 'reality') { + if(data.user == 'reality') { dbot.instance.say(data.channel, dbot.db.realiPuns.random()); + } else if(dbot.db.quoteArrs.hasOwnProperty(data.user.toLowerCase())) { + dbot.say(data.channel, data.user + ': ' + dbot.db.quoteArrs[data.user.toLowerCase()].random()); } else if(dbot.instance.inChannel(data.channel)) { dbot.instance.say('aisbot', '.karma ' + data.user); dbot.waitingForKarma = data.channel; diff --git a/modules/quotes.js b/modules/quotes.js index eb02bfa..0f36325 100644 --- a/modules/quotes.js +++ b/modules/quotes.js @@ -63,7 +63,7 @@ var quotes = function(dbot) { '~d': function(data, params) { dbot.say(data.channel, data.user + ': ' + dbot.db.quoteArrs['depressionbot'].random()); - }, + } }; diff --git a/modules/youare.js b/modules/youare.js index 24c2b81..afe2fbd 100644 --- a/modules/youare.js +++ b/modules/youare.js @@ -5,7 +5,7 @@ var youAre = function(dbot) { 'listener': function(data) { var key = data.message.valMatch(/(\bis\b|\bare\b)\s+([\w\s\d]*?)(\s+)?(,|\.|\band\b|$)/, 5); - if(key && key[2] != "" && Number.prototype.chanceIn(1, 10) && data.user != 'aisbot') { + if(key && key[2] != "" && (Number.prototype.chanceIn(1, 10) || data.user == 'Spoony' || data.user == 'iSpoony') && data.user != 'aisbot') { dbot.say(data.channel, data.user + ': You\'re ' + key[2] + '.'); } }, diff --git a/run.js b/run.js index c22e687..b01abd9 100644 --- a/run.js +++ b/run.js @@ -8,7 +8,6 @@ var DBot = function(dModules, quotes) { this.admin = 'reality'; this.waitingForKarma = false; this.name = 'depressionbot'; - this.commands = {}; this.db = JSON.parse(fs.readFileSync('db.json', 'utf-8')); this.instance = jsbot.createJSBot(this.name, 'elara.ivixor.net', 6667, this, function() {