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
• 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.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 isSo just dont do it?
That's my personal opinion, yes
Alright thanks. I am very new anyways so