I made it look like an image, but I get the error "something went worng!"

https://www.youtube.com/watch?v=qNB7pQBhqDQ Modal code was created as in the corresponding image. However, the error "something wrong! Try again!" occurs. Below is the code I wrote.
const { SlashCommandBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, ActionRowBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName("modal")
.setDescription("Returns a modal."),

async execute(interaction, client) {
const modal = new ModalBuilder()
.setCustomId(`recd`)
.setTitle(`write`);

const textInput = new TextInputBuilder()
.setCustomId('recdInput')
.setLabel(`input code`)
.setPlaceholder('ex) xQ50Kbz6rB')
.setMaxLength(10)
.setRequired(true)
.setStyle(TextInputStyle.Short);

modal.addComponents(new ActionRowBuilder().addComponents(textInput));

await interaction.showModal(modal);
},
};
modal.js
const { SlashCommandBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, ActionRowBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName("modal")
.setDescription("Returns a modal."),

async execute(interaction, client) {
const modal = new ModalBuilder()
.setCustomId(`recd`)
.setTitle(`write`);

const textInput = new TextInputBuilder()
.setCustomId('recdInput')
.setLabel(`input code`)
.setPlaceholder('ex) xQ50Kbz6rB')
.setMaxLength(10)
.setRequired(true)
.setStyle(TextInputStyle.Short);

modal.addComponents(new ActionRowBuilder().addComponents(textInput));

await interaction.showModal(modal);
},
};
modal.js
module.exports = {
data: {
name: `recd`
},
async execute(interaction, client) {
await interaction.reply({
content : `okay : ${interaction.field.getTextInputValue('recdInput')} `
});
console.log(interaction.field.getTextInputValue('recdInput'));
},
};
recd.js
module.exports = {
data: {
name: `recd`
},
async execute(interaction, client) {
await interaction.reply({
content : `okay : ${interaction.field.getTextInputValue('recdInput')} `
});
console.log(interaction.field.getTextInputValue('recdInput'));
},
};
recd.js
Fusion Terror
YouTube
[NEW] Modal Builder GUIDE || Discord.JS v14
In addition to our How To Make A Discord Bot in Discord.JS v14 series, this video I will be teaching you how to make a MODAL using a ModalBuilder. I'll also be showing you how to add custom input fields using TextInputBuilder, with explanation so new Discord.js programmers are able to learn! 🔗 | Useful Links/Downloads: 📟 | Node.js: https://bit....
6 Replies
d.js toolkit
d.js toolkit2y 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.
박준서
박준서OP2y ago
This type of error occurs.
jay
jay2y ago
thats not really an error whats the error in your console if you get one
박준서
박준서OP2y ago
No errors appear on the console. "Something wrong! Try again!" appears in the modal, and the input value is not reply.
chewie
chewie2y ago
That error appears when you dont reply to the modal interaction. So unless you don't get any errors in the console, your modal handler is not being run
박준서
박준서OP2y ago
I don't know how to fix it. I don't understand why they don't interact.
Want results from more Discord servers?
Add your server