1@client.command(name="command")
2async def _command(ctx):
3 global times_used
4 await ctx.send(f"y or n")
5
6 # This will make sure that the response will only be registered if the following
7 # conditions are met:
8 def check(msg):
9 return msg.author == ctx.author and msg.channel == ctx.channel and \
10 msg.content.lower() in ["y", "n"]
11
12 msg = await client.wait_for("message", check=check)
13 if msg.content.lower() == "y":
14 await ctx.send("You said yes!")
15 else:
16 await ctx.send("You said no!")
17
18 times_used = times_used + 1
19
1playerChoice = await bot.wait_for('message', check=check(context.author), timeout=30)