Package ai.tock.bot.connector.whatsapp
Class WhatsAppBuilderKt
-
- All Implemented Interfaces:
public final class WhatsAppBuilderKt
-
-
Field Summary
Fields Modifier and Type Field Description private final static ConnectorTypewhatsAppConnectorType
-
Method Summary
Modifier and Type Method Description final ConnectorTypegetWhatsAppConnectorType()The WhatsApp connector type. final static <T extends Bus<T>> TsendToWhatsApp(T $self, Function1<T, WhatsAppBotMessage> messageProvider, Long delay)Sends an WhatsApp message only if the ConnectorType of the current BotBus is whatsAppConnectorType. final static <T extends Bus<T>> TendForWhatsApp(T $self, Function1<T, WhatsAppBotMessage> messageProvider, Long delay)Sends an WhatsApp message as last bot answer, only if the ConnectorType of the current BotBus is whatsAppConnectorType. final static <T extends Bus<T>> TwithWhatsApp(T $self, Function0<WhatsAppBotMessage> messageProvider)Adds a WhatsApp ConnectorMessage if the current connector is WhatsApp. final static WhatsAppBotTextMessagewhatsAppText(BotBus $self, CharSequence text, Boolean previewUrl)Creates a WhatsAppBotTextMessage. final static WhatsAppBotImageMessagewhatsAppImage(BotBus $self, ByteArray byteImages, String contentType, CharSequence caption)Creates a WhatsAppBotImageMessage. final static WhatsAppBotInteractiveMessagewhatsAppInteractiveMessage(BotBus $self, String nameSpace, String templateName, List<WhatsAppComponent> components)Creates a WhatsAppBotInteractiveMessage final static WhatsAppBotMessageInteractiveMessagereplyButtonMessage(I18nTranslator $self, CharSequence text, QuickReply replies)final static WhatsAppBotMessageInteractiveMessagereplyButtonMessage(I18nTranslator $self, CharSequence text, List<QuickReply> replies)final static WhatsAppBotMessageInteractiveMessagecompleteListMessage(I18nTranslator $self, CharSequence text, CharSequence button, WhatsAppBotActionSection sections)final static WhatsAppBotMessageInteractiveMessagecompleteListMessage(I18nTranslator $self, CharSequence text, CharSequence button, List<WhatsAppBotActionSection> sections)final static WhatsAppBotMessageInteractiveMessagelistMessage(I18nTranslator $self, CharSequence text, CharSequence button, QuickReply replies)final static WhatsAppBotMessageInteractiveMessagelistMessage(I18nTranslator $self, CharSequence text, CharSequence button, List<QuickReply> replies)final static QuickReplynlpQuickReply(I18nTranslator $self, CharSequence title, CharSequence subTitle, CharSequence textToSend)final static <T extends Bus<T>> QuickReplyquickReply(T $self, CharSequence title, CharSequence subTitle, IntentAware targetIntent, Parameters parameters)final static <T extends Bus<T>> QuickReplyquickReply(T $self, CharSequence title, CharSequence subTitle, IntentAware targetIntent, StoryStep<out StoryHandlerDefinition> step, Pair<String, String> parameters)final static <T extends Bus<T>> QuickReplyquickReply(T $self, CharSequence title, CharSequence subTitle, IntentAware targetIntent, String step, Map<String, String> parameters)-
-
Method Detail
-
getWhatsAppConnectorType
final ConnectorType getWhatsAppConnectorType()
The WhatsApp connector type.
-
sendToWhatsApp
final static <T extends Bus<T>> T sendToWhatsApp(T $self, Function1<T, WhatsAppBotMessage> messageProvider, Long delay)
Sends an WhatsApp message only if the ConnectorType of the current BotBus is whatsAppConnectorType.
-
endForWhatsApp
final static <T extends Bus<T>> T endForWhatsApp(T $self, Function1<T, WhatsAppBotMessage> messageProvider, Long delay)
Sends an WhatsApp message as last bot answer, only if the ConnectorType of the current BotBus is whatsAppConnectorType.
-
withWhatsApp
final static <T extends Bus<T>> T withWhatsApp(T $self, Function0<WhatsAppBotMessage> messageProvider)
Adds a WhatsApp ConnectorMessage if the current connector is WhatsApp. You need to call BotBus.send or BotBus.end later to send this message.
-
whatsAppText
final static WhatsAppBotTextMessage whatsAppText(BotBus $self, CharSequence text, Boolean previewUrl)
Creates a WhatsAppBotTextMessage.
- Parameters:
text- the text sentpreviewUrl- is preview mode is used?
-
whatsAppImage
final static WhatsAppBotImageMessage whatsAppImage(BotBus $self, ByteArray byteImages, String contentType, CharSequence caption)
Creates a WhatsAppBotImageMessage.
-
whatsAppInteractiveMessage
final static WhatsAppBotInteractiveMessage whatsAppInteractiveMessage(BotBus $self, String nameSpace, String templateName, List<WhatsAppComponent> components)
Creates a WhatsAppBotInteractiveMessage
-
replyButtonMessage
final static WhatsAppBotMessageInteractiveMessage replyButtonMessage(I18nTranslator $self, CharSequence text, QuickReply replies)
-
replyButtonMessage
final static WhatsAppBotMessageInteractiveMessage replyButtonMessage(I18nTranslator $self, CharSequence text, List<QuickReply> replies)
-
completeListMessage
final static WhatsAppBotMessageInteractiveMessage completeListMessage(I18nTranslator $self, CharSequence text, CharSequence button, WhatsAppBotActionSection sections)
-
completeListMessage
final static WhatsAppBotMessageInteractiveMessage completeListMessage(I18nTranslator $self, CharSequence text, CharSequence button, List<WhatsAppBotActionSection> sections)
-
listMessage
final static WhatsAppBotMessageInteractiveMessage listMessage(I18nTranslator $self, CharSequence text, CharSequence button, QuickReply replies)
-
listMessage
final static WhatsAppBotMessageInteractiveMessage listMessage(I18nTranslator $self, CharSequence text, CharSequence button, List<QuickReply> replies)
-
nlpQuickReply
final static QuickReply nlpQuickReply(I18nTranslator $self, CharSequence title, CharSequence subTitle, CharSequence textToSend)
-
quickReply
final static <T extends Bus<T>> QuickReply quickReply(T $self, CharSequence title, CharSequence subTitle, IntentAware targetIntent, Parameters parameters)
-
quickReply
final static <T extends Bus<T>> QuickReply quickReply(T $self, CharSequence title, CharSequence subTitle, IntentAware targetIntent, StoryStep<out StoryHandlerDefinition> step, Pair<String, String> parameters)
-
quickReply
final static <T extends Bus<T>> QuickReply quickReply(T $self, CharSequence title, CharSequence subTitle, IntentAware targetIntent, String step, Map<String, String> parameters)
-
-
-
-