Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -75,11 +75,15 @@ async def telegram_webhook(request: Request):
|
|
| 75 |
print("1----------TELEGRAM_TOKEN:", TELEGRAM_TOKEN)
|
| 76 |
print("2---------TELEGRAM_URL:", TELEGRAM_URL)
|
| 77 |
# Send back to Telegram
|
| 78 |
-
async with httpx.AsyncClient() as client:
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
| 80 |
"chat_id": chat_id,
|
| 81 |
"text": ai_answer
|
| 82 |
-
}
|
|
|
|
| 83 |
|
| 84 |
return {"status": "ok"}
|
| 85 |
|
|
|
|
| 75 |
print("1----------TELEGRAM_TOKEN:", TELEGRAM_TOKEN)
|
| 76 |
print("2---------TELEGRAM_URL:", TELEGRAM_URL)
|
| 77 |
# Send back to Telegram
|
| 78 |
+
async with httpx.AsyncClient(verify=False) as client:
|
| 79 |
+
await client.post(
|
| 80 |
+
f"https://149.154.167.220/bot{TELEGRAM_TOKEN}/sendMessage",
|
| 81 |
+
headers={"Host": "api.telegram.org"},
|
| 82 |
+
json={
|
| 83 |
"chat_id": chat_id,
|
| 84 |
"text": ai_answer
|
| 85 |
+
}
|
| 86 |
+
)
|
| 87 |
|
| 88 |
return {"status": "ok"}
|
| 89 |
|