Can you wait for user response message with bwmarrin/discordgo?

Issue

Is there any option to wait for user response message in discordgo? I’m looking for something similar to discord.js awaitMessages.

Solution

No, but you can make a collection that holds message and event information and checking news messages.

Simply

  1. Make a collection/array
  2. Add message information
  3. Check if the incoming message in the message event handler is in the collection
  4. Handle event
  5. Remove from collection

Don’t forget set a timeout and clear expired data from collection.

Answered By – Eren A. Akyol

Answer Checked By – Katrina (GoLangFix Volunteer)

Leave a Reply

Your email address will not be published.