Auto-shard calculation fails: Sharding is required error
Environment:
- Discord.js: 14.22.1
I want the ClusterManager to calculate the number of shards automatically. My code:
When I remove totalShards to let the manager calculate it, I get the following errors from the djs shardDisconnect event:
Question:
How do I properly enable automatic shard calculation without encountering the Sharding is required error? Is there a specific setup required in bot.js when letting the ClusterManager handle shards automatically?
4 Replies
sorry i was little away, so for first one, it looks like djs error, no idea since sharding doesnt use reason anywhere, for second, uh, only what i can think of is discord returning single shard for some reason, you can see manually waht it returns by fetching
/api/gateway/bot with bot's token to manually check, and last error is just that you're trying to use broadcastEval before cluster is well, readyah okay but why does it then work if i set the shards manually
i would need to know response of that gateway/bot to know if its wrongly returning or smth
cuz if it returns 1, for shards, then well it makes sense why it breaks
ok