understanding's picture
Create bot/server/main.py
0aafa6a verified
raw
history blame
461 Bytes
from quart import Blueprint, jsonify
from bot.startup_log import uptime_s
from bot import TelegramBot
bp = Blueprint("main", __name__)
@bp.route("/")
async def home():
return "OK: talking bot + web server", 200
@bp.route("/health")
async def health():
# simple health + uptime + connected state
return jsonify({
"ok": True,
"uptime_s": uptime_s(),
"connected": bool(getattr(TelegramBot, "is_connected", False))
}), 200