configs and defaults

This commit is contained in:
Von Random 2024-10-23 14:26:09 +03:00
parent f7d9afbd43
commit abe38388b6
7 changed files with 17 additions and 3 deletions

View file

@ -5,6 +5,7 @@ import yaml
import aiocron
import telethon
import pgbotlib.response
import pgbotlib.misc
class Cron:
@ -12,7 +13,8 @@ class Cron:
config: dict,
client: telethon.TelegramClient,
responder: pgbotlib.response.Responder) -> None:
with open(config['schedule'], 'r', encoding='utf-8') as data:
schedule_conf = config.get('schedule', pgbot.misc.Paths.SCHEDULE)
with open(schedule_conf, 'r', encoding='utf-8') as data:
self.sched = yaml.safe_load(data.read())
self.responder = responder
self.client = client