Asyncio.sleep() in repls
So here is my problem:
- I need to set up a loop that need to work at a determined time every day.
- I use await asyncio.sleep() for the bot to wait at a specified time and then start the task loop.
- I try it but it never arrive to start the loop.
If I remove the asyncio.sleep(), it works perfectly fine.
- I feel like replit is killing my asyncio.sleep().....
here is the code part:
Because in python you could use time.sleep() but that stops all threads
@firefish It was used in a discord bot. I needed my bot to wait until a specified time to start a daily loop. I have now changed the part to use
wait_until() and the code up here has been deleted. I have three options:
1 - Using other commands of my bot killed the sleep function.
2 - Replit killed my sleep function because it was taking too long.
3 - My implementation was trash and it didnt waited the specified time.
Anyway, I changed to 'wait_until', who does the calculations for me and I don't need to stress about asyncio.sleep() not working.