3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-25 12:12:35 +01:00

shorter timeout and parse out a

This commit is contained in:
reality 2015-03-31 18:35:19 +00:00
parent 417cc7b5f8
commit b7b57da78a

View File

@ -1,11 +1,11 @@
var april = function(dbot) {
this.listener = function(event) {
var match = event.message.match(/^i'm ([^ ]+)$/i);
var match = event.message.match(/^i'm (a )?([^ ]+)$/i);
if(match && event.channel == '#april') {
dbot.say(event.server, 'operserv', 'svsnick ' + event.user + ' ' + match[1]);
setTimeout(function() {
event.reply('Hi ' + match[1] + ', I\'m tripbot!');
}, 2000);
event.reply('Hi ' + match[2] + ', I\'m tripbot!');
}, 1000);
}
}
this.on = 'PRIVMSG';