awaitMessageComponent 'Interaction has already been acknowledged' Error
I have the following piece of code alongside multiple buttons. The idea is that you can
- manipulate the embed with various buttons
- ... until you either confirm the selection or reject it.
- You should be able to press any button as many times as you want, up until you confirm or reject.
If there's a different approach overall, I'd simply like the timer to reset everytime a button is pressed, acting more like an inactivity check.
I am hesitant to use a while loop, since this seems like an obvious infinite loop. A recursive function could cause some memory issues. What is a sensible approach to this task?
Is there a way to "await" a
messageComponentCollector
's response (either from "collect" or "end")?11 Replies
Message#awaitMessageComponent()
Collects a single component interaction that passes the filter. The Promise will reject if the time expires.
This what you want?
wow, that is exactly what I wanted. Thanks for the quick response @Myth 🌈
👍
Currently receiving the following error. I'm not sure what exactly went wrong here ...
seems to specifically be an error with
deferUpdate()
. Removing that line from filter
and changing editreply
to update
fixes it.
But how do you use deferUpdate()
then?
This piece of code is nearly identical to the guide example.Yeah thats not a great example, since the deferUpdate there isnt awaited
should I create a github issue for it?
Nah those sections are being rewritten anyway
alright just wanted to make sure I'm not missing an obvious mistake on my end