Repeating interaction
Is there a way to use the 'interaction.update' multiple times? So i can make like one button after another :peepoThink: Struggling to do so.
19 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!version is 14.11.0 apparently :PauseFish:
wait what :catHUH: it just works
the await was missing all the time, and that's why it failed probably
EDIT:
It does work for some parts, but not for others
:peepoThink:
Show your code!
:duckOhNo: it's really just a big mess
basically, i change the state on every button press and then it updates the message and buttons
here the part, where the reply.edit is, where i would rather have an update :peepoThink:
well your error would come from responding to an interaction multiple times, not where you call
<Message>.edit()
based on your previous question, my hunch was that you were attempting to use interaction.update()
on the same interaction multiple times rather than responding to each interaction, but that doesn't seem to be the case
assuming you aren't responding the the interactions in any util functions like nextInputState
or something, this code on its own isn't attempting to respond to an interaction multiple times
but if for example this collector was created on the channel rather than on a message, it could be handling interactions you didn't intend for it to handlethe reply.edit() would normally be the interaction.update, which did throw the error
yes, that would be an issue, I was just being verbose in checking off boxes for this issue
i understand the error, but do not understand that i was able to use
interaction.update
multiple times herewell with the logic of the code, only one
interaction.update()
is being called per interaction
because of your switch case and breaks:duckOhNo: now i understand
i'm always getting a new interaction
yes
thank you very much, that clears up alot
i dont know how i could miss that :Lol:
have a nice day :peepoSitLove:
:SCagreed: i was updating the interaction while also answering with a modal, this probably gave the 'is already updated'
that'd definitely do it
you can use
editReply
after showing a modal, but update
and showModal
can both only be used as the initial responsegood stuff, thank you very much again :borpaPrayge:
follow up question
after the modal, i continue with buttons :peepoThink:
currently i have a deferUpdate on the modal and a edit.Reply so that I can more interactions from the same reply
does that make sense to do it like that
you can setup user input however you like
update
can also edit in more components, but if you need to defer, you can defer