forked from GitHub/dbot
stagger pend notifies
This commit is contained in:
parent
9a99d5eb47
commit
450ffce0e2
@ -50,10 +50,21 @@ var report = function(dbot) {
|
||||
|
||||
this.listener = function(event) {
|
||||
if(_.has(this.pending, event.rUser.id)) {
|
||||
_.each(this.pending[event.rUser.id], function(message) {
|
||||
dbot.say(event.server, event.rUser.currentNick, message);
|
||||
});
|
||||
var i=0,
|
||||
pending = this.pending[event.rUser.id];
|
||||
|
||||
var notifyUser = function(pending) {
|
||||
if(i >= msg.length) {
|
||||
delete this.pending[event.rUser.id];
|
||||
return;
|
||||
}
|
||||
dbot.say(event.server, pending[i], message);
|
||||
setTimeout(function() {
|
||||
i++; notifyUser(pending);
|
||||
}, 1000);
|
||||
}.bind(this);
|
||||
|
||||
notifyUser(pending);
|
||||
}
|
||||
}.bind(this);
|
||||
this.on = 'JOIN';
|
||||
|
Loading…
Reference in New Issue
Block a user