-
public final class MessengerBuildersKt
-
-
Field Summary
Fields Modifier and Type Field Description private final ConnectorTypemessengerConnectorType
-
Method Summary
Modifier and Type Method Description final ConnectorTypegetMessengerConnectorType()The Messenger connector type. final <T extends Bus<T>> TsendToMessenger(T $self, Long delay, Function1<T, MessengerConnectorMessage> messageProvider)Sends a Messenger message only if the ConnectorType of the current Bus is messengerConnectorType. final <T extends Bus<T>> TendForMessenger(T $self, Long delay, Function1<T, MessengerConnectorMessage> messageProvider)Sends a Messenger message as last bot answer, only if the ConnectorType of the current Bus is messengerConnectorType. final <T extends Bus<T>> TwithMessenger(T $self, Function0<MessengerConnectorMessage> messageProvider)Adds a Messenger ConnectorMessage if the current connector is Messenger. final <T extends Bus<T>> TwithMessenger(T $self, String connectorId, Function0<MessengerConnectorMessage> messageProvider)Adds a Messenger ConnectorMessage if the current connector is Messenger and the current connector is connectorId. final AttachmentMessagebuttonsTemplate(I18nTranslator $self, CharSequence text, UserAction actions)Creates a button template https://developers.facebook. final AttachmentMessagebuttonsTemplate(I18nTranslator $self, CharSequence text, List<UserAction> actions)Creates a button template https://developers.facebook. final AttachmentMessagemediaTemplate(String mediaUrl, MediaType mediaType, Boolean sharable, UserAction actions)Creates a media template https://developers.facebook. final AttachmentMessagemediaTemplate(String mediaUrl, MediaType mediaType, Boolean sharable, List<UserAction> actions)Creates a media template https://developers.facebook. final AttachmentMessagegenericTemplate(Element elements)Creates a generic template. final AttachmentMessagegenericTemplate(List<Element> elements, List<QuickReply> quickReplies)Creates a generic template. final AttachmentMessagegenericTemplate(List<Element> elements, QuickReply quickReplies)Creates a generic template. final <T extends Bus<T>> AttachmentMessageattachment(T $self, String attachmentUrl, AttachmentType type, QuickReply quickReplies)Creates an attachment. final <T extends Bus<T>> AttachmentMessageattachment(T $self, String attachmentUrl, AttachmentType type, List<QuickReply> quickReplies)Creates an attachment. final <T extends Bus<T>> AttachmentMessageimage(T $self, String imageUrl, QuickReply quickReplies)Creates an image as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment). final <T extends Bus<T>> AttachmentMessageimage(T $self, String imageUrl, List<QuickReply> quickReplies)Creates an image as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment). final <T extends Bus<T>> AttachmentMessageaudio(T $self, String audioUrl, QuickReply quickReplies)Creates an audio file as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment). final <T extends Bus<T>> AttachmentMessageaudio(T $self, String audioUrl, List<QuickReply> quickReplies)Creates an audio file as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment). final <T extends Bus<T>> AttachmentMessagevideo(T $self, String videoUrl, QuickReply quickReplies)Creates a video as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment). final <T extends Bus<T>> AttachmentMessagevideo(T $self, String videoUrl, List<QuickReply> quickReplies)Creates a video as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment). final TextMessagetext(I18nTranslator $self, CharSequence text, QuickReply quickReplies)Creates a text with quick replies. final TextMessagetext(I18nTranslator $self, CharSequence text, List<QuickReply> quickReplies)Creates a text with quick replies. final ElementgenericElement(I18nTranslator $self, CharSequence title, CharSequence subtitle, String imageUrl, List<Button> buttons)Creates a generic element. final LoginButtonloginButton(String url)Provides a Log In Button. final LogoutButtonlogoutButton()Provides a Log Out Button. final QuickReplynlpQuickReply(I18nTranslator $self, CharSequence title, CharSequence textToSend, String imageUrl)This quick reply does not use any custom payload, but the textToSend will we parsed by the NLP engine. final QuickReplystandaloneQuickReply(I18nTranslator $self, CharSequence title, IntentAware targetIntent, Parameters parameters, StoryStep<out StoryHandlerDefinition> step, String imageUrl, StoryStep<out StoryHandlerDefinition> busStep, Intent currentIntent, String sourceAppId)Creates a quick reply from an I18nTranslator. final <T extends Bus<T>> QuickReplyquickReply(T $self, CharSequence title, IntentAware targetIntent, Parameters parameters)Creates a quick reply. final <T extends Bus<T>> QuickReplyquickReply(T $self, CharSequence title, IntentAware targetIntent, String imageUrl, StoryStep<out StoryHandlerDefinition> step, Parameters parameters)Creates a quick reply. final <T extends Bus<T>> QuickReplyquickReply(T $self, CharSequence title, IntentAware targetIntent, String imageUrl, StoryStep<out StoryHandlerDefinition> step, Pair<String, String> parameters)Create a quick reply. final <T extends Bus<T>> QuickReplyquickReply(T $self, CharSequence title, IntentAware targetIntent, String imageUrl, StoryStep<out StoryHandlerDefinition> step, Collection<Pair<String, String>> parameters)Creates a quick reply. final <T extends Bus<T>> QuickReplyquickReply(T $self, CharSequence title, IntentAware targetIntent, String imageUrl, StoryStep<out StoryHandlerDefinition> step, Map<String, String> parameters)Creates a quick reply. final QuickReplyemailQuickReply()Creates a quick reply email. final <T extends Bus<T>> PostbackButtonpostbackButton(T $self, CharSequence title, IntentAware targetIntent, Pair<String, String> parameters)Creates a postback button. final <T extends Bus<T>> PostbackButtonpostbackButton(T $self, CharSequence title, IntentAware targetIntent, Parameters parameters)Creates a postback button. final <T extends Bus<T>> PostbackButtonpostbackButton(T $self, CharSequence title, IntentAware targetIntent, StoryStep<out StoryHandlerDefinition> step, Parameters parameters)Creates a postback button. final <T extends Bus<T>> PostbackButtonpostbackButton(T $self, CharSequence title, IntentAware targetIntent, StoryStep<out StoryHandlerDefinition> step, Pair<String, String> parameters)Creates a postback button. final PostbackButtonnlpPostbackButton(I18nTranslator $self, CharSequence title, CharSequence textToSend)This button does not use any custom payload, but the textToSend will we parsed by the NLP engine. final CallButtoncallToButton(I18nTranslator $self, CharSequence title, String phoneNumber)final UrlButtonurlButton(I18nTranslator $self, CharSequence title, String url)Creates an url button. final SendSentencestandaloneMessengerAnswer(PlayerId playerId, String applicationId, PlayerId recipientId, Boolean lastAnswer, ActionPriority priority, ActionNotificationType notificationType, Function0<MessengerConnectorMessage> messageProvider)Used to generate a MessengerConnectorMessage event, usually sent later by MessengerConnector.send or MessengerConnector.sendOptInEvent. final List<SendSentence>standaloneMessengerAnswers(PlayerId playerId, String applicationId, PlayerId recipientId, ActionPriority priority, ActionNotificationType notificationType, Function0<List<MessengerConnectorMessage>> messagesProvider)Used to generate multiple MessengerConnectorMessage events, usually sent later by MessengerConnector.send or MessengerConnector.sendOptInEvent. -
-
Method Detail
-
getMessengerConnectorType
final ConnectorType getMessengerConnectorType()
The Messenger connector type.
-
sendToMessenger
final <T extends Bus<T>> T sendToMessenger(T $self, Long delay, Function1<T, MessengerConnectorMessage> messageProvider)
Sends a Messenger message only if the ConnectorType of the current Bus is messengerConnectorType.
-
endForMessenger
final <T extends Bus<T>> T endForMessenger(T $self, Long delay, Function1<T, MessengerConnectorMessage> messageProvider)
Sends a Messenger message as last bot answer, only if the ConnectorType of the current Bus is messengerConnectorType.
-
withMessenger
final <T extends Bus<T>> T withMessenger(T $self, Function0<MessengerConnectorMessage> messageProvider)
Adds a Messenger ConnectorMessage if the current connector is Messenger. You need to call <T : Bus<T>> T.send or <T : Bus<T>> T.end later to send this message.
-
withMessenger
final <T extends Bus<T>> T withMessenger(T $self, String connectorId, Function0<MessengerConnectorMessage> messageProvider)
Adds a Messenger ConnectorMessage if the current connector is Messenger and the current connector is connectorId. You need to call <T : Bus<T>> T.send or <T : Bus<T>> T.end later to send this message.
-
buttonsTemplate
final AttachmentMessage buttonsTemplate(I18nTranslator $self, CharSequence text, UserAction actions)
Creates a button template https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template
-
buttonsTemplate
final AttachmentMessage buttonsTemplate(I18nTranslator $self, CharSequence text, List<UserAction> actions)
Creates a button template https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template
-
mediaTemplate
final AttachmentMessage mediaTemplate(String mediaUrl, MediaType mediaType, Boolean sharable, UserAction actions)
Creates a media template https://developers.facebook.com/docs/messenger-platform/send-messages/template/media
-
mediaTemplate
final AttachmentMessage mediaTemplate(String mediaUrl, MediaType mediaType, Boolean sharable, List<UserAction> actions)
Creates a media template https://developers.facebook.com/docs/messenger-platform/send-messages/template/media
-
genericTemplate
final AttachmentMessage genericTemplate(Element elements)
Creates a generic template.
-
genericTemplate
final AttachmentMessage genericTemplate(List<Element> elements, List<QuickReply> quickReplies)
Creates a generic template.
-
genericTemplate
final AttachmentMessage genericTemplate(List<Element> elements, QuickReply quickReplies)
Creates a generic template.
-
attachment
final <T extends Bus<T>> AttachmentMessage attachment(T $self, String attachmentUrl, AttachmentType type, QuickReply quickReplies)
Creates an attachment.
-
attachment
final <T extends Bus<T>> AttachmentMessage attachment(T $self, String attachmentUrl, AttachmentType type, List<QuickReply> quickReplies)
Creates an attachment.
-
image
final <T extends Bus<T>> AttachmentMessage image(T $self, String imageUrl, QuickReply quickReplies)
Creates an image as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment).
-
image
final <T extends Bus<T>> AttachmentMessage image(T $self, String imageUrl, List<QuickReply> quickReplies)
Creates an image as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment).
-
audio
final <T extends Bus<T>> AttachmentMessage audio(T $self, String audioUrl, QuickReply quickReplies)
Creates an audio file as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment).
-
audio
final <T extends Bus<T>> AttachmentMessage audio(T $self, String audioUrl, List<QuickReply> quickReplies)
Creates an audio file as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment).
-
video
final <T extends Bus<T>> AttachmentMessage video(T $self, String videoUrl, QuickReply quickReplies)
Creates a video as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment).
-
video
final <T extends Bus<T>> AttachmentMessage video(T $self, String videoUrl, List<QuickReply> quickReplies)
Creates a video as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment).
-
text
final TextMessage text(I18nTranslator $self, CharSequence text, QuickReply quickReplies)
Creates a text with quick replies.
-
text
final TextMessage text(I18nTranslator $self, CharSequence text, List<QuickReply> quickReplies)
Creates a text with quick replies.
-
genericElement
final Element genericElement(I18nTranslator $self, CharSequence title, CharSequence subtitle, String imageUrl, List<Button> buttons)
Creates a generic element.
-
loginButton
final LoginButton loginButton(String url)
Provides a Log In Button.
-
logoutButton
final LogoutButton logoutButton()
Provides a Log Out Button.
-
nlpQuickReply
final QuickReply nlpQuickReply(I18nTranslator $self, CharSequence title, CharSequence textToSend, String imageUrl)
This quick reply does not use any custom payload, but the textToSend will we parsed by the NLP engine.
-
standaloneQuickReply
@Deprecated(message = "use notify method for standalone") final QuickReply standaloneQuickReply(I18nTranslator $self, CharSequence title, IntentAware targetIntent, Parameters parameters, StoryStep<out StoryHandlerDefinition> step, String imageUrl, StoryStep<out StoryHandlerDefinition> busStep, Intent currentIntent, String sourceAppId)
Creates a quick reply from an I18nTranslator.
-
quickReply
final <T extends Bus<T>> QuickReply quickReply(T $self, CharSequence title, IntentAware targetIntent, Parameters parameters)
Creates a quick reply.
-
quickReply
final <T extends Bus<T>> QuickReply quickReply(T $self, CharSequence title, IntentAware targetIntent, String imageUrl, StoryStep<out StoryHandlerDefinition> step, Parameters parameters)
Creates a quick reply.
-
quickReply
final <T extends Bus<T>> QuickReply quickReply(T $self, CharSequence title, IntentAware targetIntent, String imageUrl, StoryStep<out StoryHandlerDefinition> step, Pair<String, String> parameters)
Create a quick reply.
-
quickReply
final <T extends Bus<T>> QuickReply quickReply(T $self, CharSequence title, IntentAware targetIntent, String imageUrl, StoryStep<out StoryHandlerDefinition> step, Collection<Pair<String, String>> parameters)
Creates a quick reply.
-
quickReply
final <T extends Bus<T>> QuickReply quickReply(T $self, CharSequence title, IntentAware targetIntent, String imageUrl, StoryStep<out StoryHandlerDefinition> step, Map<String, String> parameters)
Creates a quick reply.
-
emailQuickReply
final QuickReply emailQuickReply()
Creates a quick reply email.
-
postbackButton
final <T extends Bus<T>> PostbackButton postbackButton(T $self, CharSequence title, IntentAware targetIntent, Pair<String, String> parameters)
Creates a postback button.
-
postbackButton
final <T extends Bus<T>> PostbackButton postbackButton(T $self, CharSequence title, IntentAware targetIntent, Parameters parameters)
Creates a postback button.
-
postbackButton
final <T extends Bus<T>> PostbackButton postbackButton(T $self, CharSequence title, IntentAware targetIntent, StoryStep<out StoryHandlerDefinition> step, Parameters parameters)
Creates a postback button.
-
postbackButton
final <T extends Bus<T>> PostbackButton postbackButton(T $self, CharSequence title, IntentAware targetIntent, StoryStep<out StoryHandlerDefinition> step, Pair<String, String> parameters)
Creates a postback button.
-
nlpPostbackButton
final PostbackButton nlpPostbackButton(I18nTranslator $self, CharSequence title, CharSequence textToSend)
This button does not use any custom payload, but the textToSend will we parsed by the NLP engine.
-
callToButton
final CallButton callToButton(I18nTranslator $self, CharSequence title, String phoneNumber)
-
urlButton
final UrlButton urlButton(I18nTranslator $self, CharSequence title, String url)
Creates an url button.
-
standaloneMessengerAnswer
@Deprecated(message = "use notify method for standalone") final SendSentence standaloneMessengerAnswer(PlayerId playerId, String applicationId, PlayerId recipientId, Boolean lastAnswer, ActionPriority priority, ActionNotificationType notificationType, Function0<MessengerConnectorMessage> messageProvider)
Used to generate a MessengerConnectorMessage event, usually sent later by MessengerConnector.send or MessengerConnector.sendOptInEvent.
-
standaloneMessengerAnswers
@Deprecated(message = "use notify method for standalone") final List<SendSentence> standaloneMessengerAnswers(PlayerId playerId, String applicationId, PlayerId recipientId, ActionPriority priority, ActionNotificationType notificationType, Function0<List<MessengerConnectorMessage>> messagesProvider)
Used to generate multiple MessengerConnectorMessage events, usually sent later by MessengerConnector.send or MessengerConnector.sendOptInEvent.
-
-
-
-