diff --git a/commands/base.js b/commands/base.js index 04d530b..a65a105 100644 --- a/commands/base.js +++ b/commands/base.js @@ -21,7 +21,7 @@ module.exports = [ commands.forEach(commandList => { commandList.forEach(command => { if (command.hide) { - return // Go to next command if this one should show up + return // Go to next command if this one shouldnt show up } const field = {name: command.name, value: `Description: ${command.description || "None"}\nArguments: ${command.arguments || "None"}`} embed.addFields(field) diff --git a/commands/extra.js b/commands/extra.js index e9aa2bc..7f3b794 100644 --- a/commands/extra.js +++ b/commands/extra.js @@ -6,12 +6,15 @@ module.exports = [ name: "helptest", description: "Kill every1", arguments: [GuildMember.name, GuildChannel.name], - run: (ctx, args) => { - if (!args[0].user) { + run: (ctx, member, channel) => { + if (!member.user) { + ctx.reply("Member invalid.") + } + if (!channel.id) { ctx.reply("Member invalid.") } - ctx.reply(`Member: ${args[0]}\nChannel: ${args[1]}`) + ctx.reply(`Member: ${member}\nChannel: ${channel}`) } - } + }, ] \ No newline at end of file diff --git a/index.js b/index.js index 882ce35..2883f7a 100644 --- a/index.js +++ b/index.js @@ -114,7 +114,11 @@ client.on("messageCreate", (message) => { } // Run command - realCommand.run(message, args) + if (realCommand.arguments == ["any"] || realCommand.arguments == ["none"]) { + realCommand.run(message, args) + } else { + realCommand.run(message, ...args) // Example in extra.js + } }) // After getting the command list we can export it