Discord shards problem

Can someone help m with that ? Hello i just asking for help for this Shards problem.
const { ShardingManager } = require('discord.js');

const manager = new ShardingManager('./index.js', {
token: bottoken,
totalShards: 'auto',
respawn: true,
readyTimeout: 240000, // Increase timeout to 10 minutes
});

manager.on('shardCreate', shard => {
console.log(`Launched shard ${shard.id}`);

shard.on('reconnecting', () => {
console.log(`Reconnecting shard: [${shard.id}]`);
});

shard.on('spawn', () => {
console.log(`Spawned shard: [${shard.id}]`);
});

shard.on('ready', () => {
const endTime = Date.now();
console.log(`Shard [${shard.id}] is ready after ${endTime - shard.launchTime}ms`);
});

shard.on('death', () => {
console.log(`Died shard: [${shard.id}]`);
});

shard.on('error', (err) => {
console.log(`Error in [${shard.id}] with: ${err}`);
shard.respawn();
});

shard.launchTime = Date.now();
});

manager.spawn({ amount: 'auto', delay: 60000, timeout: 120000 }) // Increased delay and timeout
.catch(console.error);
const { ShardingManager } = require('discord.js');

const manager = new ShardingManager('./index.js', {
token: bottoken,
totalShards: 'auto',
respawn: true,
readyTimeout: 240000, // Increase timeout to 10 minutes
});

manager.on('shardCreate', shard => {
console.log(`Launched shard ${shard.id}`);

shard.on('reconnecting', () => {
console.log(`Reconnecting shard: [${shard.id}]`);
});

shard.on('spawn', () => {
console.log(`Spawned shard: [${shard.id}]`);
});

shard.on('ready', () => {
const endTime = Date.now();
console.log(`Shard [${shard.id}] is ready after ${endTime - shard.launchTime}ms`);
});

shard.on('death', () => {
console.log(`Died shard: [${shard.id}]`);
});

shard.on('error', (err) => {
console.log(`Error in [${shard.id}] with: ${err}`);
shard.respawn();
});

shard.launchTime = Date.now();
});

manager.spawn({ amount: 'auto', delay: 60000, timeout: 120000 }) // Increased delay and timeout
.catch(console.error);
const ShardingManager = require("./shards.js");
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MEMBERS,
Intents.FLAGS.GUILD_BANS,
Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS,
Intents.FLAGS.GUILD_INTEGRATIONS,
Intents.FLAGS.GUILD_WEBHOOKS,
Intents.FLAGS.GUILD_INVITES,
Intents.FLAGS.GUILD_VOICE_STATES,
Intents.FLAGS.GUILD_PRESENCES,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
Intents.FLAGS.GUILD_MESSAGE_TYPING,
Intents.FLAGS.DIRECT_MESSAGES,
Intents.FLAGS.DIRECT_MESSAGE_REACTIONS,
Intents.FLAGS.DIRECT_MESSAGE_TYPING,
],
shards: "auto"
});
const ShardingManager = require("./shards.js");
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MEMBERS,
Intents.FLAGS.GUILD_BANS,
Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS,
Intents.FLAGS.GUILD_INTEGRATIONS,
Intents.FLAGS.GUILD_WEBHOOKS,
Intents.FLAGS.GUILD_INVITES,
Intents.FLAGS.GUILD_VOICE_STATES,
Intents.FLAGS.GUILD_PRESENCES,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
Intents.FLAGS.GUILD_MESSAGE_TYPING,
Intents.FLAGS.DIRECT_MESSAGES,
Intents.FLAGS.DIRECT_MESSAGE_REACTIONS,
Intents.FLAGS.DIRECT_MESSAGE_TYPING,
],
shards: "auto"
});
The code launch same shard four times then kill the project
8 Replies
d.js toolkit
d.js toolkit6mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by staff
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Kobrà
KobràOP6mo ago
I did it before you response to me
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Kobrà
KobràOP6mo ago
I can't understand anything I am bored wtf I've to use shards auto in the client only ?? Without a shards code ?
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Kobrà
KobràOP6mo ago
okay just thanks for help
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server