How can I prevent the Error [ShardingInProcess]: Shards are still being spawned.
Error [ShardingInProcess]: Shards are still being spawned.
How can I prevent this error from being logged?
while (!client.isReady()) return;
is the first thing I have in my interactionCreate
event btw.9 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Can you show your stack trace? It should show us what your bot attempted to do without shards fully spawned
I actually don't know which commands are being used, but I just wanna stop the operation if it's not ready (shards are still being spawned)
Your stack trace will help us find out though, thats what I'm asking for
Okay no idea sorry 😄
I use
client.shard.broadcastEval
as one of the first things in my interactionCreate
event as well. Maybe that could be it?Yeah that would definitely do it
The shard its on might be ready but broadcasting to all the others, not so much
So is there a way to check if all shards are ready?
Would I be able to do
if (client.shards.size < client.totalShards) return;
before doing anything else in my interactionCreate
event?
Or it looks somewhat like client.shard.ready
is a thing too? So would I be able to do if (!interaction.client.shard.ready) return;
?
@monbrey ?