A
A
AdvoKappa2020-06-04 14:34:30
Python
AdvoKappa, 2020-06-04 14:34:30

SyntaxError: 'await' outside function, how to fix?

@bot.command(pass_context = True)
async def Test(ctx):

    a = 30

    b = 40

if a < b:
    await ctx.send('А меньше Б')


The error is this:
File "take.py", line 44
    await ctx.send('А меньше Б')
    ^
SyntaxError: 'await' outside function

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-06-04
@AdvoKappa

Obviously don't call await outside of the function.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question