Fix failing to find commands

merge-requests/1/merge
Bsian 2019-12-18 23:03:46 +00:00
parent 6f20ecf178
commit f96808e6d6
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 3 additions and 2 deletions

View File

@ -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); }