variable

unknown variable ??
10 Replies
d.js toolkit
d.js toolkit6mo 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!
Bruwyn
Bruwyn6mo ago
No description
Bruwyn
Bruwyn6mo ago
No description
Bruwyn
Bruwyn6mo ago
have 427 memeber in the guild shows 3 only why ??
Danial
Danial6mo ago
Show the code
Bruwyn
Bruwyn6mo ago
${client.users.cache.size}
d.js docs
d.js docs6mo 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)
Bruwyn
Bruwyn6mo ago
${guild.members.cache.size} this also ??
d.js docs
d.js docs6mo 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/luna6mo ago
you can use <Guild>.memberCount for that