Add alert tools, mutes, short status, and backup summary
This commit is contained in:
24
handlers/config_check.py
Normal file
24
handlers/config_check.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from aiogram import F
|
||||
from aiogram.types import Message
|
||||
from app import dp, cfg
|
||||
from auth import is_admin_msg
|
||||
from services.config_check import validate_cfg
|
||||
|
||||
|
||||
@dp.message(F.text == "/config_check")
|
||||
async def config_check(msg: Message):
|
||||
if not is_admin_msg(msg):
|
||||
return
|
||||
errors, warnings = validate_cfg(cfg)
|
||||
lines = []
|
||||
if errors:
|
||||
lines.append("❌ Config errors:")
|
||||
lines += [f"- {e}" for e in errors]
|
||||
if warnings:
|
||||
if lines:
|
||||
lines.append("")
|
||||
lines.append("⚠️ Warnings:")
|
||||
lines += [f"- {w}" for w in warnings]
|
||||
if not lines:
|
||||
lines.append("✅ Config looks OK")
|
||||
await msg.answer("\n".join(lines))
|
||||
Reference in New Issue
Block a user