From f8a7e318ca8b08d5c28762d747b1b4beadd1883d Mon Sep 17 00:00:00 2001 From: Alvin Reyes Date: Sun, 21 May 2017 12:08:32 -0400 Subject: [PATCH] Added Quick Reply Image --- .../outcoming/factory/TextMessageBuilder.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/TextMessageBuilder.java b/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/TextMessageBuilder.java index 6992bd0..4775c7c 100644 --- a/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/TextMessageBuilder.java +++ b/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/TextMessageBuilder.java @@ -77,6 +77,29 @@ public TextMessageBuilder addQuickReply(String title, String payload) { this.quickReplies.add(new QuickReply(title, payload)); return this; } + + /** + * Adds a {@link QuickReply} to the current object. + * + * @param title + * the quick reply button label. It can't be empty. + * @param payload + * the payload sent back when the button is pressed. It can't be + * empty. + * @param imageUrl + * the image to show on the quick reply. + * @return this builder. + * @see Facebook's Messenger Platform Quick Replies Documentation + */ + public TextMessageBuilder addQuickReply(String title, String payload, String imageUrl) { + if (this.quickReplies == null) { + this.quickReplies = new ArrayList(); + } + this.quickReplies.add(new QuickReply(title, payload, imageUrl)); + return this; + } /** * Adds a {@link QuickReply} to the current object.