Spaces:
Running
Running
File size: 353 Bytes
3643ab8 3ffbfe0 3643ab8 3ffbfe0 3643ab8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
from fastapi import FastAPI
from core.integrations.telegram_bot import start_bot
import asyncio
app = FastAPI()
@app.on_event("startup")
async def on_startup():
# Ejecuta el bot como una tarea asincrónica en el mismo event loop
asyncio.create_task(start_bot())
@app.get("/")
async def root():
return {"status": "Bot de Telegram activo"}
|