Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

158
Vistas
Sharding Crashing On Shard 0 Discordjs

I am trying to shard my discord bot in v13, and when I run just the main file (bot.js) on my beta bot without sharding, it works fine, but when I try running it with sharding, It gives this error.

enter image description here

Here is the index.js code where I shard


const { ShardingManager } = require('discord.js');

const manager = new ShardingManager('./bot.js', { token: 'tokenhere' });

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

manager.spawn();

When I try running just bot.js without sharding, it gives the error that says too many guilds on one session, meaning the main file is fine.

Here is the main file code

https://pastebin.com/8JNFxXqY

I don't think there are any errors on this file. Please let me know how to fix this, and how to shard properly

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You are running node . which if I am not mistaken starts all the .js files in the folder you are in.

What happens is that both index.js and bot.js files are started.

You must run ONLY the file where the ShardingManager is, with node index.js.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda