Skip to content

Commit

Permalink
fix(CommandClient): Help command permission check (#1414)
Browse files Browse the repository at this point in the history
Co-authored-by: bsian03 <[email protected]>
  • Loading branch information
YalphaFR and bsian03 authored Nov 18, 2022
1 parent 3e62ca7 commit e43418d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/command/CommandClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class CommandClient extends Client {
this.on("messageReactionRemove", this.onMessageReactionEvent);

if(this.commandOptions.defaultHelpCommand) {
this.registerCommand("help", (msg, args) => {
this.registerCommand("help", async (msg, args) => {
let result = "";
if(args.length > 0) {
let cur = this.commands[this.commandAliases[args[0]] || args[0]];
Expand All @@ -98,7 +98,7 @@ class CommandClient extends Client {
if(subcommands.length > 0) {
result += "\n\n**Subcommands:**";
for(const subLabel of subcommands) {
if(cur.subcommands.hasOwnProperty(subLabel) && cur.subcommands[subLabel].permissionCheck(msg)) {
if(cur.subcommands.hasOwnProperty(subLabel) && await cur.subcommands[subLabel].permissionCheck(msg)) {
result += `\n **${subLabel}** - ${cur.subcommands[subLabel].description}`;
}
}
Expand All @@ -110,7 +110,7 @@ class CommandClient extends Client {
}
result += "\n**Commands:**\n";
for(const label in this.commands) {
if(this.commands.hasOwnProperty(label) && this.commands[label] && this.commands[label].permissionCheck(msg) && !this.commands[label].hidden) {
if(this.commands.hasOwnProperty(label) && this.commands[label] && await this.commands[label].permissionCheck(msg) && !this.commands[label].hidden) {
result += ` **${msg.prefix}${label}** - ${this.commands[label].description}\n`;
}
}
Expand Down

0 comments on commit e43418d

Please sign in to comment.