-
- All Implemented Interfaces:
-
ai.tock.bot.api.client.ClientBus,ai.tock.bot.engine.Bus,ai.tock.bot.engine.I18nTranslator,ai.tock.translator.I18nKeyProvider
public final class TockClientBus implements ClientBus
-
-
Field Summary
Fields Modifier and Type Field Description private final StringapplicationIdprivate final PlayerIduserIdprivate final PlayerIdbotIdprivate final IntentAwareintentprivate final Booleantestprivate final LocaleuserLocaleprivate final UserInterfaceTypeuserInterfaceTypeprivate final ConnectorTypetargetConnectorTypeprivate final StringcontextIdprivate final IntegercurrentAnswerIndexprivate final List<Entity>entitiesprivate final UserMessagemessageprivate ClientStoryDefinitionstoryprivate ClientStepstepprivate final StringstepNameprivate final ClientBotDefinitionbotDefinitionprivate final StringrequestIdprivate final UserRequestrequestprivate final Function1<BotResponse, Unit>sendAnswer
-
Constructor Summary
Constructors Constructor Description TockClientBus(ClientBotDefinition botDefinition, RequestData data, Function1<BotResponse, Unit> sendAnswer)TockClientBus(ClientBotDefinition botDefinition, String requestId, UserRequest request, Function1<BotResponse, Unit> sendAnswer)
-
Method Summary
Modifier and Type Method Description Unithandle()Handles the current request. LongdefaultDelay(Integer answerIndex)ClientBusendRawText(CharSequence plainText, Long delay)ClientBussendRawText(CharSequence plainText, Long delay)ClientBussend(CharSequence i18nText, List<Suggestion> suggestions, Long delay, Object i18nArgs)Sends a text with suggestions. ClientBussend(Carousel carousel)Sends a Carousel. ClientBussend(Card card)Sends a Card. ClientBusend(CharSequence i18nText, List<Suggestion> suggestions, Long delay, Object i18nArgs)Sends a text with suggestions as last bot answer. ClientBusend(Card card)Sends a Card as last bot answer. ClientBusend(Carousel carousel)Sends a [Carousel as last bot answer. ClientBuswithMessage(ConnectorType connectorType, Function0<ConnectorMessage> messageProvider)ClientBuswithMessage(ConnectorType connectorType, String connectorId, Function0<ConnectorMessage> messageProvider)I18nLabelValuei18n(CharSequence defaultLabel, List<Object> args)StringgetApplicationId()PlayerIdgetUserId()PlayerIdgetBotId()IntentAwaregetIntent()BooleangetTest()LocalegetUserLocale()UserInterfaceTypegetUserInterfaceType()ConnectorTypegetTargetConnectorType()StringgetContextId()IntegergetCurrentAnswerIndex()List<Entity>getEntities()The entity list. UserMessagegetMessage()The user message. ClientStoryDefinitiongetStory()The current story. ClientStepgetStep()The current step. StringgetStepName()ClientBotDefinitiongetBotDefinition()The bot definition. final StringgetRequestId()final UserRequestgetRequest()final Function1<BotResponse, Unit>getSendAnswer()UnitsetStory(ClientStoryDefinition story)The current story. UnitsetStep(ClientStep step)The current step. -
Methods inherited from class ai.tock.bot.api.client.TockClientBus
end, entity, entityText, entityValue, newAction, newAttachment, newCard, newCard, newCarousel, newCarousel, removeEntity, removeEntity, send, translate -
Methods inherited from class ai.tock.bot.api.client.ClientBus
end, end, end, end, send, send, send, send, withMessage -
Methods inherited from class ai.tock.bot.engine.I18nTranslator
i18n -
Methods inherited from class ai.tock.bot.engine.Bus
translate, translate, translateAndReturnBlankAsNull -
Methods inherited from class ai.tock.translator.I18nKeyProvider
equals, hashCode, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
TockClientBus
TockClientBus(ClientBotDefinition botDefinition, RequestData data, Function1<BotResponse, Unit> sendAnswer)
-
TockClientBus
TockClientBus(ClientBotDefinition botDefinition, String requestId, UserRequest request, Function1<BotResponse, Unit> sendAnswer)
-
-
Method Detail
-
defaultDelay
Long defaultDelay(Integer answerIndex)
-
endRawText
ClientBus endRawText(CharSequence plainText, Long delay)
-
sendRawText
ClientBus sendRawText(CharSequence plainText, Long delay)
-
send
ClientBus send(CharSequence i18nText, List<Suggestion> suggestions, Long delay, Object i18nArgs)
Sends a text with suggestions.
-
end
ClientBus end(CharSequence i18nText, List<Suggestion> suggestions, Long delay, Object i18nArgs)
Sends a text with suggestions as last bot answer.
-
withMessage
ClientBus withMessage(ConnectorType connectorType, Function0<ConnectorMessage> messageProvider)
-
withMessage
ClientBus withMessage(ConnectorType connectorType, String connectorId, Function0<ConnectorMessage> messageProvider)
-
i18n
I18nLabelValue i18n(CharSequence defaultLabel, List<Object> args)
-
getApplicationId
String getApplicationId()
-
getUserId
PlayerId getUserId()
-
getBotId
PlayerId getBotId()
-
getIntent
IntentAware getIntent()
-
getUserLocale
Locale getUserLocale()
-
getUserInterfaceType
UserInterfaceType getUserInterfaceType()
-
getTargetConnectorType
ConnectorType getTargetConnectorType()
-
getContextId
String getContextId()
-
getCurrentAnswerIndex
Integer getCurrentAnswerIndex()
-
getEntities
List<Entity> getEntities()
The entity list.
-
getMessage
UserMessage getMessage()
The user message.
-
getStory
ClientStoryDefinition getStory()
The current story.
-
getStep
ClientStep getStep()
The current step.
-
getStepName
String getStepName()
-
getBotDefinition
ClientBotDefinition getBotDefinition()
The bot definition.
-
getRequestId
final String getRequestId()
-
getRequest
final UserRequest getRequest()
-
getSendAnswer
final Function1<BotResponse, Unit> getSendAnswer()
-
setStory
Unit setStory(ClientStoryDefinition story)
The current story.
-
setStep
Unit setStep(ClientStep step)
The current step.
-
-
-
-