#awaitModalSubmit issue

5 messages · Page 1 of 1 (latest)

spice flame
#

With the following code, I noticed that when I open a modal, but don't submit that modal, then use the same button and call another modal and submit, discord.js will throw an Unknown Interaction error. Is there any way to fix this error?

Versions:

$ npm ls discord.js
[email protected] /home/vaito/another-rannus
└── [email protected]

$ node -v          
v22.13.0
little mothBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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
spice flame
#

Should I create a unique ID for each modal then use it to filter the interaction ._.?

cold fox
#

Yes, exactly

#

Discord doesn't send an event when a modal is closed, so you end up still listening for both opened modals, resulting in a double response attempt on the second