How to update a message after the interaction with a component without using a component collector.
I have a log member sistem that sends a message with a webhook when a member joins the server. This message has a button attached to it, and when this button is activated a modal is shown. i want to update the message (more specifically only the label of the button) when this modal is submitted. How do i do this without using a component collector for the button? (i have a component handler)
9 Replies
- 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 ButtonInteraction#update()
Updates the original message of the component on which the interaction was received on.
But doing like this i am able to update the message when the button is activated not when the modal is submitted
ModalSubmitInteraction#update()
Updates the original message of the component on which the interaction was received on.
ok ty it works
how do i do if i want to reply to the modal and then update the message?
or update the message and the reply it’s the same
I don't think you can.
.update()
and then .followUp()
i mean
.update()
and then .reply()
but i have the interaction already replied errorYou can send the initial response only once.
.update()
and .reply()
both sends initial response. After the initial response you can use .followUp()
ok