Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

161
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!