L
L
Lukas Tumas2020-06-21 01:22:55
Python
Lukas Tumas, 2020-06-21 01:22:55

How to make the issuance of a role in def?

Hello, while doing the mute command, I ran into a problem.
Problem: When time passes, the def unmute() function is run, but when I try to remove the role of the tormented one, it writes the following -- 'await' outside async function

What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
selfkilla666, 2020-06-21
@selfkilla

The problem is that you are using an asynchronous await in a synchronous function . To solve, use an asynchronous function through which you call the issuance of roles:

async def unmute(**kwargs):
    ... # Ваш код
and call this function with
await unmute()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question