Answers for "python discord bot wait for response"

0

python discord bot wait for response

# 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}!")
Posted by: Guest on August-21-2021

Python Answers by Framework

Browse Popular Code Answers by Language