Skip to content

Commit cf96329

Browse files
author
Alvin Reyes
authored
Merge pull request #120 from alvin-reyes/master
Added Quick Reply Image
2 parents a422b8e + f8a7e31 commit cf96329

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/TextMessageBuilder.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,29 @@ public TextMessageBuilder addQuickReply(String title, String payload) {
7777
this.quickReplies.add(new QuickReply(title, payload));
7878
return this;
7979
}
80+
81+
/**
82+
* Adds a {@link QuickReply} to the current object.
83+
*
84+
* @param title
85+
* the quick reply button label. It can't be empty.
86+
* @param payload
87+
* the payload sent back when the button is pressed. It can't be
88+
* empty.
89+
* @param imageUrl
90+
* the image to show on the quick reply.
91+
* @return this builder.
92+
* @see <a href=
93+
* "https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies"
94+
* > Facebook's Messenger Platform Quick Replies Documentation</a>
95+
*/
96+
public TextMessageBuilder addQuickReply(String title, String payload, String imageUrl) {
97+
if (this.quickReplies == null) {
98+
this.quickReplies = new ArrayList<QuickReply>();
99+
}
100+
this.quickReplies.add(new QuickReply(title, payload, imageUrl));
101+
return this;
102+
}
80103

81104
/**
82105
* Adds a {@link QuickReply} to the current object.

0 commit comments

Comments
 (0)