Change Footer Command Counts

This commit is contained in:
Dragon Fire
2020-02-22 12:08:19 -05:00
parent 26d057627b
commit 53145852fd
+8 -2
View File
@@ -26,17 +26,23 @@ module.exports = class HelpCommand extends Command {
if (!command) {
const embed = new MessageEmbed()
.setTitle('Command List')
.setColor(0x00AE86)
.setFooter(`${this.client.registry.commands.size} Commands`);
.setColor(0x00AE86);
let cmdCount = 0;
for (const group of this.client.registry.groups.values()) {
const owner = this.client.isOwner(msg.author);
const commands = group.commands.filter(cmd => !cmd.hidden && owner ? true : !cmd.ownerOnly);
if (!commands.size) continue;
cmdCount += commands.size;
embed.addField(
` ${group.name}`,
commands.map(cmd => `\`${cmd.name}\``).join(', ')
);
}
if (cmdCount === this.client.registry.commands.size) {
embed.setFooter(`${this.client.registry.commands.size} Commands`);
} else {
embed.setFooter(`${this.client.registry.commands.size} Commands (${cmdCount} Shown)`);
}
try {
const msgs = [];
msgs.push(await msg.direct({ embed }));