Develop a Botpress Bot
​Botpress is an on-prem, open-source chatbot building platform for businesses.

Botpress Quick Start Guide

Botpress is a Node.js package and works with Node and npm.
The fastest way to start with Botpress is using botpress-kick-starter repository that is already integrated with Rocket.Chat via botpress-channel connector.
Navigate to the folder where you want to work with the bot and proceed with the following steps:
  • Install the Botpress package with npm using the command below
1
npm init -y
2
npm install [email protected]
Copied!
  • Next create a bot and initialize it
1
mkdir bot
2
cd bot
3
../node_modules/.bin/botpress init
Copied!
botpress init command launches a wizard that will help you create the initial configuration. You should see something as follows:
1
$ ../node_modules/.bin/botpress init
2
​
3
---------------
4
Hey there πŸ‘‹, thanks for using Botpress!
5
We'll walk you through the creation of your new bot.
6
For more information or help, please visit https://botpress.io/docs
7
---------------
8
name: (bot) botpress-bot
9
botpress version: (10.40.0)
10
description: Testing bot for docs
11
author: Rodriq
12
​
13
=============================
14
Template: Basic (default)
15
Author: Botpress, Inc.
16
Description: A basic bot for your website
17
Channels: web
18
=============================
19
​
20
-> Copying .welcome
21
-> Copying botfile.js
22
-> Copying config/channel-web.json
23
-> Copying config/nlu.json
24
-> Copying generated/content/builtin_text.json
25
-> Copying generated/flows/main.flow.json
26
-> Copying generated/flows/main.ui.json
27
-> Copying generated/intents/forget.json
28
-> Copying generated/intents/forget.utterances.txt
29
-> Copying generated/intents/hello.json
30
-> Copying generated/intents/hello.utterances.txt
31
-> Copying generated/intents/none.json
32
-> Copying generated/intents/none.utterances.txt
33
-> Copying index.js
34
-> Copying package.json
35
-> Copying README.md
36
-> Copying src/actions.js
37
-> Copying src/content/.empty
38
-> Copying src/custom.js
39
-> Copying src/index.js
40
-> Copying src/renderers.js
41
-> Copying .gitignore
42
​
43
πŸŽ‰ Your bot was initialized succesfully!
44
​
45
Next steps:
46
1) Install bot dependencies by running npm install (or yarn install)
47
2) Start the bot by running npm start (or yarn start)
48
​
49
Enjoy Botpress!
Copied!
  • When that is done, install the bots dependencies and the botpress connector by running the following code
1
npm install
2
npm install botpress-channel-rocketchat
Copied!
  • Open config folder and create channel-rocketchat.json file with the following content:
1
{
2
"ROCKETCHAT_USER": <BOTPRESS USER NAME>,
3
"ROCKETCHAT_PASSWORD": <BOTPRESS USER PASS>,
4
"ROCKETCHAT_URL": <ROCKETCHAT HOST>,
5
"ROCKETCHAT_USE_SSL": <SSL USAGE>,
6
"ROCKETCHAT_ROOM": <ROCKETCHAT CHANNEL>,
7
"scope": ""
8
}
Copied!
Adjust the content to fit your server and user credentials. Make sure mybotuser has a BOT role on the server. For more information on how to create a bot user please refer to this page.
  • Now run the bot by running
1
npm start
Copied!
After executing the command, botpress will try to do the following actions:
  • launch botpress instance;
  • launch dedicated Admin Dashboard;
  • launch dedicated Webchat window;
  • connect to the Rocket.Chat instance;
  • listen to messages in general room.
