From 2ae6e6ff32eae1c78b967a5204d1e7a4ee540e13 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Thu, 1 Apr 2021 16:42:34 -0500 Subject: [PATCH] Add number of humans and bots --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index 9b6079d..f2ee4fd 100644 --- a/index.js +++ b/index.js @@ -43,12 +43,15 @@ async function aboutServer(message) { const textChannelCount = message.guild.channels.cache.filter(c => c.type === 'text').size; const voiceChannelCount = message.guild.channels.cache.filter(c => c.type === 'voice').size; const categoryChannelCount = message.guild.channels.cache.filter(c => c.type === 'category').size; + const numHumans = message.guild.members.cache.filter(member => !member.user.bot).size; + const numBots = message.guild.members.cache.filter(member => member.user.bot).size; const aboutServerEmbed = new Discord.MessageEmbed() .setTitle(`About \`${message.guild.name}\``) .addField("Owner", `<@${message.guild.ownerID}>`) .addField("Region", message.guild.region) .addField("Verification Level", message.guild.verificationLevel) .addField("Channels", `Text: ${textChannelCount} • Voice: ${voiceChannelCount} • Categories: ${categoryChannelCount}`) + .addField("Members", `Human: ${numHumans} • Bot: ${numBots}`) .setThumbnail(message.guild.iconURL()) .setFooter(`Server ID: ${message.guild.id}`) .setTimestamp();