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
1msg = await client.wait_for("message", check=check, timeout=60)
2#@Grepper Name
3#https://www.codegrepper.com/app/profile.php?id=180238
4#thats a good example, this is just a modofication, with a timeout
5#just add the timeout={timeoutsecs}
1playerChoice = await bot.wait_for('message', check=check(context.author), timeout=30)