Answers for "use an async check function for discord.py wait_for?"

0

use an async check function for discord.py wait_for?

import asyncio

@client.command()
async def test(ctx):

    async def run(msg):
        await msg.send("This message is not yours!", hidden=True)
        return


    def check(msg):

        if msg.author.id == ctx.author.id:
            return True
        else:
            asyncio.create_task(run(msg))
            return False

    ctx = await client.wait_for("message", check=check)

    ...
Posted by: Guest on September-10-2021

Code answers related to "use an async check function for discord.py wait_for?"

Python Answers by Framework

Browse Popular Code Answers by Language