Nested Collector

If i have a button that opens up a modal, do i add the modal collector in the button collector or is there another way? Coming back to djs after a long time so my brain isnt braining.
// Button Collector
// Modal Appearing
// Modal Collector
// Button Collector
// Modal Appearing
// Modal Collector
or
// Button Collector
// Modal Appearing
// Modal Collector
// Button Collector
// Modal Appearing
// Modal Collector
9 Replies
d.js toolkit
d.js toolkit11mo 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!
d.js docs
d.js docs11mo ago
method ButtonInteraction#awaitModalSubmit() Collects a single modal submit interaction that passes the filter. The Promise will reject if the time expires.
treble/luna
treble/luna11mo ago
call that on the interaction you showed the modal on
Ateeb Sohail
Ateeb SohailOP11mo ago
Oh okay, and then if i want a series of buttons in it, like after modal submit theres another embed with button and i wanna do that is there a similar thing?
treble/luna
treble/luna11mo ago
reply to the collected modal intefraction with that embed though if you plan on making your buttons a single press, you're probably better off using the promisified collector
Ateeb Sohail
Ateeb SohailOP11mo ago
alright thank you whats the maximum time i can keep it running, any clue?
treble/luna
treble/luna11mo ago
that can be anything really, just note they're not persistent in non promisifed ones you can omit the time the promisified ones will reject after the specified time
Ateeb Sohail
Ateeb SohailOP11mo ago
okay so i can even keep a button available for say, days
treble/luna
treble/luna11mo ago
yeah if you want it to be permanently available you'd have to use the interactionCreate event
Want results from more Discord servers?
Add your server