data.components[0].components[BASE_TYPE_REQUIRED] This field is required

I want to create a Modal but this error comes
6 Replies
d.js docs
d.js docs3y ago
• 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.
chewie
chewie3y ago
• Show your code!
RichtigJoJo
RichtigJoJoOP3y ago
let modal = new Discord.ModalBuilder()
.setTitle("Title")
.setCustomId("myModal")
.addComponents(
new Discord.TextInputBuilder()
.setCustomId("textInput")
.setLabel("Hello world")
.setMaxLength(256)
.setStyle(Discord.TextInputStyle.Short)
.setPlaceholder("Write here something")
.setRequired(false)
)
interaction.showModal(modal)
let modal = new Discord.ModalBuilder()
.setTitle("Title")
.setCustomId("myModal")
.addComponents(
new Discord.TextInputBuilder()
.setCustomId("textInput")
.setLabel("Hello world")
.setMaxLength(256)
.setStyle(Discord.TextInputStyle.Short)
.setPlaceholder("Write here something")
.setRequired(false)
)
interaction.showModal(modal)
chewie
chewie3y ago
the textinputbuilder needs to be in an actionrow
d.js docs
d.js docs3y ago
guide Interactions: Modals read more
Want results from more Discord servers?
Add your server