Getting message context after modal submission best practice
I have a message context action that gives the user a modal. When the modal is submitted, what is the best practice for getting/saving the message context that opened the modal in the first place?
ChatGPT is suggesting to pass the messageID in the customID field and parsing it out, which I guess would work, but what is the best way?
3 Replies
- 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:method: ContextMenuCommandInteraction#awaitModalSubmit()
@14.16.3
Collects a single modal submit interaction that passes the filter. The Promise will reject if the time expires.
Ooooh I'll give that a shot, thanks!