lib/bobot/events/common.rb in bobot-3.7.3 vs lib/bobot/events/common.rb in bobot-3.7.6

- old
+ new

@@ -27,63 +27,63 @@ def sent_at Time.zone.at(@messaging['timestamp'] / 1000) end - def sender_action(sender_action:) - page.sender_action(sender_action: sender_action, to: sender["id"]) + def sender_action(sender_action:, messaging_type: "RESPONSE") + page.sender_action(sender_action: sender_action, to: sender["id"], messaging_type: messaging_type) end - def show_typing(state:) - page.show_typing(state: state, to: sender["id"]) + def show_typing(state:, messaging_type: "RESPONSE") + page.show_typing(state: state, to: sender["id"], messaging_type: messaging_type) end - def mark_as_seen - page.mark_as_seen(to: sender["id"]) + def mark_as_seen(messaging_type: "RESPONSE") + page.mark_as_seen(to: sender["id"], messaging_type: messaging_type) end - def reply(payload_message:) - page.send(payload_message: payload_message, to: sender["id"]) + def reply(payload_message:, messaging_type: "RESPONSE") + page.send(payload_message: payload_message, to: sender["id"], messaging_type: messaging_type) end - def reply_with_text(text:) - page.send_text(text: text, to: sender["id"]) + def reply_with_text(text:, messaging_type: "RESPONSE") + page.send_text(text: text, to: sender["id"], messaging_type: messaging_type) end - def reply_with_youtube_video(url:) - page.send_youtube_video(url: url, to: sender["id"]) + def reply_with_youtube_video(url:, messaging_type: "RESPONSE") + page.send_youtube_video(url: url, to: sender["id"], messaging_type: messaging_type) end - def reply_with_attachment(url:, type:) - page.send_attachment(url: url, type: type, to: sender["id"]) + def reply_with_attachment(url:, type:, messaging_type: "RESPONSE") + page.send_attachment(url: url, type: type, to: sender["id"], messaging_type: messaging_type) end - def reply_with_image(url:) - page.send_image(url: url, to: sender["id"]) + def reply_with_image(url:, messaging_type: "RESPONSE") + page.send_image(url: url, to: sender["id"], messaging_type: messaging_type) end - def reply_with_audio(url:) - page.send_audio(url: url, to: sender["id"]) + def reply_with_audio(url:, messaging_type: "RESPONSE") + page.send_audio(url: url, to: sender["id"], messaging_type: messaging_type) end - def reply_with_video(url:) - page.send_video(url: url, to: sender["id"]) + def reply_with_video(url:, messaging_type: "RESPONSE") + page.send_video(url: url, to: sender["id"], messaging_type: messaging_type) end - def reply_with_file(url:) - page.send_file(url: url, to: sender["id"]) + def reply_with_file(url:, messaging_type: "RESPONSE") + page.send_file(url: url, to: sender["id"], messaging_type: messaging_type) end - def reply_with_quick_replies(text:, quick_replies:) - page.send_quick_replies(text: text, quick_replies: quick_replies, to: sender["id"]) + def reply_with_quick_replies(text:, quick_replies:, messaging_type: "RESPONSE") + page.send_quick_replies(text: text, quick_replies: quick_replies, to: sender["id"], messaging_type: messaging_type) end - def reply_with_buttons(text:, buttons:) - page.send_buttons(text: text, buttons: buttons, to: sender["id"]) + def reply_with_buttons(text:, buttons:, messaging_type: "RESPONSE") + page.send_buttons(text: text, buttons: buttons, to: sender["id"], messaging_type: messaging_type) end - def reply_with_generic(elements:, image_aspect_ratio: 'square') - page.send_generic(elements: elements, image_aspect_ratio: image_aspect_ratio, to: sender["id"]) + def reply_with_generic(elements:, image_aspect_ratio: 'square', messaging_type: "RESPONSE") + page.send_generic(elements: elements, image_aspect_ratio: image_aspect_ratio, to: sender["id"], messaging_type: messaging_type) end alias_method :reply_with_carousel, :reply_with_generic def page Bobot::Page.find(recipient["id"])