mirror of
https://github.com/reality/dbot.git
synced 2024-11-27 14:29:29 +01:00
stagger joins
This commit is contained in:
parent
964467464c
commit
ad08b24c3e
13
run.js
13
run.js
@ -1,7 +1,8 @@
|
||||
var fs = require('fs'),
|
||||
_ = require('underscore')._,
|
||||
jsbot = require('./jsbot/jsbot'),
|
||||
DatabaseDriver = require('./database').DatabaseDriver;
|
||||
DatabaseDriver = require('./database').DatabaseDriver,
|
||||
async = require('async');
|
||||
require('./snippets');
|
||||
|
||||
var DBot = function() {
|
||||
@ -43,9 +44,13 @@ var DBot = function() {
|
||||
this.instance.addConnection(name, server.server, server.port,
|
||||
this.config.admin, function(event) {
|
||||
var server = this.config.servers[event.server];
|
||||
for(var i=0;i<server.channels.length;i++) {
|
||||
this.instance.join(event, server.channels[i]);
|
||||
}
|
||||
|
||||
async.eachSeries(server.channels, function(channel, next) {
|
||||
setTimeout(function() {
|
||||
this.instance.join(event, channel);
|
||||
next();
|
||||
}.bind(this), 5000);
|
||||
}.bind(this));
|
||||
}.bind(this), server.nickserv, server.password);
|
||||
}, this);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user