Modals timeout

I'm trying to update my database with a modal input. Is there a way to defer a modal like a deferReply() ?
15 Replies
d.js docs
d.js docs2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
axiprime
axiprime2y ago
it just say deferReply in the doc. but when I do the deferReply, it return me Interaction has already been acknowledged.
d.js docs
d.js docs2y ago
Tag suggestion for @axiprime:DiscordAPIError: Interaction has already been acknowledged[InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred. You have already replied to the interaction. • Use <Interaction>.followUp() to send a new message • If you deferred reply it's better to use <Interaction>.editReply() • Responding to slash commands / buttons / select menus
조아오
조아오2y ago
You can't defer interactions to show modal after, they need to be the first reply iirc, but if you are talking about deferring the ModalSubmitInteraction it's possible
axiprime
axiprime2y ago
I want to make a deferReply() then .ShowModal
조아오
조아오2y ago
You can't, showModal needs to be the first reply to an interaction
axiprime
axiprime2y ago
and in the modal I would like to know If I can make a defer also so it wait for my thing to be push in my Database
조아오
조아오2y ago
To defer modalSubmit interactions, Idris already answered you: https://discord.com/channels/222078108977594368/1012031847993184266/1012032060602470440
axiprime
axiprime2y ago
I will read it again I guess 😅
axiprime
axiprime2y ago
Stack Overflow
Modal Collector Discord.js
I was trying to create a collector for my modal using Discord.js. With the code below I don't get an error, but the modal fails in Discord and the code in collector.on never runs. I have used a sim...
axiprime
axiprime2y ago
What I was looking is that. You can make your modal with a timed collector so it does not time out after the 3 secs
조아오
조아오2y ago
Just use:
d.js docs
d.js docs2y ago
Documentation suggestion for @axiprime:method ChatInputCommandInteraction#awaitModalSubmit() Collects a single modal submit interaction that passes the filter. The Promise will reject if the time expires.
axiprime
axiprime2y ago
the like above is about that with a bigger example. But thanks ^^