Spaces:
Sleeping
Sleeping
Remove debugging print statements from webhook functions
Browse files- telegram_handlers.py +0 -6
telegram_handlers.py
CHANGED
|
@@ -20,8 +20,6 @@ class WebhookData(BaseModel):
|
|
| 20 |
|
| 21 |
async def telegram_webhook(data: WebhookData):
|
| 22 |
try:
|
| 23 |
-
print(f"Received webhook data: {data}")
|
| 24 |
-
|
| 25 |
if data.message:
|
| 26 |
telegram_id = data.message.chat.id
|
| 27 |
user_text = data.message.text
|
|
@@ -59,13 +57,10 @@ async def telegram_webhook(data: WebhookData):
|
|
| 59 |
|
| 60 |
return {"status": "ok"}
|
| 61 |
except Exception as e:
|
| 62 |
-
print(f"Error in webhook: {str(e)}")
|
| 63 |
return {"status": "error", "message": str(e)}
|
| 64 |
|
| 65 |
async def test_webhook(data: WebhookData):
|
| 66 |
try:
|
| 67 |
-
print(f"Received test webhook data: {data}")
|
| 68 |
-
|
| 69 |
if not data.message:
|
| 70 |
return {"error": "Missing 'message' field in request"}
|
| 71 |
|
|
@@ -85,5 +80,4 @@ async def test_webhook(data: WebhookData):
|
|
| 85 |
|
| 86 |
return {"response": response}
|
| 87 |
except Exception as e:
|
| 88 |
-
print(f"Error in test webhook: {str(e)}")
|
| 89 |
return {"error": str(e)}
|
|
|
|
| 20 |
|
| 21 |
async def telegram_webhook(data: WebhookData):
|
| 22 |
try:
|
|
|
|
|
|
|
| 23 |
if data.message:
|
| 24 |
telegram_id = data.message.chat.id
|
| 25 |
user_text = data.message.text
|
|
|
|
| 57 |
|
| 58 |
return {"status": "ok"}
|
| 59 |
except Exception as e:
|
|
|
|
| 60 |
return {"status": "error", "message": str(e)}
|
| 61 |
|
| 62 |
async def test_webhook(data: WebhookData):
|
| 63 |
try:
|
|
|
|
|
|
|
| 64 |
if not data.message:
|
| 65 |
return {"error": "Missing 'message' field in request"}
|
| 66 |
|
|
|
|
| 80 |
|
| 81 |
return {"response": response}
|
| 82 |
except Exception as e:
|
|
|
|
| 83 |
return {"error": str(e)}
|