awaitModalSubmit issue

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

$ node -v
v22.13.0
$ npm ls discord.js
[email protected] /home/vaito/another-rannus

$ node -v
v22.13.0
No description
4 Replies
d.js toolkit
d.js toolkit2w 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
#ToiYeuSweetLiquor <3
Should I create a unique ID for each modal then use it to filter the interaction ._.?
monbrey
monbrey2w ago
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
#ToiYeuSweetLiquor <3
Thank you so much. Also, I think you should mention this in the guide.

Did you find this page helpful?