From 5d66293b5c34c13fc355ba033cdc88d506074232 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sat, 7 Dec 2019 19:32:27 +0100 Subject: [PATCH] The bot just learned how to count --- commands/utility/server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/utility/server.js b/commands/utility/server.js index 64365bf..29c8719 100644 --- a/commands/utility/server.js +++ b/commands/utility/server.js @@ -16,12 +16,13 @@ class ServerCommand extends Command { } async exec(message) { + let botCount = message.guild.members.filter(member => member.user.bot).size; const addEmbed = this.client.util.embed() .setColor(message.member.displayHexColor) .setTitle(message.guild.name) .setThumbnail(message.guild.iconURL()) - .addField('Number of users', message.guild.members.filter(member => !member.user.bot).size, true) - .addField('Number of bots', message.guild.members.filter(member => member.user.bot).size, true) + .addField('Number of users', message.guild.memberCount - botCount, true) + .addField('Number of bots', botCount, true) .addField('Total number of members', message.guild.memberCount, true) .addField('Number of channels', message.guild.channels.size, true) .addBlankField()