Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

160
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda