-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
executable file
·37 lines (35 loc) · 1.24 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
31
32
33
34
35
36
37
const settings = require("./config.json");
const { ShardingManager } = require('discord.js');
require("dotenv").config();
if (settings.process.noIntro == false) {
console.log();
console.log(
require("fs")
.readFileSync(__dirname + "/tools/phoenixAscii.txt")
.toString(),
);
console.log();
console.log();
console.log("--------------------------------");
console.log(
"Version: %s\nCreated by: Team Custard",
require("./package.json").version,
);
console.log("--------------------------------");
console.log(
`Starting the following services:\n${settings.process.botclient == true ? "Bot client\n" : ""}${settings.process.dashboard == true ? "Web dashboard\n" : ""}`,
);
}
if (settings.process.botclient == true) {
if (settings.process.botmode != "custom") {
const manager = new ShardingManager('./bot.js', { totalShards: 'auto', token: process.env[(settings.process.botmode == "prod" ? "TOKEN" : (settings.process.botmode == "dev" ? "STAGINGTOKEN" : "TESTTOKEN"))] })
.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`))
.spawn();
} else {
require("./bot");
}
}
else if (settings.process.dashboard == true) {
require("./tools/database").connect();
require("./server");
}