public class MessengerBuildersKt
@NotNull public static ai.tock.bot.connector.ConnectorType getMessengerConnectorType()
The Messenger connector type.
@NotNull public static <T extends Bus<T>> T sendToMessenger(@NotNull T $this$sendToMessenger, long delay, @NotNull kotlin.jvm.functions.Function1<? super T,? extends ai.tock.bot.connector.messenger.model.MessengerConnectorMessage> messageProvider)
Sends a Messenger message only if the ConnectorType of the current Bus is messengerConnectorType.
messengerConnectorType@NotNull public static <T extends Bus<T>> T endForMessenger(@NotNull T $this$endForMessenger, long delay, @NotNull kotlin.jvm.functions.Function1<? super T,? extends ai.tock.bot.connector.messenger.model.MessengerConnectorMessage> messageProvider)
Sends a Messenger message as last bot answer, only if the ConnectorType of the current Bus is messengerConnectorType.
messengerConnectorType@NotNull public static <T extends Bus<T>> T withMessenger(@NotNull T $this$withMessenger, @NotNull kotlin.jvm.functions.Function0<? extends ai.tock.bot.connector.messenger.model.MessengerConnectorMessage> messageProvider)
Adds a Messenger ConnectorMessage if the current connector is Messenger. You need to call T:BusT.send or T:BusT.end later to send this message.
@NotNull public static <T extends Bus<T>> T withMessenger(@NotNull T $this$withMessenger, @NotNull java.lang.String connectorId, @NotNull kotlin.jvm.functions.Function0<? extends ai.tock.bot.connector.messenger.model.MessengerConnectorMessage> messageProvider)
Adds a Messenger ConnectorMessage if the current connector is Messenger and the current connector is connectorId.
You need to call T:BusT.send or T:BusT.end later to send this message.
connectorId,
T:BusT.send,
T:BusT.end@NotNull public static AttachmentMessage buttonsTemplate(@NotNull ai.tock.bot.engine.I18nTranslator $this$buttonsTemplate, @NotNull java.lang.CharSequence text, @NotNull ai.tock.bot.connector.messenger.model.send.UserAction... actions)
Creates a button template https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template
@NotNull public static AttachmentMessage buttonsTemplate(@NotNull ai.tock.bot.engine.I18nTranslator $this$buttonsTemplate, @NotNull java.lang.CharSequence text, @NotNull java.util.List<? extends ai.tock.bot.connector.messenger.model.send.UserAction> actions)
Creates a button template https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template
@NotNull public static AttachmentMessage mediaTemplate(@NotNull java.lang.String mediaUrl, @NotNull MediaType mediaType, boolean sharable, @NotNull ai.tock.bot.connector.messenger.model.send.UserAction... actions)
Creates a media template https://developers.facebook.com/docs/messenger-platform/send-messages/template/media
@NotNull public static AttachmentMessage mediaTemplate(@NotNull java.lang.String mediaUrl, @NotNull MediaType mediaType, boolean sharable, @NotNull java.util.List<? extends ai.tock.bot.connector.messenger.model.send.UserAction> actions)
Creates a media template https://developers.facebook.com/docs/messenger-platform/send-messages/template/media
@NotNull public static AttachmentMessage genericTemplate(@NotNull ai.tock.bot.connector.messenger.model.send.Element... elements)
Creates a generic template.
@NotNull public static AttachmentMessage genericTemplate(@NotNull java.util.List<ai.tock.bot.connector.messenger.model.send.Element> elements, @NotNull java.util.List<? extends ai.tock.bot.connector.messenger.model.send.QuickReply> quickReplies)
Creates a generic template.
@NotNull public static AttachmentMessage genericTemplate(@NotNull java.util.List<ai.tock.bot.connector.messenger.model.send.Element> elements, @NotNull ai.tock.bot.connector.messenger.model.send.QuickReply... quickReplies)
Creates a generic template.
@NotNull public static <T extends Bus<T>> AttachmentMessage attachment(@NotNull T $this$attachment, @NotNull java.lang.String attachmentUrl, @NotNull AttachmentType type, @NotNull ai.tock.bot.connector.messenger.model.send.QuickReply... quickReplies)
Creates an attachment.
@NotNull public static <T extends Bus<T>> AttachmentMessage attachment(@NotNull T $this$attachment, @NotNull java.lang.String attachmentUrl, @NotNull AttachmentType type, @NotNull java.util.List<? extends ai.tock.bot.connector.messenger.model.send.QuickReply> quickReplies)
Creates an attachment.
@NotNull public static <T extends Bus<T>> AttachmentMessage image(@NotNull T $this$image, @NotNull java.lang.String imageUrl, @NotNull ai.tock.bot.connector.messenger.model.send.QuickReply... quickReplies)
Creates an image as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment).
image@NotNull public static <T extends Bus<T>> AttachmentMessage image(@NotNull T $this$image, @NotNull java.lang.String imageUrl, @NotNull java.util.List<? extends ai.tock.bot.connector.messenger.model.send.QuickReply> quickReplies)
Creates an image as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment).
image@NotNull public static <T extends Bus<T>> AttachmentMessage audio(@NotNull T $this$audio, @NotNull java.lang.String audioUrl, @NotNull ai.tock.bot.connector.messenger.model.send.QuickReply... quickReplies)
Creates an audio file as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment).
@NotNull public static <T extends Bus<T>> AttachmentMessage audio(@NotNull T $this$audio, @NotNull java.lang.String audioUrl, @NotNull java.util.List<? extends ai.tock.bot.connector.messenger.model.send.QuickReply> quickReplies)
Creates an audio file as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment).
@NotNull public static <T extends Bus<T>> AttachmentMessage video(@NotNull T $this$video, @NotNull java.lang.String videoUrl, @NotNull ai.tock.bot.connector.messenger.model.send.QuickReply... quickReplies)
Creates a video as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment).
video@NotNull public static <T extends Bus<T>> AttachmentMessage video(@NotNull T $this$video, @NotNull java.lang.String videoUrl, @NotNull java.util.List<? extends ai.tock.bot.connector.messenger.model.send.QuickReply> quickReplies)
Creates a video as attachment (https://developers.facebook.com/docs/messenger-platform/reference/send-api/#attachment).
video@NotNull public static TextMessage text(@NotNull ai.tock.bot.engine.I18nTranslator $this$text, @NotNull java.lang.CharSequence text, @NotNull ai.tock.bot.connector.messenger.model.send.QuickReply... quickReplies)
Creates a text with quick replies.
@NotNull public static TextMessage text(@NotNull ai.tock.bot.engine.I18nTranslator $this$text, @NotNull java.lang.CharSequence text, @NotNull java.util.List<? extends ai.tock.bot.connector.messenger.model.send.QuickReply> quickReplies)
Creates a text with quick replies.
@NotNull public static Element genericElement(@NotNull ai.tock.bot.engine.I18nTranslator $this$genericElement, @NotNull java.lang.CharSequence title, @Nullable java.lang.CharSequence subtitle, @Nullable java.lang.String imageUrl, @Nullable java.util.List<? extends ai.tock.bot.connector.messenger.model.send.Button> buttons)
Creates a generic element.
@NotNull public static LoginButton loginButton(@NotNull java.lang.String url)
Provides a Log In Button.
@NotNull public static LogoutButton logoutButton()
Provides a Log Out Button.
@NotNull public static QuickReply nlpQuickReply(@NotNull ai.tock.bot.engine.I18nTranslator $this$nlpQuickReply, @NotNull java.lang.CharSequence title, @NotNull java.lang.CharSequence textToSend, @Nullable java.lang.String imageUrl)
This quick reply does not use any custom payload, but the textToSend will we parsed by the NLP engine.
textToSend@Deprecated @NotNull public static QuickReply standaloneQuickReply(@NotNull ai.tock.bot.engine.I18nTranslator $this$standaloneQuickReply, @NotNull java.lang.CharSequence title, @NotNull ai.tock.bot.definition.IntentAware targetIntent, @NotNull ai.tock.bot.definition.Parameters parameters, @Nullable ai.tock.bot.definition.StoryStep<? extends ai.tock.bot.definition.StoryHandlerDefinition> step, @Nullable java.lang.String imageUrl, @Nullable ai.tock.bot.definition.StoryStep<? extends ai.tock.bot.definition.StoryHandlerDefinition> busStep, @Nullable ai.tock.bot.definition.Intent currentIntent, @Nullable java.lang.String sourceAppId)
Creates a quick reply from an I18nTranslator.
title - The title of the quick reply.targetIntent - The target intent.parameters - The custom parameters.step - The target step.imageUrl - The image url of the quick reply.busStep - The current step of the Bus.currentIntent - The current intent of the Bus.sourceAppId - The app id emitter.@NotNull public static <T extends Bus<T>> QuickReply quickReply(@NotNull T $this$quickReply, @NotNull java.lang.CharSequence title, @NotNull ai.tock.bot.definition.IntentAware targetIntent, @NotNull ai.tock.bot.definition.Parameters parameters)
Creates a quick reply.
@NotNull public static <T extends Bus<T>> QuickReply quickReply(@NotNull T $this$quickReply, @NotNull java.lang.CharSequence title, @NotNull ai.tock.bot.definition.IntentAware targetIntent, @Nullable java.lang.String imageUrl, @Nullable ai.tock.bot.definition.StoryStep<? extends ai.tock.bot.definition.StoryHandlerDefinition> step, @NotNull ai.tock.bot.definition.Parameters parameters)
Creates a quick reply.
@NotNull public static <T extends Bus<T>> QuickReply quickReply(@NotNull T $this$quickReply, @NotNull java.lang.CharSequence title, @NotNull ai.tock.bot.definition.IntentAware targetIntent, @Nullable java.lang.String imageUrl, @Nullable ai.tock.bot.definition.StoryStep<? extends ai.tock.bot.definition.StoryHandlerDefinition> step, @NotNull kotlin.Pair... parameters)
Create a quick reply.
@NotNull public static <T extends Bus<T>> QuickReply quickReply(@NotNull T $this$quickReply, @NotNull java.lang.CharSequence title, @NotNull ai.tock.bot.definition.IntentAware targetIntent, @Nullable java.lang.String imageUrl, @Nullable ai.tock.bot.definition.StoryStep<? extends ai.tock.bot.definition.StoryHandlerDefinition> step, @NotNull java.util.Collection<kotlin.Pair> parameters)
Creates a quick reply.
@NotNull public static <T extends Bus<T>> QuickReply quickReply(@NotNull T $this$quickReply, @NotNull java.lang.CharSequence title, @NotNull ai.tock.bot.definition.IntentAware targetIntent, @Nullable java.lang.String imageUrl, @Nullable ai.tock.bot.definition.StoryStep<? extends ai.tock.bot.definition.StoryHandlerDefinition> step, @NotNull java.util.Map<java.lang.String,java.lang.String> parameters)
Creates a quick reply.
@NotNull public static QuickReply emailQuickReply()
Creates a quick reply email.
@NotNull public static <T extends Bus<T>> PostbackButton postbackButton(@NotNull T $this$postbackButton, @NotNull java.lang.CharSequence title, @NotNull ai.tock.bot.definition.IntentAware targetIntent, @NotNull kotlin.Pair... parameters)
Creates a postback button.
@NotNull public static <T extends Bus<T>> PostbackButton postbackButton(@NotNull T $this$postbackButton, @NotNull java.lang.CharSequence title, @NotNull ai.tock.bot.definition.IntentAware targetIntent, @NotNull ai.tock.bot.definition.Parameters parameters)
Creates a postback button.
@NotNull public static <T extends Bus<T>> PostbackButton postbackButton(@NotNull T $this$postbackButton, @NotNull java.lang.CharSequence title, @NotNull ai.tock.bot.definition.IntentAware targetIntent, @Nullable ai.tock.bot.definition.StoryStep<? extends ai.tock.bot.definition.StoryHandlerDefinition> step, @NotNull ai.tock.bot.definition.Parameters parameters)
Creates a postback button.
@NotNull public static <T extends Bus<T>> PostbackButton postbackButton(@NotNull T $this$postbackButton, @NotNull java.lang.CharSequence title, @NotNull ai.tock.bot.definition.IntentAware targetIntent, @Nullable ai.tock.bot.definition.StoryStep<? extends ai.tock.bot.definition.StoryHandlerDefinition> step, @NotNull kotlin.Pair... parameters)
Creates a postback button.
@NotNull public static PostbackButton nlpPostbackButton(@NotNull ai.tock.bot.engine.I18nTranslator $this$nlpPostbackButton, @NotNull java.lang.CharSequence title, @NotNull java.lang.CharSequence textToSend)
This button does not use any custom payload, but the textToSend will we parsed by the NLP engine.
textToSend@NotNull public static CallButton callToButton(@NotNull ai.tock.bot.engine.I18nTranslator $this$callToButton, @NotNull java.lang.CharSequence title, @NotNull java.lang.String phoneNumber)
@NotNull public static UrlButton urlButton(@NotNull ai.tock.bot.engine.I18nTranslator $this$urlButton, @NotNull java.lang.CharSequence title, @NotNull java.lang.String url)
Creates an url button.
@Deprecated
@NotNull
public static ai.tock.bot.engine.action.SendSentence standaloneMessengerAnswer(@NotNull
ai.tock.bot.engine.user.PlayerId playerId,
@NotNull
java.lang.String applicationId,
@NotNull
ai.tock.bot.engine.user.PlayerId recipientId,
boolean lastAnswer,
@NotNull
ai.tock.bot.engine.action.ActionPriority priority,
@Nullable
ai.tock.bot.engine.action.ActionNotificationType notificationType,
@NotNull
kotlin.jvm.functions.Function0<? extends ai.tock.bot.connector.messenger.model.MessengerConnectorMessage> messageProvider)
Used to generate a class MessengerConnectorMessage event,
usually sent later by MessengerConnector.send or MessengerConnector.sendOptInEvent.
priority - Significance deals with the notification level.notificationType - tag deals with type of message notification.class MessengerConnectorMessage,
MessengerConnector.send,
MessengerConnector.sendOptInEvent@Deprecated
@NotNull
public static java.util.List<ai.tock.bot.engine.action.SendSentence> standaloneMessengerAnswers(@NotNull
ai.tock.bot.engine.user.PlayerId playerId,
@NotNull
java.lang.String applicationId,
@NotNull
ai.tock.bot.engine.user.PlayerId recipientId,
@NotNull
ai.tock.bot.engine.action.ActionPriority priority,
@Nullable
ai.tock.bot.engine.action.ActionNotificationType notificationType,
@NotNull
kotlin.jvm.functions.Function0<? extends java.util.List<? extends ai.tock.bot.connector.messenger.model.MessengerConnectorMessage>> messagesProvider)
Used to generate multiple class MessengerConnectorMessage events,
usually sent later by MessengerConnector.send or MessengerConnector.sendOptInEvent.
priority - Significance deals with the notification level.notificationType - tag deals with type of message notification.class MessengerConnectorMessage,
MessengerConnector.send,
MessengerConnector.sendOptInEvent