-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsharder.js
34 lines (28 loc) · 815 Bytes
/
sharder.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
const { token } = require("./src/config.js");
const { ShardingManager } = require("discord.js");
const manager = new ShardingManager("./src/index.js", {
respawn: true,
autoSpawn: true,
token: token,
totalShards: 1,
shardList: "auto",
});
manager
.spawn({ amount: manager.totalShards, delay: null, timeout: -1 })
.then((shards) => {
console.log(`[CLIENT] ${shards.size} shard(s) spawned.`);
})
.catch((err) => {
console.log("[CLIENT] An error has occurred :", err);
});
manager.on("shardCreate", (shard) => {
shard.on("ready", () => {
console.log(`[CLIENT] Shard ${shard.id} connected to Discord's Gateway.`);
});
});
/*
* Modified By Gamer CodeX
* Discord username - ray.dev
* Youtube - https://www.youtube.com/@GamerCodeX
* Discord Server - https://dsc.gg/codexdev
*/