From b18241f7bcf54df427843c9e1e041e9780d1e2ae Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Tue, 2 May 2017 22:58:41 +0000 Subject: [PATCH] Or do that --- commands/util/help.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/commands/util/help.js b/commands/util/help.js index cc56695b..0e94d7b7 100644 --- a/commands/util/help.js +++ b/commands/util/help.js @@ -27,7 +27,8 @@ module.exports = class HelpCommand extends Command { async run(msg, args) { const { command } = args; const commands = this.client.registry.findCommands(command, false, msg); - if (command && command !== 'all') { + const showAll = command && command.toLowerCase() === 'all'; + if (command && !showAll) { if (commands.length === 1) { msg.say(stripIndents` __Command **${commands[0].name}**:__ *${commands[0].description}* @@ -48,12 +49,12 @@ module.exports = class HelpCommand extends Command { } } else { const embed = new RichEmbed() - .setTitle(command !== 'all' ? `Commands Available in ${msg.guild ? msg.guild.name : 'this DM'}` : 'All Commands') + .setTitle(!showAll ? `Commands Available in ${msg.guild ? msg.guild.name : 'this DM'}` : 'All Commands') .setDescription(`Use ${this.usage('', null, null)} to view detailed information about a specific command.`) .setColor(0x00AE86); for (const group of this.client.registry.groups.array()) { embed.addField(group.name, - command !== 'all' ? group.commands.filter(c => c.isUsable(msg)).map(c => `\`${c.name}\``).join(', ') || 'None Available' : group.commands.map(c => `\`${c.name}\``).join(', ')); + !showAll ? group.commands.filter(c => c.isUsable(msg)).map(c => `\`${c.name}\``).join(', ') || 'None Available' : group.commands.map(c => `\`${c.name}\``).join(', ')); } try { await msg.author.send({embed});