xTwisteDx
DIAdiscord.js - Imagine an app
•Created by xTwisteDx on 4/29/2025 in #djs-questions
How do I create confirmation flows?
I'm attempting to implement a button that has a deletion function, however I want to confirm that action before proceeding. Here is my current code.
This properly prompts the user with the confirmation dialogue, however I can't then also click "Confirm" or "Delete" without it throwing an error
The button ID format is invalid
I'm expecting to use the same ephemeral message, editing the original "Confirm" or "Cancel" confirmation message, editing it to send a success or error message.2 replies
DIAdiscord.js - Imagine an app
•Created by xTwisteDx on 4/28/2025 in #djs-questions
How do I properly manage a modal?
I'm attempting to get a modal working and I have my flow setup like this.
- Slash command /debug
- Create Custom Modal
- Create Filter
-
interaction.showModal(...)
- interaction.awaitModalSubmit(...)
- modalInteraction.reply
My code is as follows.
Something is "Off" about this as I consistently get errors such as:
- Unknown Interaction
- Collector received no interactions before ending with reason: time
- The reply to this interactions has not been sent or deferred
Which suggests to me that I honestly have no idea what is required to properly show a modal, and get its reply back with the data. Is there a standard way of prompting for a modal input and getting the responses back?
NOTE This is showing the modal, and I am getting the data back, but the catch block is always being thrown with those errors. The bot is not crashing.21 replies
DIAdiscord.js - Imagine an app
•Created by xTwisteDx on 4/27/2025 in #djs-questions
Why do I sometimes have to provide <true> to certain types?
I'm not entirely sure why sometimes I have to provide
<true>
to a type annotation. I've only seen this twice so far. For example. Does this have something to do with the message cache?
3 replies