botpress
or
Botpress is an open-source bot creation tool written in Javascript. It is powered by a rich set of open-source modules built by the community. We like to say that Botpress is like the Wordpress of Chatbots; anyone can create and reuse other people's modules.
Installation
npm install -g botpress
Creating a bot
Creating a bot is simple, you need to run
botpress init
in a terminal inside an empty directory:mkdir my-bot && cd my-bot
botpress init
Once your bot is created, you need to run
botpress start
to start your bot:botpress start
This will provide you locally a web interface available at
http://localhost:3000
Adding stuff to your bot
At this point, your bot does nothing, you need to add features. There are two ways to add features:
- Installing and configuring modules
- Coding
For example, there's a
botpress-messenger
module that will make your bot connect to Facebook Messenger and easily send/receive messages.
You can install modules directly in the web interface, or by using the
botpress install
command:botpress install messenger
Once installed, modules expose two things:
- A graphical interface (available in the left panel). This makes configuration easy and convenient. You don't need to know about coding to use the graphical interface.
- Features via APIs. Each module has a detailed documentation on how to use their API.
There are not a lot of modules yet, we count on the community to develop many useful ones! Please get in touch with us if you would like to develop modules but you are not sure on how to get started.
Coding to add features
As the number of modules increase, we expect that the amount of code you'll need to write will lower everyday. Developers can add code directly in the bot (i.e.
index.js
) and access the core and modules features. For example, if you wish to respond to a GETTING_STARTED
event on Facebook Messenger, you might code something along these lines:bp.hear({ type: 'postback', text: 'GETTING_STARTED' }, (event, next) => {
bp.messenger.sendText(event.user.id, 'Hello, human!')
})
Comments
Post a Comment