#My Discord Bot User Count Is Increasing Per Second

10 messages · Page 1 of 1 (latest)

lyric owlBOT
#

• 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.

vocal beacon
#

Show your code

hard cargo
cunning shadowBOT
#

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)
hard cargo
#

@vocal beacon It Shows An Exact Number But More Higher

vocal beacon
#

Yeah, thats more or less how many users your bot has

hard cargo
#

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

vocal beacon
#

client.users.cache only has users that interacted with your bot in some way, be it sending a message, member update etc.

hard cargo
vocal beacon
#

Yes