@@ -29,6 +29,7 @@ class Whatsapp::IncomingMessageService
|
||||
def message_content(message)
|
||||
# TODO: map interactive messages back to button messages in chatwoot
|
||||
message.dig(:text, :body) ||
|
||||
message.dig(:button, :text) ||
|
||||
message.dig(:interactive, :button_reply, :title) ||
|
||||
message.dig(:interactive, :list_reply, :title)
|
||||
end
|
||||
@@ -77,7 +78,7 @@ class Whatsapp::IncomingMessageService
|
||||
|
||||
def attach_files
|
||||
message_type = params[:messages].first[:type]
|
||||
return if %w[text interactive].include?(message_type)
|
||||
return if %w[text button interactive].include?(message_type)
|
||||
|
||||
attachment_payload = params[:messages].first[message_type.to_sym]
|
||||
attachment_file = Down.download(inbox.channel.media_url(attachment_payload[:id]), headers: inbox.channel.api_headers)
|
||||
|
||||
Reference in New Issue
Block a user