From 7ec06449d70d1ddc1a8f454f6d4ddc514a3facd4 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Thu, 1 Apr 2021 17:16:19 -0500 Subject: [PATCH] Use size property of members --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 9f1a67e..7e6f4d0 100644 --- a/index.js +++ b/index.js @@ -46,10 +46,10 @@ async function aboutServer(message) { 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 numRoles = message.guild.roles.cache.size; - const numOnline = message.guild.members.cache.filter(member => member.user.presence === "online"); - const numOffline = message.guild.members.cache.filter(member => member.user.presence === "offline"); - const numAway = message.guild.members.cache.filter(member => member.user.presence === "idle"); - const numDND = message.guild.members.cache.filter(member => member.user.presence === "dnd"); + const numOnline = message.guild.members.cache.filter(member => member.user.presence === "online").size; + const numOffline = message.guild.members.cache.filter(member => member.user.presence === "offline").size; + const numAway = message.guild.members.cache.filter(member => member.user.presence === "idle").size; + const numDND = message.guild.members.cache.filter(member => member.user.presence === "dnd").size; const aboutServerEmbed = new Discord.MessageEmbed() .setTitle(`About \`${message.guild.name}\``) .addField("Owner", `<@${message.guild.ownerID}>`) @@ -59,7 +59,7 @@ async function aboutServer(message) { .addField("Members", `Total: ${numHumans + numBots} ā€– Human: ${numHumans} ā€¢ Bot: ${numBots}`) .addField("Roles", numRoles) .addField("Created", message.guild.createdAt) - .addField("User Statuses", `šŸ”µ ${numOnline}\nšŸŸ  ${numAway}\nāš« ${numOffline}\nšŸ”“ ${numDND}`) + .addField("User Statuses", `šŸŸ¦ ${numOnline}\n\nšŸŸ§ ${numAway}\n\nā¬› ${numOffline}\n\nšŸŸ„ ${numDND}`) .setThumbnail(message.guild.iconURL()) .setFooter(`Server ID: ${message.guild.id}`) .setTimestamp();