Update send_on_line_service.rb

This commit is contained in:
Muhsin Keloth
2023-11-24 15:30:04 +05:30
parent 1ded5bfc13
commit bf08274712
+2 -2
View File
@@ -24,7 +24,7 @@ class Line::SendOnLineService < Base::SendOnChannelService
def build_payload
if message.content && message.attachments.any?
[text_message, *attachments]
elsif message.content.empty? && message.attachments.any?
elsif message.content.nil? && message.attachments.any?
attachments
else
text_message
@@ -34,7 +34,7 @@ class Line::SendOnLineService < Base::SendOnChannelService
def attachments
message.attachments.map do |attachment|
{
type: 'image',
type: attachment.file_type,
originalContentUrl: attachment.download_url,
previewImageUrl: attachment.download_url
}