fix: Stop raising errors for unsupported Whatsapp messages (#5541)

- Handle unsupported Whatsapp messages
This commit is contained in:
Tejaswini Chile
2022-10-14 02:01:49 +05:30
committed by GitHub
parent 8f4944fda0
commit a533f43fbf
2 changed files with 58 additions and 1 deletions

View File

@@ -12,7 +12,7 @@ class Whatsapp::IncomingMessageBaseService
set_conversation
return if @processed_params[:messages].blank?
return if @processed_params[:messages].blank? || unprocessable_message_type?
@message = @conversation.messages.build(
content: message_content(@processed_params[:messages].first),
@@ -86,6 +86,10 @@ class Whatsapp::IncomingMessageBaseService
@processed_params[:messages].first[:type]
end
def unprocessable_message_type?
%w[reaction contacts].include?(message_type)
end
def attach_files
return if %w[text button interactive].include?(message_type)