Refactor bot and integrate services
This commit is contained in:
16
app.py
Normal file
16
app.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from aiogram import Bot, Dispatcher
|
||||
from config import load_cfg, load_env
|
||||
|
||||
cfg = load_cfg()
|
||||
|
||||
TOKEN = cfg["telegram"]["token"]
|
||||
ADMIN_ID = cfg["telegram"]["admin_id"]
|
||||
|
||||
ARTIFACT_STATE = cfg["paths"]["artifact_state"]
|
||||
RESTIC_ENV = load_env(cfg["paths"].get("restic_env", "/etc/restic/restic.env"))
|
||||
|
||||
DISK_WARN = int(cfg.get("thresholds", {}).get("disk_warn", 80))
|
||||
LOAD_WARN = float(cfg.get("thresholds", {}).get("load_warn", 2.0))
|
||||
|
||||
bot = Bot(TOKEN)
|
||||
dp = Dispatcher()
|
||||
Reference in New Issue
Block a user