How can I make the following thing happen

I want to update an already existing message first and then show a modal. But the error occurs replying the interaction has already been replied. How do I make them both work. Update:
await interaction.update("Creating modal")
await interaction.update("Creating modal")
Show modal:
await interaction.showModal(modal1)
await interaction.showModal(modal1)
7 Replies
d.js toolkit
d.js toolkit8mo 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! - Marked as resolved by OP
chewie
chewie8mo ago
You have to show the modal first, there is no way around that. Also you could try using interaction.message.edit()
Gripz
GripzOP8mo ago
Wait, lemme explain a bit. I have a message (message is ephemeral) which has button. I was listening to this button by the InteractionCreate event. - So what I want is that, when I click this button, the message which had this button, to be updated and get changed to "Creating modal" and then the modals shows up. - When the modal is submitted, the same message which was "Creating modal" gets changed to "Modal submitted". How can I achieve this ? So, the problem arises that either am able to interaction.showModal or do interaction.update. @chewie 🌈 is there any way ?
${RVX}
${RVX}8mo ago
by literally doing what he said edit the message before responding to the interaction
Gripz
GripzOP8mo ago
No description
No description
kin.ts
kin.ts8mo ago
ephemeral message can only be edited via interaction webhooks endpoint
duck
duck8mo ago
which is to say, you'd use <ButtonInteraction>.editReply() you can specify <ButtonInteraction.message as the message when using this method (this can only be done after showing the modal)
Want results from more Discord servers?
Add your server