Best way to achieve a questions/answer bot #9000
-
Guys, I try to dev a bot which handle many questions/answers which should work like:
Is there a way to achieve this in a command or should I parse on_message events? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You can use the For example message = await bot.wait_for("message")
print(message) More documentation here: |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
Another example in a command
The
check
ensures that the wait for only triggers it the message was sent in the same channel by the same user