Authorize modal

What's the best way to authorize a modal in order to know it came from the right user? I'd prefer nog to use the interaction.id in the customId, so is it an option to use client.on(modalSubmit)?
4 Replies
d.js toolkit
d.js toolkit6mo 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
monbrey
monbrey6mo ago
The only person who can respond to the modal is the user you showed it to Not sure I understand the issue client.on(modalSubmit) does not exist, no, its an Interaction Create event. It doesn't contain any additional information that you wouldnt get anywhere else
SirNuny
SirNunyOP6mo ago
But if I use interaction.awaitModalSubmit() and two modals are shown at the same time, then it messes up one of them
monbrey
monbrey6mo ago
Both modals are being shown to the same user though? Putting the interaction.id in the customId is the best solution here - it ensures you're listening uniquely
Want results from more Discord servers?
Add your server