BotDefinition class defines the structure and capabilities of a Botpress bot. It specifies states, events, actions, integrations, and other bot-level configuration.
Constructor
BotDefinitionProps
object
State definitions for the bot. States can be scoped to bot, user, conversation, or workflow.
object
Custom event definitions for the bot.
object
Scheduled events that trigger on a cron schedule.
object
Action definitions that can be called by the bot.
object
Table definitions for structured data storage.
object
EXPERIMENTAL - Workflow definitions for multi-step processes.
object
User-level configuration and tags.
object
Conversation-level configuration and tags.
object
Message-level configuration and tags.
object
Bot configuration schema.
object
Integration instances (added via
addIntegration()).object
Plugin instances (added via
addPlugin()).object
Custom metadata attributes.
Methods
addIntegration
Add an integration to the bot.IntegrationPackage
required
The integration package to add.
object
Integration configuration.
string
Unique alias for this integration instance. Defaults to integration name.
boolean
Whether the integration is enabled.
object
Integration-specific configuration values.
string
For integrations with multiple configurations, specify which to use.
string[]
List of channel names to disable.
addPlugin
Add a plugin to the bot.PluginPackage
required
The plugin package to add.
object
required
dereferencePluginEntities
Resolve plugin entity references to their backing integration schemas.Properties
object
Bot metadata including SDK version.
object
Bot definition with plugin states, events, and actions merged in.
Type Definitions
StateType
StateDefinition
EventDefinition
ActionDefinition
WorkflowDefinition
TagDefinition
Complete Example
bot.definition.ts
See Also
- BotImplementation - Implement bot handlers
- BotSpecificClient - Type-safe API client
- BotHandlers - Event and message handlers