#Question

23 messages · Page 1 of 1 (latest)

proud adderBOT
old fable
#

Attachment option

willow fableBOT
broken kelp
old fable
#

Not sure what you mean by that

broken kelp
#

Basically, I created a dropdown menu and I want it so that when you click on "Image des tickets", it opens a window where you can add images.

broken kelp
old fable
#

Modals have File upload components

willow fableBOT
broken kelp
broken kelp
#
const { ActionRowBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, EmbedBuilder, FileUploadBuilder, LabelBuilder } = require('discord.js');

module.exports = {
    customID: 'ticket_image_modal',
    async execute(interaction, client) {

        const modal = new ModalBuilder().setCustomId('myModal').setTitle('My Modal');

        const pictureOfTheWeekUpload = new FileUploadBuilder().setCustomId('picture');

        const pictureOfTheWeekLabel = new LabelBuilder()
            .setLabel('Picture of the Week')
            .setDescription('The best pictures you have taken this week')
            // Set file upload as component of the label
            .setFileUploadComponent(pictureOfTheWeekUpload);

      modal
        .addLabelComponents(pictureOfTheWeekLabel)

        await interaction.showModal(modal);
    }
};
old fable
#

Log interaction?.constructor.name ?? interaction

broken kelp
old fable
#

You can’t show a modal from a modal

broken kelp
#

Ohh

#

How can I do it?

old fable
#

Either reply using a message with a button that will show the modal when pressed, or reconsider ur interactions flow

broken kelp
old fable
#

You can’t

#

Just check it when you receive the file