-
- All Implemented Interfaces:
public final class MessengerBuildersKt
-
-
Field Summary
Fields Modifier and Type Field Description private final static ConnectorTypemessengerConnectorType
-
Method Summary
Modifier and Type Method Description final ConnectorTypegetMessengerConnectorType()The Messenger connector type. final static <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 static <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 static <T extends Bus<T>> TwithMessenger(T $self, Function0<MessengerConnectorMessage> messageProvider)Adds a Messenger ConnectorMessage if the current connector is Messenger. final static <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 static AttachmentMessagebuttonsTemplate(I18nTranslator $self, CharSequence text, UserAction actions)Creates a button template https://developers.facebook. final static AttachmentMessagebuttonsTemplate(I18nTranslator $self, CharSequence text, List<UserAction> actions)Creates a button template https://developers.facebook. final static AttachmentMessagemediaTemplate(String mediaUrl, MediaType mediaType, Boolean sharable, UserAction actions)Creates a media template https://developers.facebook. final static AttachmentMessagemediaTemplate(String mediaUrl, MediaType mediaType, Boolean sharable, List<UserAction> actions)Creates a media template https://developers.facebook. final static AttachmentMessagegenericTemplate(Element elements)Creates a generic template. final static AttachmentMessagegenericTemplate(List<Element> elements, List<QuickReply> quickReplies)Creates a generic template. final static AttachmentMessagegenericTemplate(List<Element> elements, QuickReply quickReplies)Creates a generic template. final static <T extends Bus<T>> AttachmentMessageattachment(T $self, String attachmentUrl, AttachmentType type, QuickReply quickReplies)Creates an attachment. final static <T extends Bus<T>> AttachmentMessageattachment(T $self, String attachmentUrl, AttachmentType type, List<QuickReply> quickReplies)Creates an attachment. final static <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 static <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 static <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 static <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 static <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 static <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 static TextMessagetext(I18nTranslator $self, CharSequence text, QuickReply quickReplies)Creates a text with quick replies. final static TextMessagetext(I18nTranslator $self, CharSequence text, List<QuickReply> quickReplies)Creates a text with quick replies. final static ElementgenericElement(I18nTranslator $self, CharSequence title, CharSequence subtitle, String imageUrl, List<Button> buttons)Creates a generic element. final static LoginButtonloginButton(String url)Provides a Log In Button. final static LogoutButtonlogoutButton()Provides a Log Out Button. final static 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 static 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 static <T extends Bus<T>> QuickReplyquickReply(T $self, CharSequence title, IntentAware targetIntent, Parameters parameters)Creates a quick reply. final static <T extends Bus<T>> QuickReplyquickReply(T $self, CharSequence title, IntentAware targetIntent, String imageUrl, StoryStep<out StoryHandlerDefinition> step, Parameters parameters)Creates a quick reply. final static <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 static <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 static <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 static QuickReplyemailQuickReply()Creates a quick reply email. final static <T extends Bus<T>> PostbackButtonpostbackButton(T $self, CharSequence title, IntentAware targetIntent, Pair<String, String> parameters)Creates a postback button. final static <T extends Bus<T>> PostbackButtonpostbackButton(T $self, CharSequence title, IntentAware targetIntent, Parameters parameters)Creates a postback button. final static <T extends Bus<T>> PostbackButtonpostbackButton(T $self, CharSequence title, IntentAware targetIntent, StoryStep<out StoryHandlerDefinition> step, Parameters parameters)Creates a postback button. final static <T extends Bus<T>> PostbackButtonpostbackButton(T $self, CharSequence title, IntentAware targetIntent, StoryStep<out StoryHandlerDefinition> step, Pair<String, String> parameters)Creates a postback button. final static 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 static CallButtoncallToButton(I18nTranslator $self, CharSequence title, String phoneNumber)final static UrlButtonurlButton(I18nTranslator $self, CharSequence title, String url)Creates an url button. final static 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 static 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 static <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 static <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 static <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.send or > T.end later to send this message.
-
withMessenger
final static <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.send or > T.end later to send this message.
-
buttonsTemplate
final static 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 static 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 static 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 static 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 static AttachmentMessage genericTemplate(Element elements)
Creates a generic template.
-
genericTemplate
final static AttachmentMessage genericTemplate(List<Element> elements, List<QuickReply> quickReplies)
Creates a generic template.
-
genericTemplate
final static AttachmentMessage genericTemplate(List<Element> elements, QuickReply quickReplies)
Creates a generic template.
-
attachment
final static <T extends Bus<T>> AttachmentMessage attachment(T $self, String attachmentUrl, AttachmentType type, QuickReply quickReplies)
Creates an attachment.
-
attachment
final static <T extends Bus<T>> AttachmentMessage attachment(T $self, String attachmentUrl, AttachmentType type, List<QuickReply> quickReplies)
Creates an attachment.
-
image
final static <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 static <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 static <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 static <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 static <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 static <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 static TextMessage text(I18nTranslator $self, CharSequence text, QuickReply quickReplies)
Creates a text with quick replies.
-
text
final static TextMessage text(I18nTranslator $self, CharSequence text, List<QuickReply> quickReplies)
Creates a text with quick replies.
-
genericElement
final static Element genericElement(I18nTranslator $self, CharSequence title, CharSequence subtitle, String imageUrl, List<Button> buttons)
Creates a generic element.
-
loginButton
final static LoginButton loginButton(String url)
Provides a Log In Button.
-
logoutButton
final static LogoutButton logoutButton()
Provides a Log Out Button.
-
nlpQuickReply
final static 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 static 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 static <T extends Bus<T>> QuickReply quickReply(T $self, CharSequence title, IntentAware targetIntent, Parameters parameters)
Creates a quick reply.
-
quickReply
final static <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 static <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 static <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 static <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 static QuickReply emailQuickReply()
Creates a quick reply email.
-
postbackButton
final static <T extends Bus<T>> PostbackButton postbackButton(T $self, CharSequence title, IntentAware targetIntent, Pair<String, String> parameters)
Creates a postback button.
-
postbackButton
final static <T extends Bus<T>> PostbackButton postbackButton(T $self, CharSequence title, IntentAware targetIntent, Parameters parameters)
Creates a postback button.
-
postbackButton
final static <T extends Bus<T>> PostbackButton postbackButton(T $self, CharSequence title, IntentAware targetIntent, StoryStep<out StoryHandlerDefinition> step, Parameters parameters)
Creates a postback button.
-
postbackButton
final static <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 static 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 static CallButton callToButton(I18nTranslator $self, CharSequence title, String phoneNumber)
-
urlButton
final static UrlButton urlButton(I18nTranslator $self, CharSequence title, String url)
Creates an url button.
-
standaloneMessengerAnswer
@Deprecated(message = "use notify method for standalone") final static 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 static 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.
-
-
-
-