From f96808e6d6bf42a580f2647810f9ce0992c295e8 Mon Sep 17 00:00:00 2001 From: Bsian Date: Wed, 18 Dec 2019 23:03:46 +0000 Subject: [PATCH] Fix failing to find commands --- src/commands/help.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/help.ts b/src/commands/help.ts index b4ad446..c02d6ac 100644 --- a/src/commands/help.ts +++ b/src/commands/help.ts @@ -44,8 +44,9 @@ export default class Help extends Command { if (cmdPages.length === 1) return message.channel.createMessage({ embed: cmdPages[0] }); return createPaginationEmbed(message, this.client, cmdPages); } - const { cmd } = await this.client.util.resolveCommand(args, message); - if (!cmd) return message.channel.createMessage(`${this.client.stores.emojis.error} **Command not found!**`); + const resolved = await this.client.util.resolveCommand(args, message); + if (!resolved) return message.channel.createMessage(`${this.client.stores.emojis.error} **Command not found!**`); + const { cmd } = resolved; const perms: string[] = []; let allowedRoles = cmd.permissions && cmd.permissions.roles && cmd.permissions.roles.map((r) => `<@&${r}>`).join(', '); if (allowedRoles) { allowedRoles = `**Roles:** ${allowedRoles}`; perms.push(allowedRoles); }