Complete refactor

This commit is contained in:
2023-01-10 12:52:44 +01:00
parent 9261585f5f
commit 6facf428c5
12 changed files with 369 additions and 362 deletions

11
modules/scheduler.py Normal file
View File

@@ -0,0 +1,11 @@
from datetime import datetime
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from modules.utils import configGet
from modules.sender import send_content
scheduler = AsyncIOScheduler()
if configGet("post", "mode"):
for entry in configGet("time", "posting"):
dt_obj = datetime.strptime(entry, "%H:%M")
scheduler.add_job(send_content, "cron", hour=dt_obj.hour, minute=dt_obj.minute)