2011-08-25 15:14:08 +02:00
|
|
|
var youAre = function(dbot) {
|
|
|
|
var dbot = dbot;
|
|
|
|
|
|
|
|
return {
|
|
|
|
'listener': function(data) {
|
2011-08-25 18:54:59 +02:00
|
|
|
var key = data.message.valMatch(/(is|are) ([\d\w\s']*)/, 3);
|
2011-08-25 15:17:51 +02:00
|
|
|
|
2011-08-25 18:54:59 +02:00
|
|
|
if(Number.prototype.chanceIn(1, 3) && key) {
|
2011-08-25 15:34:51 +02:00
|
|
|
if(key[2].indexOf('and') !== -1) {
|
|
|
|
key[2] = key[2].split('and')[0];
|
|
|
|
} // TODO: fix the regex to do this. i hate regex
|
|
|
|
|
|
|
|
dbot.say(data.channel, data.user + ': You\'re ' + key[2]);
|
2011-08-25 15:14:08 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
'on': 'PRIVMSG'
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.fetch = function(dbot) {
|
|
|
|
return youAre(dbot);
|
|
|
|
};
|