Skip to content
Discussion options

You must be logged in to vote

Another example in a command

@bot.command()
async def game(ctx):
    await ctx.send("What is 2+3?")
    response = await bot.wait_for("message", check=lambda m: m.author == ctx.author and m.channel == ctx.channel)
    if response.content == "5":
        return await ctx.send("Correct!")

The check ensures that the wait for only triggers it the message was sent in the same channel by the same user

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@jbaumgarten
Comment options

@CaedenPH
Comment options

Answer selected by jbaumgarten
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants