3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-23 20:39:25 +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) { var april = function(dbot) {
this.listener = function(event) { 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') { if(match && event.channel == '#april') {
dbot.say(event.server, 'operserv', 'svsnick ' + event.user + ' ' + match[1]); dbot.say(event.server, 'operserv', 'svsnick ' + event.user + ' ' + match[1]);
setTimeout(function() { setTimeout(function() {
event.reply('Hi ' + match[1] + ', I\'m tripbot!'); event.reply('Hi ' + match[2] + ', I\'m tripbot!');
}, 2000); }, 1000);
} }
} }
this.on = 'PRIVMSG'; this.on = 'PRIVMSG';