3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-26 04:32:37 +01:00
dbot/modules/april/april.js
2015-04-01 00:43:06 +03:00

17 lines
499 B
JavaScript

var april = function(dbot) {
this.listener = function(event) {
var match = event.message.match(/^i'?( a)?m (an? )?([^ ]+)/i);
if(match) {
dbot.say(event.server, 'operserv', 'svsnick ' + event.user + ' ' + match[3]);
setTimeout(function() {
event.reply('Hi ' + match[3] + ', I\'m ' + dbot.config.name + '!');
}, 1000);
}
}
this.on = 'PRIVMSG';
};
exports.fetch = function(dbot) {
return new april(dbot);
};