move defaults to the separate module

This commit is contained in:
Von Random 2024-10-23 14:35:36 +03:00
parent abe38388b6
commit df3a990614
4 changed files with 6 additions and 13 deletions

View file

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