Member count help

I have the following code but I want it to exclude bots, any hep would be appreciated. Thanks! client.on('ready' , (c) => { let memberCount = 0; client.guilds.cache.forEach(g => { memberCount = memberCount + g.memberCount; }); client.user.setActivity({ name: memberCount + " Members", type: ActivityType.Watching }); });
5 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Squid
Squid2y ago
You would have to fetch all members for each guild, filter that collection to exclude bots, and add that collection's size to your memberCount number Spoiler alert: it's not worth the trouble and it's not as cool as anyone thinks it is
unchill
unchillOP2y ago
So just dont do it?
Squid
Squid2y ago
That's my personal opinion, yes
unchill
unchillOP2y ago
Alright thanks. I am very new anyways so
Want results from more Discord servers?
Add your server