#Question
23 messages · Page 1 of 1 (latest)
Attachment option
SlashCommandBuilder#addAttachmentOption() [email protected]
Adds an attachment option.
Is it possible to open the attachment options in a dropdown menu?
Not sure what you mean by that
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.
Is that possible?..
Modals have File upload components
LabelBuilder#setFileUploadComponent() [email protected]
Sets a file upload component to this label.
Can I give an example? I don't understand how it's set up...
that's what it shows me
TypeError: interaction.showModal is not a function
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);
}
};
Log interaction?.constructor.name ?? interaction
ModalSubmitInteraction
You can’t show a modal from a modal
Either reply using a message with a button that will show the modal when pressed, or reconsider ur interactions flow
okayyy
Do you know how to do it just to select image-type files?