Reputation: 49
I want to make a bot stats command for my bot.
How do I find out how many people are using my bot?
Is there a way same as finding out how many guilds the bot is in? (client.guilds.cache.size
)
Upvotes: 0
Views: 1512
Reputation: 8402
You could use:
client.users.cache.size
Not counting bots:
client.users.cache.filter(user => !user.bot).size
Upvotes: 2
Reputation: 60
Do
client.user.setActivity(`on ${client.guilds.cache.size} Servers.`, {
type: "PLAYING",
});
It sets the presence to Playing on x Servers.
Upvotes: -1
Reputation: 3005
You can use client.guilds.cache.map((guild) => guild.memberCount).reduce((p, c) => p + c);
. If your bot is on 4 servers of 40 members, it will be 160.
Upvotes: 2