ole113
ole113
DIAdiscord.js - Imagine an app
Created by ole113 on 9/20/2023 in #djs-questions
Shard 0's process exited before its Client became ready
const { ShardingManager } = require("discord.js");
const { token } = require("../config.json")

const manager = new ShardingManager(`${__dirname}/main.js`, {
totalShards: "auto",
token: token,
spawnTimeout: -1,
respawn: true
});

manager.on("shardCreate", shard => {
shard.on("reconnecting", () => {
console.log(`[INFO]: Reconnecting shard [${shard.id}]`);
});
shard.on("spawn", () => {
console.log(`[INFO]: Spawned shard [${shard.id}]`);
});
shard.on("ready", () => {
console.log(`[INFO]: Shard [${shard.id}] is ready!`);
});
shard.on("death", () => {
console.log(`[INFO]: Shard [${shard.id}] died`);
});
shard.on("error", (err) => {
console.log(`[INFO]: Error in [${shard.id}]\n[ERR]: ${err}`)
shard.respawn();
})
})

manager.spawn(manager.totalShards, 15000, -1)
.then(res => {
console.log("[STARTUP]: Roast-Bot is ready!");
})
.catch(e => console.log(e));
const { ShardingManager } = require("discord.js");
const { token } = require("../config.json")

const manager = new ShardingManager(`${__dirname}/main.js`, {
totalShards: "auto",
token: token,
spawnTimeout: -1,
respawn: true
});

manager.on("shardCreate", shard => {
shard.on("reconnecting", () => {
console.log(`[INFO]: Reconnecting shard [${shard.id}]`);
});
shard.on("spawn", () => {
console.log(`[INFO]: Spawned shard [${shard.id}]`);
});
shard.on("ready", () => {
console.log(`[INFO]: Shard [${shard.id}] is ready!`);
});
shard.on("death", () => {
console.log(`[INFO]: Shard [${shard.id}] died`);
});
shard.on("error", (err) => {
console.log(`[INFO]: Error in [${shard.id}]\n[ERR]: ${err}`)
shard.respawn();
})
})

manager.spawn(manager.totalShards, 15000, -1)
.then(res => {
console.log("[STARTUP]: Roast-Bot is ready!");
})
.catch(e => console.log(e));
7 replies
DIAdiscord.js - Imagine an app
Created by ole113 on 9/20/2023 in #djs-questions
Shard 0's process exited before its Client became ready
No description
7 replies