3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-28 06:49:25 +01:00
dbot/modules/youare/youare.js

15 lines
457 B
JavaScript
Raw Normal View History

var youAre = function(dbot) {
2013-01-15 16:43:02 +01:00
this.listener = function(event) {
var key = event.message.valMatch(/(\bis\b|\bare\b)\s+([\w\s\d]*?)(\s+)?(,|\.|\band\b|$)/, 5);
2013-01-15 16:43:02 +01:00
if(key && key[2] != "" && Number.prototype.chanceIn(1, 100) && event.user != 'aisbot') {
event.reply(event.user + ': You\'re ' + key[2] + '.');
}
}.bind(this);
this.on = 'PRIVMSG';
};
exports.fetch = function(dbot) {
2013-01-15 16:43:02 +01:00
return new youAre(dbot);
};