public ClientBus
A new bus instance is created for each user request.
The bus is used by bot implementations to reply to the user request.
@NotNull ClientBotDefinition getBotDefinition()
The bot definition.
@NotNull java.util.List<ai.tock.bot.api.model.context.Entity> getEntities()
The entity list.
@NotNull ai.tock.bot.api.model.message.user.UserMessage getMessage()
The user message.
@NotNull ClientStoryDefinition getStory()
The current story.
void setStory(@NotNull
ClientStoryDefinition p)
The current story.
@Nullable ClientStep getStep()
The current step.
void setStep(@Nullable
ClientStep p)
The current step.
void handle()
Handles the current request.
@NotNull ClientBus send(@NotNull ai.tock.bot.api.model.message.bot.Card card)
Sends a Card.
@NotNull ClientBus end(@NotNull ai.tock.bot.api.model.message.bot.Card card)
Sends a Card as last bot answer.
@NotNull ClientBus send(@NotNull ai.tock.bot.api.model.message.bot.Carousel carousel)
Sends a Carousel.
@NotNull ClientBus end(@NotNull ai.tock.bot.api.model.message.bot.Carousel carousel)
Sends a [Carousel as last bot answer.
@NotNull ClientBus send(@NotNull java.lang.CharSequence i18nText, @NotNull java.util.List<ai.tock.bot.api.model.message.bot.Suggestion> suggestions, long delay, @NotNull java.lang.Object... i18nArgs)
Sends a text with suggestions.
@NotNull ClientBus send(@NotNull java.lang.CharSequence i18nText, @NotNull java.util.List<? extends java.lang.CharSequence> suggestions)
Sends a text with suggestions.
@NotNull ClientBus end(@NotNull java.lang.CharSequence i18nText, @NotNull java.util.List<ai.tock.bot.api.model.message.bot.Suggestion> suggestions, long delay, @NotNull java.lang.Object... i18nArgs)
Sends a text with suggestions as last bot answer.
@NotNull ClientBus end(@NotNull java.lang.CharSequence i18nText, @NotNull java.util.List<? extends java.lang.CharSequence> suggestions)
Sends a text with suggestions as last bot answer.
@Nullable
ai.tock.bot.api.model.context.Entity entity(@NotNull
java.lang.String role)
Finds the Entity from the specified entity role.
@Nullable
java.lang.String entityText(@NotNull
java.lang.String role)
Returns the Entity text content from the specified entity role.
@Nullable <T extends Value> T entityValue(@NotNull java.lang.String role)
Returns the corresponding Entity from the specified entity role.
boolean removeEntity(@NotNull
java.lang.String role)
Removes the entity of the specified role.
boolean removeEntity(@NotNull
ai.tock.bot.api.model.context.Entity entity)
Remove the specified entity.
@NotNull
ai.tock.bot.api.model.message.bot.I18nText translate(@Nullable
java.lang.CharSequence text,
@NotNull
java.lang.Object... args)
@NotNull
ai.tock.bot.api.model.message.bot.Card newCard(@Nullable
java.lang.CharSequence title,
@Nullable
java.lang.CharSequence subTitle,
@Nullable
ai.tock.bot.api.model.message.bot.Attachment attachment,
@NotNull
java.util.List<ai.tock.bot.api.model.message.bot.Action> actions,
long delay)
Creates a new Card.
@NotNull
ai.tock.bot.api.model.message.bot.Carousel newCarousel(@NotNull
java.util.List<ai.tock.bot.api.model.message.bot.Card> cards,
long delay)
Creates a new Carousel.
@NotNull
ai.tock.bot.api.model.message.bot.Carousel newCarousel(@NotNull
ai.tock.bot.api.model.message.bot.Card[] cards,
long delay)
Creates a new Carousel.
@NotNull
ai.tock.bot.api.model.message.bot.Card newCard(@Nullable
java.lang.CharSequence title,
@Nullable
java.lang.CharSequence subTitle,
@Nullable
ai.tock.bot.api.model.message.bot.Attachment attachment,
@NotNull
ai.tock.bot.api.model.message.bot.Action[] actions,
long delay)
Creates a new Card.
@NotNull
ai.tock.bot.api.model.message.bot.Action newAction(@NotNull
java.lang.CharSequence title,
@Nullable
java.lang.String url)
Creates a new Action.
@NotNull
ai.tock.bot.api.model.message.bot.Attachment newAttachment(@NotNull
java.lang.String url,
@Nullable
ai.tock.bot.api.model.message.bot.AttachmentType type)
Creates a new Attachment.