mz10ah
Explore posts from serversDIAdiscord.js - Imagine an app
•Created by mz10ah on 10/14/2023 in #djs-questions
Error while trying to preserve previous components when adding new component to an existing message
Greetings,
I am trying to write a script which would append a select menu to existing components.
Here is my code to do that.
One challenge or error which I am facing right now is:
I am well aware what this error means and I feel like discord is thinking that I attempting to duplicate the old components which I am not or maybe my theory is wrong.
I am not sure what other steps I could follow to achieve this objective or fix this error. Anyone got any ideas?
5 replies
DIAdiscord.js - Imagine an app
•Created by mz10ah on 3/16/2023 in #djs-questions
Get interaction options values through ModalSubmitInteraction (Modal listener)
Hi
I was wondering whether there is any way to retrieve interaction options (slash command options values) through ModalSubmitInteraction?
The doc (https://discord.js.org/#/docs/discord.js/main/class/ModalSubmitInteraction) says nothing about it so I am guessing you can't?
This is my use case:
- I have two interaction listeners: One for slash commands (BaseCommandInteraction) and another for Modals (ModalSubmitInteraction).
- When you use a slash command, it takes two inputs from you using options and then it pops up a modal.
- The ModalSubmit event (or the whole modal itself) is handled by the Modal listener (ModalSubmitInteraction).
- I want to get the values of the 2 options of slash command in Modal listener
- But I am not sure the best way to do it
- So does anybody know any other way to do it?
Thanks in advance 🙂
15 replies