diff --git a/deploy-commands.js b/deploy-commands.js index 0e35816..61af8d8 100644 --- a/deploy-commands.js +++ b/deploy-commands.js @@ -8,16 +8,26 @@ const commands = [ new SlashCommandBuilder() .setName('generate') .setDescription('Generate something.') - .addStringOption(option => - option.setName('type') - .setDescription('The type of thing to generate.') - .setRequired(true) - .addChoices( - { name: 'Host', value: 'host' }, - { name: 'Gang', value: 'gang' }, - { name: 'Corporation', value: 'corporation' }, + .addSubcommand(subcommand => + subcommand + .setName('host') + .setDescription('Generate a host.') + .addNumberOption(option => + option + .setName('rating') + .setDescription('The rating of the host.') + .setRequired(true) ) - ) + .addStringOption(option => + option + .setName('type') + .setDescription('The type of the host.') + .addChoices( + { name: 'Foundation', value: 'foundation' }, + { name: 'Framework', value: 'framework' }, + ) + ) + ) ] .map(command => command.toJSON()); diff --git a/france-in-pictures-beautiful-places-to-photograph-eiffel-tower.jpg b/france-in-pictures-beautiful-places-to-photograph-eiffel-tower.jpg new file mode 100644 index 0000000..4b86b6c Binary files /dev/null and b/france-in-pictures-beautiful-places-to-photograph-eiffel-tower.jpg differ diff --git a/index.js b/index.js index c70f4b6..325c013 100644 --- a/index.js +++ b/index.js @@ -13,11 +13,16 @@ client.once('ready', () => { client.on('interactionCreate', async interaction => { if (!interaction.isCommand()) return; + console.log(interaction.commandName); let commandName = interaction.commandName; if (commandName === "generate") { - await interaction.reply(`Generating ${interaction.options.getString('type')}`); + if (interaction.options.getSubcommand() === "host") { + let rating = interaction.options.getNumber("rating"); + let type = interaction.options.getString("type") ?? "foundation"; + await interaction.reply({files: ["./france-in-pictures-beautiful-places-to-photograph-eiffel-tower.jpg"]}); + } } }) diff --git a/templates/hosts.pug b/templates/hosts.pug new file mode 100644 index 0000000..e69de29