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

15 lines
442 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-05-17 19:04:19 +02:00
if(key && key[2] != "" && (Math.floor(Math.random() * (101)) / 1) == 1) {
2013-01-15 16:43:02 +01:00
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);
};