How can I make a command in which my bot waits for a reply from the author after typing a command? Thanks
Use Client.wait_for to wait for on_message event.
@commands.command()
async def greet(ctx):
await ctx.send("Say hello!")
def check(m):
return m.content == "hello" and m.channel == channel
msg = await bot.wait_for("message", check=check)
await ctx.send(f"Hello {msg.author}!")
What Fixator10 posted returned "Channel" is undefined for me. I changed it to "return m.content == "hello" and m.channel == ctx.channel" and it worked
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With