public class ButtonTemplateBuilder extends TemplateBaseBuilder
messageBuilder| Modifier and Type | Method and Description |
|---|---|
ButtonTemplateBuilder |
addButton(Button button)
Adds a button to the current template.
|
ButtonTemplateBuilder |
addPhoneNumberButton(String title,
String phoneNumber)
Adds a button with a phone number to the current template.
|
ButtonTemplateBuilder |
addPostbackButton(String title,
String payload)
Adds a button which sends a payload back when clicked to the current
template.
|
ButtonTemplateBuilder |
addUrlButton(String title,
String url)
Adds a button which redirects to an URL when clicked to the current
template.
|
FbBotMillResponse |
build(MessageEnvelope envelope)
Builds the
FbBotMillResponse that the bot should return. |
String |
toString() |
getRecipienteventKind, getLocationMessage, safeGetMessage, safeGetPostbackPayload, safeGetQuickReplyPayload, safeGetRecipient, safeGetRecipientId, safeGetSender, safeGetSenderId, validatepublic ButtonTemplateBuilder addUrlButton(String title, String url)
title - the button label.url - the URL to whom redirect when clicked.public ButtonTemplateBuilder addPhoneNumberButton(String title, String phoneNumber)
title - the button label.phoneNumber - a phone number.public ButtonTemplateBuilder addPostbackButton(String title, String payload)
title - the button label.payload - the payload to send back when clicked.public ButtonTemplateBuilder addButton(Button button)
button - the button to add.public FbBotMillResponse build(MessageEnvelope envelope)
FbBotMillResponse that the bot should return. Creates a response that contains a Button Template.envelope - a MessageEnvelope object representing the incoming
message.FbBotMillResponse of this bot.public String toString()
toString in class TemplateBaseBuilderCopyright © 2017 BotMill. All rights reserved.