3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 22:39:26 +01:00
dbot/modules/youare.js

20 lines
456 B
JavaScript
Raw Normal View History

2011-08-25 15:14:08 +02:00
var youAre = function(dbot) {
var dbot = dbot;
return {
'listener': function(data) {
2011-08-25 21:34:39 +02:00
var key = data.message.match(/(\bis\b|\bare\b)\s+([\w\s\d]*?)(\s+)?(,|\.|\band\b|$)/);
2011-08-25 15:34:51 +02:00
2011-08-25 21:34:39 +02:00
if(key && Number.prototype.chanceIn(1, 3)) {
2011-08-25 15:34:51 +02:00
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);
};