#My Discord Bot User Count Is Increasing Per Second
10 messages · Page 1 of 1 (latest)
Show your code
{ name: '**👥 Users: **', value: `> ${client.users.cache.size}`, inline: true },```
Tag suggestion for @hard cargo:
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)
@vocal beacon It Shows An Exact Number But More Higher
Yeah, thats more or less how many users your bot has
I Use client.users.cache.size In Console.log - return 2558 users
But client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0) In Command returns - 75280 users
client.users.cache only has users that interacted with your bot in some way, be it sending a message, member update etc.
ok you say that client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0) is correct right
Yes