Is there a way to simultaneously use awaitMessages and awaitMessageComponent?

I'm currently using a do while loop to modify entries in a list. If the user enters "done", it exits that loop. However, I am curious if there's a way to perform that action with a button instead. So the process would be as follows:

  • Display list
  • Await message and append entry to the list
  • ... but if a button is pressed instead, exit the loop.
Up until now, I have worked exclusively with the two methods mentioned in the title. The problem with collector.on listeners is that they do not work in a while loop, since they can't be awaited.
If collector.on listeners are the way to go, I'd like to know if it's possible to place them in a promise.
Was this page helpful?