-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.js
35 lines (26 loc) · 813 Bytes
/
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
31
32
33
34
35
const Teamspeak = require('./teamspeak');
const Steam = require('./steam');
const database = require("./database");
const fs = require('fs');
const logDir = "logs";
//Check if logs dir exists
if(!fs.existsSync(logDir))
{
fs.mkdirSync(logDir);
}
//Check if config exists
if(!fs.existsSync("config/config.js")){
if(fs.existsSync("config/config.js.example")){
fs.copyFileSync("config/config.js.example", "config/config.js");
}
console.log("The bot was not configured! Please configure it properly and then try again!");
process.exit(1);
}
if(!database.checkIfDatabaseIsOnline()){
console.log("Could not connect to database! Please check config and database!");
process.exit(1);
}
let ts = new Teamspeak();
let steam = new Steam();
steam.startSteam();
ts.startTeamspeak();