Skip to content

Commit

Permalink
Update slash command for mod application to accept new parameter dete…
Browse files Browse the repository at this point in the history
…rmining the moderator role to apply to.
  • Loading branch information
SuperMarioDaBom committed Dec 12, 2024
1 parent 286f595 commit 1a6927f
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/commands/mod-application.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const { modal: modApplicationModal } = require('../modals/mod-application');
* @param {Discord.CommandInteraction} interaction
*/
async function modApplicationHandler(interaction) {
modApplicationModal.setCustomId("mod-application-" + interaction.options.get('role').value);

interaction.showModal(modApplicationModal, {
client: interaction.client,
interaction: interaction
Expand All @@ -16,11 +18,22 @@ async function modApplicationHandler(interaction) {
const command = new SlashCommandBuilder()
.setDefaultMemberPermissions(Discord.PermissionFlagsBits.SendMessages)
.setName('mod-application')
.setDescription('Apply for a position as a moderator');
.setDescription('Apply for a position as a moderator.')
.addStringOption(option =>
option.setName('role')
.setDescription('Moderator type to apply to.')
.setRequired(true)
.addChoices(
{ name: 'Discord Moderator', value: 'discord' },
{ name: 'Discord VC Moderator', value: 'vc' },
{ name: 'Forum Moderator', value: 'forum' },
{ name: 'Network Moderator', value: 'network' },
{ name: 'Juxtaposition Moderator', value: 'juxt' }
));

module.exports = {
name: command.name,
help: 'Displays a popup modal to apply for a moderator position.\n```\nUsage: /mod-application\n```',
help: 'Displays a popup modal to apply for a moderator position.\n```\nUsage: /mod-application role\n```',
handler: modApplicationHandler,
deploy: command.toJSON()
};

0 comments on commit 1a6927f

Please # to comment.