FIX handler for messenger BOT AO
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
170ec64cec
commit
b46de0d4f0
@ -180,3 +180,18 @@ def handle_message_event(page_id: str, sender_psid: str, message: dict):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception(f"handle_message_event crashed: {e}")
|
logger.exception(f"handle_message_event crashed: {e}")
|
||||||
return JsonResponse({"status": "error", "detail": str(e)}, status=200)
|
return JsonResponse({"status": "error", "detail": str(e)}, status=200)
|
||||||
|
|
||||||
|
def handle_postback_event(page_id: str, sender_psid: str, postback: dict):
|
||||||
|
"""
|
||||||
|
Minimal stub so views.py import succeeds.
|
||||||
|
Logs and immediately 200s. We'll upgrade it later to AI-reply if you want.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
payload = (postback or {}).get("payload")
|
||||||
|
title = (postback or {}).get("title")
|
||||||
|
logger.info(f"[HANDLER] postback page={page_id} psid={sender_psid} payload={payload!r} title={title!r}")
|
||||||
|
return JsonResponse({"status": "postback_handled", "payload": payload}, status=200)
|
||||||
|
except Exception as e:
|
||||||
|
logger.exception(f"postback handler failed: {e}")
|
||||||
|
return JsonResponse({"status": "error", "detail": str(e)}, status=200)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user