Editing a message to insert a new component gives "Interaction failed" message?
Pretty simple thing here.
Within my Discord bot, after a user successfully selects an option from a
StringSelectMenu
that the bot sends to them, in the code I have the bot .edit()
the message that contained the StringSelectMenu in it that the user just chose from.
Everything runs fine, and the bot correctly edits the firstMessage
message and moves on. (It edits firstMessage
by providing new text and new, separate ChannelSelectMenu.)
But even though everything was correct and the message gets edited, the user still sees the warning "Interaction failed" in the Discord UI. I have no idea why this warning is being thrown, as everything is running successfully and there are not crashes?
How do I ensure "Interaction failed" is not displayed to the user after they select an option from the initial StringSelectMenu
(in firstMessage
)?12 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 OPediting the message does not acknowlegde the interaction
so you either have to reply, or if the interaction happened on the message you are trying to edit, call <Interaction>.update
Oh, I see. So if I use <Interaction>.update on
firstMessage
, it will register that the interaction was responded to?no
firstMessage is not an Interaction
Right. That's what I thought would be the issue. So I'd need to grab the interaction of the user clicking a specific Select menu option?
you have it
choiceSelected
And then use
.update()
on that interaction? (In this case choiceSelected
, right?)yes
do actually pass params into the update though
Okay, cool, that's what I thought too. Thanks, lemme try that.
Sorry, what do you mean by this?
replace your edit with update
Fantastic, that seems to have worked! Thanks so much for helping to clear up the difference between those two! 💚
You've really improved my day. So seriously, thanks for your time.
you're welcome!