Skip to content

Commit

Permalink
skip for reaction type and log error for any other message type
Browse files Browse the repository at this point in the history
  • Loading branch information
alliance-techfunctionals committed Dec 24, 2024
1 parent f6b873a commit 89a6704
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion waba_integration/api/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def handle():
continue
elif message.get("errors") and message.get("errors")[0].get("code") == 131051: # if got an error code 131051, then skip the message
continue
elif message.get("type") not in ['text', 'image', 'audio', 'video', 'system', 'document']: # if got a reaction or any unsupported message type, then skip the message
elif message.get("type") == 'reaction': # if got a reaction, then skip the message
continue
elif message.get("type") not in ['text', 'image', 'audio', 'video', 'system', 'document']: # if any unsupported message type, then skip the message
frappe.log_error("Log From IDML,Ignoring this Message Because Unsupported Message Type", frappe.as_json(message))
continue
else: # else create a new WABA WhatsApp Message
Expand Down

0 comments on commit 89a6704

Please sign in to comment.