Hide owner only/hidden commands from help, Deps

This commit is contained in:
Dragon Fire
2020-02-22 12:03:15 -05:00
parent 189dbc338f
commit 26d057627b
2 changed files with 8 additions and 5 deletions
+4 -1
View File
@@ -29,9 +29,12 @@ module.exports = class HelpCommand extends Command {
.setColor(0x00AE86)
.setFooter(`${this.client.registry.commands.size} Commands`);
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;
embed.addField(
` ${group.name}`,
group.commands.map(cmd => `\`${cmd.name}\``).join(', ') || 'None'
commands.map(cmd => `\`${cmd.name}\``).join(', ')
);
}
try {