This repository has been archived by the owner on Dec 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Matthew Ray
committed
Oct 13, 2018
1 parent
69785af
commit e611e20
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const Discord = require('discord.js'); | ||
|
||
exports.run = (client, message) => { | ||
function checkBots(guild) { | ||
let botCount = 0; | ||
guild.members.forEach(member => { | ||
if (member.user.bot) botCount++; | ||
}); | ||
return botCount; | ||
} | ||
function checkMembers(guild) { | ||
let memberCount = 0; | ||
guild.members.forEach(member => { | ||
if (!member.user.bot) memberCount++; | ||
}); | ||
return memberCount; | ||
} | ||
|
||
|
||
const embed = new Discord.RichEmbed(); | ||
embed.setAuthor(client.user.username, client.user.avatarURL); | ||
embed.setTitle('Server Membercount'); | ||
embed.addField('Total Members', message.guild.memberCount, true); | ||
embed.addField('Humans', checkMembers(message.guild), true); | ||
embed.addField('Bots', checkBots(message.guild), true); | ||
message.guild.fetchBans() | ||
.then(bans => embed.addField('Bans', `${bans.size}`)); | ||
embed.setTimestamp(); | ||
embed.setFooter(`${client.user.username} | Server ID: ${message.guild.id}`); | ||
message.channel.send(embed); | ||
|
||
}; | ||
|
||
exports.conf = { | ||
enabled: true, | ||
guildOnly: true, | ||
aliases: [], | ||
permLevel: 'Standard User' | ||
}; | ||
|
||
exports.help = { | ||
name: 'membercount', | ||
category: 'Moderation', | ||
description: 'Shows a full membercount.', | ||
usage: 'membercount' | ||
}; | ||
|