Reputation: 77
How can I make a command in which my bot waits for a reply from the author after typing a command? Thanks
Upvotes: 2
Views: 15847
Reputation: 41
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
Upvotes: 4
Reputation: 670
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}!")
Upvotes: 11