tebrox / main.py
understanding's picture
Update main.py
3140238 verified
raw
history blame
471 Bytes
# main.py
import asyncio
import logging
import uvicorn
from fastapi import FastAPI
from bot import dp, bot, on_startup, main_loop_task
app = FastAPI()
@app.on_event("startup")
async def startup_event():
logging.info("Starting bot polling in background...")
asyncio.create_task(main_loop_task())
@app.get("/health")
async def health():
return {"status": "ok"}
if __name__ == "__main__":
uvicorn.run("main:app", host="0.0.0.0", port=7860, reload=False)