Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -1,14 +1,17 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
1 |
+
import threading
|
2 |
+
from fastapi import FastAPI
|
3 |
+
from core.integrations.telegram_bot import start_bot
|
4 |
+
|
5 |
+
app = FastAPI()
|
6 |
+
|
7 |
+
def run_telegram_bot():
|
8 |
+
start_bot()
|
9 |
+
|
10 |
+
# Lanzar bot Telegram en hilo aparte para no bloquear FastAPI
|
11 |
+
bot_thread = threading.Thread(target=run_telegram_bot, daemon=True)
|
12 |
+
bot_thread.start()
|
13 |
+
|
14 |
+
@app.get("/")
|
15 |
+
async def root():
|
16 |
+
return {"status": "Bot de Telegram activo"}
|
17 |
+
|