1
$ npm start
2
​
3
> [email protected] start /botpress-bot/bot
4
> node index.js
5
​
6
19:27:44 - debug: [DB Janitor] Added table "logs"
7
19:27:44 - info: Starting botpress version 10.40.0
8
19:27:44 - info: [DB Janitor] Started
9
19:27:44 - info: [Ghost Content Manager] (transparent) Initialized
10
19:27:44 - debug: [Ghost Content Manager] (transparent) Added root folder generated/media, doing nothing.
11
19:27:44 - debug: [Ghost Content Manager] (transparent) Added root folder generated/flows, doing nothing.
12
19:27:44 - info: [Skills] Initiated
13
19:27:44 - info: Loaded @botpress/audience, version 10.40.0
14
19:27:44 - verbose: [Renderers] Enabled for webchat.
15
19:27:44 - info: Loaded @botpress/channel-web, version 10.40.0
16
19:27:44 - info: Loaded @botpress/hitl, version 10.40.0
17
19:27:44 - debug: [Ghost Content Manager] (transparent) Added root folder generated/intents, doing nothing.
18
19:27:44 - debug: [Ghost Content Manager] (transparent) Added root folder generated/entities, doing nothing.
19
19:27:44 - info: Loaded @botpress/nlu, version 10.40.0
20
19:27:44 - info: Loaded @botpress/skill-choice, version 10.40.0
21
19:27:44 - warn: DEPRECATION NOTICE – bp.umm is deprecated and will be removed – Please see bp.renderers instead.
22
19:27:44 - warn: DEPRECATION NOTICE – bp.umm is deprecated and will be removed – Please see bp.renderers instead.
23
19:27:44 - verbose: [Renderers] Enabled for rocketchat.
24
19:27:44 - info: Loaded botpress-channel-rocketchat, version 0.0.14
25
19:27:44 - info: Loaded 6 modules
26
19:27:44 - info: [Skills] Loaded 1 skills
27
19:27:44 - debug: [Ghost Content Manager] (transparent) Added root folder generated/content, doing nothing.
28
19:27:44 - debug: Loading middleware: rendering.instrumentation
29
19:27:44 - debug: Loading middleware: hitl.captureInMessages
30
19:27:44 - debug: Loading middleware: nlu.incoming
31
19:27:44 - debug: Loading middleware: hear
32
19:27:44 - debug: Loading middleware: hitl.captureOutMessages
33
19:27:44 - debug: Loading middleware: webchat.sendMessages
34
19:27:44 - debug: Loading middleware: rocketchat.sendMessages
35
19:27:44 - debug: Loading middleware: fallback
36
19:27:44 - debug: Loading data for builtin_text from builtin_text.json
37
19:27:44 - info: Read 7 item(s) from builtin_text.json
38
19:27:44 - info: Bot launched. Visit: http://localhost:3000
39
[connect] Connecting { username: 'bot',
40
password: 'pass',
41
ldap: false,
42
host: 'bots.rocket.chat',
43
useSsl: true,
44
timeout: 20000,
45
rooms: [],
46
allPublic: false,
47
dm: false,
48
livechat: false,
49
edited: false,
50
integrationId: 'js.SDK',
51
roomCacheMaxSize: 10,
52
roomCacheMaxAge: 300000,
53
dmCacheMaxSize: 10,
54
dmCacheMaxAge: 100000 }
55
19:27:44 - debug: Loading data for builtin_image from builtin_image.json
56
19:27:44 - debug: Loading data for builtin_single-choice from builtin_single-choice.json
57
19:27:44 - debug: Loading data for builtin_card from builtin_card.json
58
19:27:44 - debug: Loading data for builtin_action-button from builtin_action-button.json
59
19:27:44 - debug: Loading data for builtin_carousel from builtin_carousel.json
60
19:27:44 - debug: Loading data for builtin_raw from builtin_raw.json
61
19:27:45 - debug: [NLU::Native] Model is up to date
62
19:27:45 - info: ------------
63
19:27:45 - info: Webchat available at http://localhost:3000/s/chat
64
19:27:45 - info: ------------
65
[connect] Connected
66
[login] Logging in DocsBot
67
[getRoomIdByNameOrId] Calling (caching): general
68
[getRoomIdByNameOrId] Success: "GENERAL"
69
[joinRoom] Calling (async): ["GENERAL"]
70
[joinRoom] Success
71
[subscribe] Preparing subscription: stream-room-messages: __my_messages__
72
[subscribe] Stream ready: 4
73
LISTEN TRIGGERED
74
[reactive] Listening for change events in collection stream-room-messages
Copied!
  • To test communication with your bot, login on your server as a regular user (not the BOT user), go to general room, and talk to your newly created bot:
Botpress bot responses to user messages
Last modified 13d ago
Export as PDF
Copy link
Edit on GitHub