123456789101112131415161718192021 |
- import asyncio
- import aioschedule
- from Moodle import make_calendar, send_calendar
- file_name = "calendar.ics"
- async def updater():
- if await make_calendar.make(file_name):
- await send_calendar.send()
- async def scheduler():
- aioschedule.every().minute.do(updater)
- while True:
- await aioschedule.run_pending()
- await asyncio.sleep(1)
- async def on_start(_):
- asyncio.create_task(scheduler())
|