#Trying to pass info between modal and command
2 messages · Page 1 of 1 (latest)
promote.js script, command
module.exports = {
data: new SlashCommandBuilder()
.setName("promote")
.setDescription("Promotes a user from their current rank.")
.addUserOption(option => option.setName("user").setDescription("Enter the user that you'd like to promote")),
async execute(interaction, client) {
const modal = new ModalBuilder()
.setCustomId(`promotion-modal`)
.setTitle(`Promote a User`);
const userInput = new TextInputBuilder()
.setCustomId(`reasonInput`)
.setLabel(`Enter reason for promotion`)
.setRequired(true)
.setStyle(TextInputStyle.Paragraph);
modal.addComponents(new ActionRowBuilder().addComponents(userInput));
await interaction.showModal(modal);
},
};