freeradiantbunny.org

freeradiantbunny.org/blog

botpress

BotPress is a JavaScript-based chatbot framework.

What is BotPress?

BotPress is an open-source chatbot framework designed for developers to create AI-driven conversational agents. It provides a visual interface, automation tools, and integration capabilities while supporting JavaScript (Node.js) for customization.

Key Features

BotPress JavaScript Code Example

Here’s a simple example of a BotPress bot with a custom JavaScript action:

// Create a custom action to respond with a dynamic message
const myCustomAction = async (state, event, { bot, axios }) => {
    const userMessage = event.preview;
    if (userMessage.toLowerCase().includes("hello")) {
        return { text: "Hey there! How can I assist you?" };
    } else {
        return { text: "I'm still learning. Can you rephrase?" };
    }
};
// Register the action
module.exports = myCustomAction;

Installation & Setup

Install BotPress on your machine:

npx @botpress/cli init my-chatbot
cd my-chatbot
npm install
npm start

Open http://localhost:3000 to access the BotPress admin panel.

Configure workflows, intents, and actions using the visual editor or JavaScript.

Use Cases