I can't seem to understand why CTL+C
is not working.
I think it's something I don't yet understand about the way async functions work and asyncio.sleep()
However, I have found this bug report which might be related as well as people using event loops with async functions in python. Also, there are questions like run async while loop independently but they don't really answer my question or provide insight.
async def set_maintain_countdown_message(countdown, message):
try:
countdown_message = await app.send_message(
message.chat.id,
await get_formated_countdown(countdown)
)
await asyncio.sleep(random.randint(4, 8))
while countdown['state'] == 'active':
await countdown_message.edit(
await get_formated_countdown(countdown)
)
await asyncio.sleep(random.randint(4, 8))
except FloodWait as e:
await asyncio.sleep(e.x)