tock / ai.tock.bot.engine / BotRepository

BotRepository

object BotRepository (source)

Advanced bot configuration.

ai.tock.bot.registerAndInstallBot method is the preferred way to start a bot in most use cases.

Properties

healthcheckHandler

healthcheck handler to answer to GET /healthcheck.

var healthcheckHandler: (RoutingContext) -> Unit

requestTimer

Request timer for connectors.

var requestTimer: RequestTimer

Functions

checkBotConfigurations

Checks that configurations are synchronized with the database.

fun checkBotConfigurations(startup: Boolean = false, botConfigurationChanged: Boolean = false): Unit

findConnectorProvider

Returns the ConnectorProvider for the specified ConnectorType.

fun findConnectorProvider(connectorType: ConnectorType): ConnectorProvider?

forEachNlpListener

Calls the specified action for each registered NlpListener.

fun forEachNlpListener(action: (NlpListener) -> Unit): Unit

getController

Returns the current ConnectorController for a given predicate.

fun getController(predicate: (BotApplicationConfiguration) -> Boolean): ConnectorController?

installBots

Installs the bot(s).

fun installBots(routerHandlers: List<(Router) -> Any?>, createApplicationIfNotExists: Boolean = true, startupLock: Lock? = null): Unit

notify

Sends a notification to a connector. A Bus is created and the corresponding story is called.

fun notify(applicationId: String, recipientId: PlayerId, intent: IntentAware, step: StoryStep<out StoryHandlerDefinition>? = null, parameters: Map<String, String> = emptyMap(), stateModifier: NotifyBotStateModifier = NotifyBotStateModifier.KEEP_CURRENT_STATE, notificationType: ActionNotificationType? = null, namespace: String? = null, botId: String? = null, errorListener: (Throwable) -> Unit = {}): Unit

registerBotAnswerInterceptor

Registers a new BotAnswerInterceptor.

fun registerBotAnswerInterceptor(botAnswerInterceptor: BotAnswerInterceptor): Unit

registerBotProvider

Registers a new BotProvider.

fun registerBotProvider(bot: BotProvider): Unit

registerBuiltInStoryDefinitions

Register built-in story definitions.

fun registerBuiltInStoryDefinitions(botProvider: BotProvider): Unit

registerConnectorService

fun registerConnectorService(service: ConnectorService): Unit

registerNlpListener

Registers a new NlpListener.

fun registerNlpListener(listener: NlpListener): Unit

registerStoryHandlerListener

Registers a new StoryHandlerListener.

fun registerStoryHandlerListener(listener: StoryHandlerListener): Unit