Shard & Guilds

So fortunately my bot is growing rapidly, and I chose to shard. But I am not really familiar with sharding since I've never worked with it, never used it anywhere. How can I basically get a guild count for each shard , so I can make a function and use it on my api and anywhere else I am mentioning any information like bot member count or bot guilds . Especially bot guilds, because I am rewarding top 10 guilds of the bot every month so I need to merge the guild count of the shards (currently I have 2) but with my logic I assume that i will make a function and use a forEach to calculate the guilds . If someone can provide a few snippets , no need to give me huge explanations , I will understand the snippets. Any little help will be appreciated. Thank you
5 Replies
d.js toolkit
d.js toolkit•11mo ago
- 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 OP
Sigma🇦🇱
Sigma🇦🇱OP•11mo ago
For now just so I have a average guild count , I've done a guild.cache.size * 2 😂 only for my website . But I do need to get the actual count and also so the bot can get the servers from a to b
d.js docs
d.js docs•11mo ago
guide Sharding: Getting started - BroadcastEval read more
Toast
Toast•11mo ago
You can use broadcastEval or fetchClientValues, the guide shows how to use them.
Sigma🇦🇱
Sigma🇦🇱OP•11mo ago
I'll check that out, thank you! It worked , thank you a lot
Want results from more Discord servers?
Add your server