Browse Source

Add number of humans and bots

master
Abheek Dhawan 4 years ago
parent
commit
2ae6e6ff32
  1. 3
      index.js

3
index.js

@ -43,12 +43,15 @@ async function aboutServer(message) {
const textChannelCount = message.guild.channels.cache.filter(c => c.type === 'text').size; 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 voiceChannelCount = message.guild.channels.cache.filter(c => c.type === 'voice').size;
const categoryChannelCount = message.guild.channels.cache.filter(c => c.type === 'category').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() const aboutServerEmbed = new Discord.MessageEmbed()
.setTitle(`About \`${message.guild.name}\``) .setTitle(`About \`${message.guild.name}\``)
.addField("Owner", `<@${message.guild.ownerID}>`) .addField("Owner", `<@${message.guild.ownerID}>`)
.addField("Region", message.guild.region) .addField("Region", message.guild.region)
.addField("Verification Level", message.guild.verificationLevel) .addField("Verification Level", message.guild.verificationLevel)
.addField("Channels", `Text: ${textChannelCount} • Voice: ${voiceChannelCount} • Categories: ${categoryChannelCount}`) .addField("Channels", `Text: ${textChannelCount} • Voice: ${voiceChannelCount} • Categories: ${categoryChannelCount}`)
.addField("Members", `Human: ${numHumans} • Bot: ${numBots}`)
.setThumbnail(message.guild.iconURL()) .setThumbnail(message.guild.iconURL())
.setFooter(`Server ID: ${message.guild.id}`) .setFooter(`Server ID: ${message.guild.id}`)
.setTimestamp(); .setTimestamp();

Loading…
Cancel
Save