#Trying to pass info between modal and command

2 messages · Page 1 of 1 (latest)

fallow gardenBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

mellow bough
#

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);
    },
  };