interaction.showModal not working

interaction.showModal doesnt work, I dont know why. Code:
this.container.logger.debug("Start Editing...")
const modal = new ModalBuilder().setTitle("Nachricht bearbeiten").setCustomId(`modal_edit_${swallowed.id}`)
const input = new TextInputBuilder().setCustomId(`new_text`)
.setLabel("Text bearbeiten")
.setPlaceholder("Neuer Text")
.setValue(swallowed.message_content)
.setRequired(true)
const actRow = new ActionRowBuilder<TextInputBuilder>().addComponents(input);
modal.addComponents(actRow)
this.container.logger.debug("Showing Modal...")
await interaction.showModal(modal)
this.container.logger.debug("Start Editing...")
const modal = new ModalBuilder().setTitle("Nachricht bearbeiten").setCustomId(`modal_edit_${swallowed.id}`)
const input = new TextInputBuilder().setCustomId(`new_text`)
.setLabel("Text bearbeiten")
.setPlaceholder("Neuer Text")
.setValue(swallowed.message_content)
.setRequired(true)
const actRow = new ActionRowBuilder<TextInputBuilder>().addComponents(input);
modal.addComponents(actRow)
this.container.logger.debug("Showing Modal...")
await interaction.showModal(modal)
Via the debug-commands, I found out, that only the last line throws the error. It is something like:
2023-02-26 20:33:32 - ERROR - ValidationError > s.nativeEnum(T)
2023-02-26 20:33:32 - ERROR - Expected the value to be a string or number
2023-02-26 20:33:32 - ERROR -
2023-02-26 20:33:32 - ERROR - Received:
2023-02-26 20:33:32 - ERROR - | undefined
2023-02-26 20:33:32 - ERROR - ValidationError > s.nativeEnum(T)
2023-02-26 20:33:32 - ERROR - Expected the value to be a string or number
2023-02-26 20:33:32 - ERROR -
2023-02-26 20:33:32 - ERROR - Received:
2023-02-26 20:33:32 - ERROR - | undefined
2 Replies
Durus
DurusOP2y ago
To be a little bit more concrete:
No description
Durus
DurusOP2y ago
Nevermind missed an option in the Textinputbuilder. I am dumb.
Want results from more Discord servers?
Add your server