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 šŸ™‚
Was this page helpful?