3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 14:29:29 +01:00
dbot/modules/april/april.js

17 lines
499 B
JavaScript
Raw Normal View History

2015-03-31 20:29:45 +02:00
var april = function(dbot) {
this.listener = function(event) {
2015-03-31 20:50:44 +02:00
var match = event.message.match(/^i'?( a)?m (an? )?([^ ]+)/i);
2015-03-31 23:42:46 +02:00
if(match) {
2015-03-31 20:51:53 +02:00
dbot.say(event.server, 'operserv', 'svsnick ' + event.user + ' ' + match[3]);
2015-03-31 20:32:18 +02:00
setTimeout(function() {
2015-03-31 23:43:06 +02:00
event.reply('Hi ' + match[3] + ', I\'m ' + dbot.config.name + '!');
2015-03-31 20:35:19 +02:00
}, 1000);
2015-03-31 20:29:45 +02:00
}
}
this.on = 'PRIVMSG';
};
exports.fetch = function(dbot) {
return new april(dbot);
};