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β€’12mo 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
AC / LogicTubes_Boss πŸ‡ΈπŸ‡¦
node: v18.17.1
Squid
Squidβ€’12mo ago
your field custom id is YourName, but you're trying to get it via getField('Name')
AC / LogicTubes_Boss πŸ‡ΈπŸ‡¦
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β€’12mo ago
You need to reply to the ModalSubmitInteraction
AC / LogicTubes_Boss πŸ‡ΈπŸ‡¦
How, wdym? You mean interaction.reply? This error gone and solved, but I get something went wrong in discord
Squid
Squidβ€’12mo ago
Yes, if interaction is the interaction you received from the modal, not the interaction from the command being ran
AC / LogicTubes_Boss πŸ‡ΈπŸ‡¦
Ahh, Okay, I want to push data to a discussion form instead of reply, Can I? I think I can or? @Squid
Squid
Squidβ€’12mo ago
You need to reply to the modal interaction either way, but you can send a message to a different channel after that
AC / LogicTubes_Boss πŸ‡ΈπŸ‡¦
Ok, some bots send messages no one can see it expect the clicker/sender of the Modal it can be, yes?
Squid
Squidβ€’12mo ago
Yes, include ephemeral: true in your reply options object
AC / LogicTubes_Boss πŸ‡ΈπŸ‡¦
Ahh, Thank you so much my friend ❀️ I will try if done I will mark it as solved 🌹
Want results from more Discord servers?
Add your server