Modal Submit, how to edit triggering ephemeral?

If I'm triggering a modal from an ephemeral message button, is it possible to edit the original ephemeral message during modal submit? When I try interaction.message.edit(...) I get an error "Unknown Message". The message object seems to be populated as expected...
11 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
duck
duck2y ago
ephemeral messages can only be edited/updated via interaction on modal submit, you could just use <ModalSubmitInteraction>.update() if you aren't otherwise responding to the interaction otherwise you could use interaction.webhook.editMessage()
billytheape
billytheapeOP2y ago
Hmm, I only see deferUpdate as an option
d.js docs
d.js docs2y ago
method ModalSubmitInteraction#update() Updates the original message of the component on which the interaction was received on.
duck
duck2y ago
if using ts, you may need to typeguard with .isFromMessage()
billytheape
billytheapeOP2y ago
ah Ok great I got it working, thank you! Hey btw secondary question -- do you know if it's possible to trigger a second modal after submitting the first? Or would that have to be done with a second button click?
duck
duck2y ago
it'd have to be a second button click or otherwise separate interaction from the modal submit
billytheape
billytheapeOP2y ago
Hmm how do you create a separate interaction during modal submit?
duck
duck2y ago
you don't I just meant it'd have to be a button click, other component interaction, or application command
billytheape
billytheapeOP2y ago
Gotcha Thanks for your help
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server