Calling promise function twice causes error
I have the following function that should await either a message from the user, or await a button click.
The first time works as intended. Either button clicks or message inputs cause the customId or message content to be available and used.
However, if I try to call the function twice, I get this error:
The code has stopped working ever since implementing this function, so I think it's likely I am missing some problem with it.
However, it's also possible that it's not the function that causes the problem and it's something else instead.
I'd appreciate it if someone else could look at the function and tell me if there's any problems with the execution.
The message variable is the following:
2 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
There is one other alternative I can think of: I'm trying to make a submenu system, where you have a main interface, but use buttons/inputs to manipulate values on the main embed
so perhaps there's a conflict between awaiting message components on the main embed while also awaiting components on the submenus
I have no clue if that truly conflicts though, I'd have to test extensively for that
hmm. How do I clear both collectors after Promise.any() resolves/rejects?
I see, I suppose that makes sense
alright, I'll try that then
so using regular collectors worked so far. One problem I now have is with collector.stop()
Since I only want one message or one button press, I stop them as soon as they collect. But how do I stop both collectors if only one of them collected something?
I seem to trigger the "end" eventlistener by doing this
the reason?
oh, I see what you mean