variable

unknown variable ??
10 Replies
d.js toolkit
d.js toolkit13mo 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!
Austn
AustnOP13mo ago
No description
Austn
AustnOP13mo ago
No description
Austn
AustnOP13mo ago
have 427 memeber in the guild shows 3 only why ??
Danial
Danial13mo ago
Show the code
Austn
AustnOP13mo ago
${client.users.cache.size}
d.js docs
d.js docs13mo ago
Getting your bot's member count - client.users.cache.size is unreliable because it will only return cached users - The preferred method is using collection.reduce() on client.guilds.cache
client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)
client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)
Austn
AustnOP13mo ago
${guild.members.cache.size} this also ??
d.js docs
d.js docs13mo ago
Getting your bot's member count - client.users.cache.size is unreliable because it will only return cached users - The preferred method is using collection.reduce() on client.guilds.cache
client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)
client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)
treble/luna
treble/luna13mo ago
you can use <Guild>.memberCount for that
Want results from more Discord servers?
Add your server