Open therealmistericraft opened 4 years ago
Changelog: Added precise fix possibility
Anticipated fix couldn't solve the problem. time.wait()
does not exist. Searching for other solution.
asyncio
?
@therealmistericraft
Use await asyncio.sleep()
and threading
. Start a new thread and sleep there.
Use
await asyncio.sleep()
andthreading
. Start a new thread and sleep there.
That is my solution as well, look at "How to fix this?".
Not directly. await asyncio.sleep()
is better in asynchronous programming than time.sleep()
Why? But it works in both cases, so I probably wont change it.
Why? But it works in both cases, so I probably wont change it.
https://discordpy.readthedocs.io/en/latest/faq.html#what-does-blocking-mean
Why? But it works in both cases, so I probably wont change it.
You don't need threading when using await asyncio.sleep()
, since when another command is called during the sleeping-time, the sleep()-function will pause until the other command has finished.
Description
time.sleep
pauses the whole script, not only the command executed by THE person.Issue Source
Runnig any command that has a sleep function in it, or the welcome message
Current behavior
The whole bot stops working for the slept time
Expected behavior
Only this executement of the command sleeps.
Attachements
See RCCar, Issue 1
Device and software
How to fix?
Run commands with
time .sleep
as a newthreading.Thread