-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.js
33 lines (25 loc) · 972 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
const { shard, database } = require("./structures/configuration/index");
if (shard) {
const { ShardingManager, ShardEvents } = require("discord.js");
const { clientToken } = require("./structures/configuration/index");
const manager = new ShardingManager("./structures/Client.js", {
token: clientToken,
totalShards: "auto",
});
manager.on("shardCreate", shard => console.log(`\n🟨 Launched shard ${shard.id}`))
manager.on(ShardEvents.Error, (shard) => {
console.log(`🟥 Shard ${shard.id} encountered an error: ${error.message}`);
})
manager.on(ShardEvents.Reconnecting, (shard) => {
console.log(`🟨 Shard ${shard.id} is reconnecting...`);
})
manager.on(ShardEvents.Death, (shard) => {
console.log(`🟥 Shard ${shard.id} has died`);
})
manager.spawn()
} else {
require("./structures/Client")
}
if (database) {
require("./structures/database/connect").connect()
}