25 lines
691 B
Python
25 lines
691 B
Python
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))
|