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
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
monbrey
monbrey•2y ago
Can you show your stack trace? It should show us what your bot attempted to do without shards fully spawned
Iced Queen
Iced QueenOP•2y ago
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)
monbrey
monbrey•2y ago
Your stack trace will help us find out though, thats what I'm asking for
Iced Queen
Iced QueenOP•2y ago
monbrey
monbrey•2y ago
Okay no idea sorry 😄
Iced Queen
Iced QueenOP•2y ago
I use client.shard.broadcastEval as one of the first things in my interactionCreate event as well. Maybe that could be it?
monbrey
monbrey•2y ago
Yeah that would definitely do it The shard its on might be ready but broadcasting to all the others, not so much
Iced Queen
Iced QueenOP•2y ago
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 ?
Want results from more Discord servers?
Add your server