I would like to use an async check function:
async def check(reaction, user):
await x
return y
await self.bot.wait_for('reaction_add', check=check)
This yields an error message that says the check function isn't awaited:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ExtensionFailed: Extension 'cogs.boost' raised an error: SyntaxError: 'await' outside async function
If I change the code to:
async def check(reaction, user):
await x
return y
await self.bot.wait_for('reaction_add', check=await check)
I get the following error message:
TypeError: object function can't be used in 'await' expression
Is there any way to have an async check function? Thanks!