forked from 1Tsubasa/Advanced-Discord-Handler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
29 lines (27 loc) · 971 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
const { ShardingManager } = require('discord.js')
const config = require("./structures/config/index")
if (config.sharding) {
const manager = new ShardingManager('./main.js', { token: config.token, respawn: true, totalShards: "auto" })
manager.on('shardCreate', (shard) => {
shard.on("ready", () => {
console.log(`[SHARD] : ${shard.id + 1 } est prêt ! `);
})
shard.on("disconnect", (event) => {
console.log(`[SHARD] : ${shard.id} est déconnecté! `);
console.log(event);
})
shard.on("reconnecting", (event) => {
console.log(`[SHARD] : ${shard.id} est en reconnection! `);
console.log(event);
})
shard.on("error", (event) => {
console.log(`[SHARD] : ${shard.id} a rencontré une erreur! `);
console.log(event);
})
})
manager.spawn({
delay: 10000
})
} else {
require("./main.js")
}