Sharding Client To Long to be Ready Error
I am creating a Discord Bot using Discord.js v14.15.3. Along with Node.js v18.18.2.
I am currently trying to implement sharding into the project, but I get his error message when ever I run the bot. I get this before the bot goes online.
Error
My current codebase that is related to sharding is two files, an
index.js
and a bot.js
.
Index.js: https://pastebin.com/zsik23wV
Bot.js: https://pastebin.com/BttCCnpN
Now, if there is anything else I can provide please let me know.
@Qjuh, this is the post. Just pinging you because you told me to make it.Pastebin
const Discord = require('discord.js');const fs = require('fs');cons...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
const Discord = require('discord.js');const fs = require('fs');cons...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
21 Replies
- 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 OPAlready included all of these.
this part, amount should be totalShards afaik
not sure if its the sole issue but just skimming through real quick :thumb:
also, youre using a lot of intents, do you need every single one?
For the intents, yes I will be needed all of them. Also what do you mean by it should be totalShards?
discord.js
discord.js
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
:class: ShardingManager
@14.15.3
This is a utility class that makes multi-process sharding of a bot an easy and painless experience. It works by spawning a self-contained ChildProcess or Worker for each individual shard, each containing its own instance of your bot's Client. They all have a line of communication with the master process, and there are several useful methods that utilise it in order to simplify tasks that are normally difficult with sharding. It can spawn a specific number of shards or the amount that Discord suggests for the bot, and takes a path to your main bot script to launch for each one.ah, that wasn't what i meant to do, my bad for the duplicate
I am confused, I know what it is but what should I be doing.
sorry, my bad, i totally misunderstood/got myself lost :DyanSigh:
this is redundant:
also, are there any other errors before/after the timeout?
there's a lot going on before any of your shards are even able to spawn, it may be that
I will be able to try them in a few, but there are no other errors.
I will let you know how it goes.
I removed the
It does not work.
because you don’t remove the manager spawn; you still need that in order to spawn the shards. the redundant part is the “amount”
I am sorry for my incompetence, but this still is not working when this is my code.
What do you think it is?
.
if it doesn't log in on time, it won't continue. does the ready event fire?
edited to add: you're using a lot of intents, which is a lot of info - you can try increasing the timeout or figure out why its taking so long to start up
The ready event does not fire, I will try incressing the timeout time to 5 minutes. But before that I will remove a lot of the intents.
I did, I made it 8 minutes.
I changed it, but it still did not work.
I do log in.
I am stupid.