diff --git a/src/commands/guild.js b/src/commands/guild.js index 2e20ce2..fa513a0 100644 --- a/src/commands/guild.js +++ b/src/commands/guild.js @@ -9,6 +9,16 @@ module.exports = { type: "slash", dev: false, public: true, + subcommands: [ + { + name: "member", + description: "Get info about a guild memeber", + }, + { + name: "info", + description: "Get info about a guild.", + } + ], data: new SlashCommandBuilder() .setName("guild") diff --git a/src/commands/help.js b/src/commands/help.js index 397a5dc..ed24d83 100644 --- a/src/commands/help.js +++ b/src/commands/help.js @@ -6,7 +6,7 @@ module.exports = { name: "help", description: "Help command", type: "slash", - dev: false, + dev: true, public: true, data: new SlashCommandBuilder() @@ -24,10 +24,26 @@ module.exports = { const commandFiles = fs.readdirSync(__dirname).filter(file => file.endsWith(".js")) for (const file of commandFiles) { const command = require(`./${file}`) - if (command.public) { + if (command.public && !command.subcommands) { commands.push(command) + } else if (command.public && command.subcommands) { + const commandName = command.name + + const subcommands = command.subcommands.map((subcommand) => { + return { + name: commandName + " " + subcommand.name, + description: subcommand.description + } + }) + + console.log(subcommands) + + for (const subcommand of subcommands) { + commands.push(subcommand) + } } } + const commandList = commands.map((command) => { return { name: "**/" + command.name + "**",