public static class BotDefinition.DefaultImpls
The main interface used to define the behaviour of the bot.
New bots should usually not directly extend this class, but instead extend class BotDefinitionBase.
class BotDefinitionBase@NotNull public static Intent findIntent(BotDefinition $this, @NotNull java.lang.String intent)
Finds an class Intent from an intent name.
class Intent@NotNull public static StoryDefinition findStoryDefinition(BotDefinition $this, @Nullable IntentAware intent)
Finds a interface StoryDefinition from an class Intent.
interface StoryDefinition,
class Intent@NotNull public static StoryDefinition findStoryDefinition(BotDefinition $this, @Nullable java.lang.String intent, @Nullable java.lang.String applicationId)
Finds a interface StoryDefinition from an intent name.
$this - the intent nameintent - the optional applicationIdapplicationId - the optional applicationIdinterface StoryDefinition@NotNull public static Action errorAction(BotDefinition $this, @NotNull PlayerId playerId, @NotNull java.lang.String applicationId, @NotNull PlayerId recipientId)
Called when error occurs. By default send "technical error".
public static boolean disableBot(BotDefinition $this, @NotNull UserTimeline timeline, @NotNull Dialog dialog, @NotNull Action action)
Does this action trigger bot deactivation ?
public static boolean enableBot(BotDefinition $this, @NotNull UserTimeline timeline, @NotNull Dialog dialog, @NotNull Action action)
Does this action trigger bot activation ?
@NotNull public static kotlin.jvm.functions.Function1<ai.tock.bot.engine.action.Action,kotlin.Unit> getBotEnabledListener(BotDefinition $this)
Listener invoked when bot is enabled.
public static boolean hasToPersistAction(BotDefinition $this, @NotNull UserTimeline timeline, @NotNull Action action)
If this method returns true, the action will be added in the stored history.
By default, actions where the bot is not only ai.tock.bot.engine.dialog.EventState.notification are added in the bot history.
@NotNull public static TestBehaviour getTestBehaviour(BotDefinition $this)
Returns a interface TestBehaviour. Used in Integration Tests.
interface TestBehaviour@NotNull public static ai.tock.translator.I18nLabelValue i18n(BotDefinition $this, @NotNull java.lang.CharSequence defaultLabel, @NotNull java.util.List<? extends java.lang.Object> args)
@NotNull public static ai.tock.nlp.api.client.model.Entity entity(BotDefinition $this, @NotNull java.lang.String name, @Nullable java.lang.String role)
Returns the entity with the specified name and optional role.
@NotNull public static I18nTranslator i18nTranslator(BotDefinition $this, @NotNull java.util.Locale userLocale, @NotNull ConnectorType connectorType, @NotNull ai.tock.translator.UserInterfaceType userInterfaceType, @Nullable java.lang.String contextId)
Returns an interface I18nTranslator for the specified userLocale and connectorType.
interface I18nTranslator,
userLocale,
connectorTypepublic static long defaultDelay(BotDefinition $this, int answerIndex)
Get the default delay between two answers.
@Nullable public static DialogFlowDefinition getFlowDefinition(BotDefinition $this)
@NotNull public static ai.tock.translator.I18nLabelValue i18n(BotDefinition $this, @NotNull java.lang.CharSequence defaultLabel, @NotNull java.lang.Object... args)