pick on spoony, make it dispense user comments on joining the room

This commit is contained in:
Luke Slater 2011-08-30 16:13:47 +01:00
parent 62d513b8c0
commit 40015b798a
4 changed files with 5 additions and 6 deletions

View File

@ -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;

View File

@ -63,7 +63,7 @@ var quotes = function(dbot) {
'~d': function(data, params) {
dbot.say(data.channel, data.user + ': ' + dbot.db.quoteArrs['depressionbot'].random());
},
}
};

View File

@ -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] + '.');
}
},

1
run.js
View File

@ -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() {