-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.js
30 lines (27 loc) · 1.04 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Referencing other files.
var loggingFuncs = require('./lib/logging');
var globalVars = require('./lib/global-vars');
var init = require('./lib/init');
var hostingFuncs = require('./lib/hosting');
var chatCommandFuncs = require('./lib/chat-commands');
var githubAPI = require('./lib/github-api');
loggingFuncs.logMessage(null, 'Starting up (version ' + globalVars.version + ').');
githubAPI.checkForNewVersion();
// Does the initial connection and setting up stuff.
init.setUp(function(autoStartList) {
loggingFuncs.logMessage(null, 'All teams set up and connected.');
// Goes through all of the teams at the start to kick things off; will start the hosting if set to do this.
for (var team in globalVars.channels) {
if (globalVars.channels.hasOwnProperty(team)) {
globalVars.adminCommandsActive[team] = true;
chatCommandFuncs.setUpListening(team);
if (autoStartList.indexOf(team) >= 0) {
hostingFuncs.turnOnHosting(team, function(error, message) {
if (!error) {
// could send the message at some point
}
});
}
}
}
});