xtool
xtool

Reputation: 31

RuntimeWarning: coroutine "FUNCTION" was never awaited

so im getting this error and i don't know what im doing wrong , it says that my function was never awaited when it actually was

CODE

@sclient.on('auth_code_required')
async def auth_code_prompt(is_2fa, mismatch):
    def check(m):
            return m.channel == c
    if is_2fa:
        await c.send("2FA required ! please provide your 2fa code")
        code = await client.wait_for('message',check = check)
        client.login(two_factor_code=code,username =  u.content,password = p.content)
    else:
        await c.send("Email Guard")
        code = await client.wait_for('message',check = check)
        client.login(auth_code=code, username =  u.content,password = p.content)

ERROR:

RuntimeWarning: coroutine 'auth_code_prompt' was never awaited

Upvotes: 1

Views: 2050

Answers (1)

exhuma
exhuma

Reputation: 21727

It simply means that you never used await auth_code_prompt(...) in your code.

Maybe you accidentally called it without using await?

Upvotes: 1

Related Questions