#Error [SHARDING_READY_DIED]: Shard 0's process exited before its Client became ready.
25 messages · Page 1 of 1 (latest)
discord.js -> 13.14
node.js -> v18.8
class Sigma extends Client {
constructor() {
super({
shards: 2,
shardCount: 2,
allowedMentions: {
parse: ["roles", "users", "everyone"],
repliedUser: false
}, //...```
const shard = new ShardingManager('./src/structures/bot.js', {
token: this.token,
totalShards: 2
});
shard.spawn().catch((e) => {console.log(e + `...spawn error`)});```
readdirSync("./src/events/Shards/").forEach(file => {
const event = (`../events/Shards/${file}`);
let eventName = file.split(".")[0];
this.logger.log(`Loading Events Shards ${eventName}`, "event");
shard.on(eventName, event.bind(null, shard));
});```
Why do you have both a ShardingManager and internal sharding settings? They are either-or
Remove shards: and shardCount from client options
hmm okay
same error
at Shard.onDeath (C:\Users\Pro\Documents\GitHub\sigma\node_modules\discord.js\src\sharding\Shard.js:161:16)
at Object.onceWrapper (node:events:628:26)
at Shard.emit (node:events:513:28)
at Shard._handleExit (C:\Users\Pro\Documents\GitHub\sigma\node_modules\discord.js\src\sharding\Shard.js:407:10)
at ChildProcess.emit (node:events:513:28)
at ChildProcess._handle.onexit (node:internal/child_process:291:12) {
[Symbol(code)]: 'SHARDING_READY_DIED'
}```
Can you show your full Sigma class please?
Sure
The Share Code Snippets Tool helps you to easily share code snippets online with your developer friends or colleagues.
And what is your bot.js?
Thats my bot.js
index.js has a simple const client = new Sigma() and client.connect()
Then your ShardingManager should spawn the index.js, not the bot.js
I did that too, nothing changes
Then show your index.js
lets start from scratch, I did some changes, but still nun works
index.js
const Sigma = require("./src/structures/bot");
const on = require('./website/server');
const client = new Sigma();
on(client);
client.connect();
module.exports = client;```
bot.js
shardit.js
const { ShardingManager } = require('discord.js')
module.exports = {
shardit: async function(token, shardCount) {
const shard = new ShardingManager('./src/structures/bot.js', {
token: token,
totalShards: shardCount
});
await shard.spawn().catch((e) => {
console.log(e + `...spawn error`)
});
}
};```
it works perfectly if I host the beta bot
but the verified bot with the 490 servers gets errors