if (!field) throw new DiscordjsTypeError(ErrorCodes.ModalSubmitInteractionFieldNotFound, customI

I have this error and this my code in the pictures
12 Replies
d.js toolkit
d.js toolkitā€¢16mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - āœ… Marked as resolved by OP
./linpeas.sh šŸŒ™
./linpeas.sh šŸŒ™OPā€¢16mo ago
node: v18.17.1
Squid
Squidā€¢16mo ago
your field custom id is YourName, but you're trying to get it via getField('Name')
./linpeas.sh šŸŒ™
./linpeas.sh šŸŒ™OPā€¢16mo ago
Ohh, let me check Oh, Now my code printed what submitted in Modal, but the I have "Something went wrong when submit" @Squid
Squid
Squidā€¢16mo ago
You need to reply to the ModalSubmitInteraction
./linpeas.sh šŸŒ™
./linpeas.sh šŸŒ™OPā€¢16mo ago
How, wdym? You mean interaction.reply? This error gone and solved, but I get something went wrong in discord
Squid
Squidā€¢16mo ago
Yes, if interaction is the interaction you received from the modal, not the interaction from the command being ran
./linpeas.sh šŸŒ™
./linpeas.sh šŸŒ™OPā€¢16mo ago
Ahh, Okay, I want to push data to a discussion form instead of reply, Can I? I think I can or? @Squid
Squid
Squidā€¢16mo ago
You need to reply to the modal interaction either way, but you can send a message to a different channel after that
./linpeas.sh šŸŒ™
./linpeas.sh šŸŒ™OPā€¢16mo ago
Ok, some bots send messages no one can see it expect the clicker/sender of the Modal it can be, yes?
Squid
Squidā€¢16mo ago
Yes, include ephemeral: true in your reply options object
./linpeas.sh šŸŒ™
./linpeas.sh šŸŒ™OPā€¢16mo ago
Ahh, Thank you so much my friend ā¤ļø I will try if done I will mark it as solved šŸŒ¹

Did you find this page helpful?