python discord bot wait for response

Solutions on MaxInterview for python discord bot wait for response by the best coders in the world

showing results for - "python discord bot wait for response"
Jannik
14 May 2016
1# Use Client.wait_for to wait for on_message event.
2
3@commands.command()
4async def greet(ctx):
5    await ctx.send("Say hello!")
6
7    def check(m):
8        return m.content == "hello" and m.channel == channel
9
10    msg = await bot.wait_for("message", check=check)
11    await ctx.send(f"Hello {msg.author}!")