Nowadays, using chatbot to grow business is becoming increasingly popular and grows continuously. For developers, building a bot sounds like an exciting challenge. But in reality, creating your own chatbot would make you spend hundreds of hours learning and putting together all the infrastructure and code required to get it up and running. In this tutorial, we’re going to show you how to build a chatbot using Botpress, an open source chatbot tool that enables developers to create bots very quickly.
It helps developers build, deploy, manage, and scale bots. It is open-source, and has a modular framework which enables developers to assemble bots from the collection of open-source, specialized modules.
It is a complete platform that has all the tools you need to build, deploy and manage bots. Here are some of the components that are installed by default:
- An NLU Engine
- An administration dashboard
- A visual flow editor
- A chat emulator / debugger
- Support for multiple messaging channels
In this tutorial, we will be using CentOS Linux as the operating system. There are no prerequisites or dependencies that you need to setup in your server in order to complete this guide.
- Download the stable binaries of Botpress here. Choose which among MacOS, Windows and Linux platform you’re going to download. We are going to use the botpress package for Linux in this tutorial.
- After downloading the file, simply unzip the file in the server.
tar zxvf <zip file> -C <folder>
3. To start Botpress, simply run the command below:
Once the modules are installed and loaded, you should have something similar to the screenshot below:
For other Botpress commands available, simply run:
4. Open the Admin Dashboard in your web browser, http://your-server:3000.
When you open the portal for the first time, you will be asked to register an admin account.
Through the admin dashboard, you’ll be able to create, manage and configure your bots.
By default, Botpress will start an HTTP server on localhost, listening to port 3000. If the configured port is already in use, it will pick the next available one. You can change this by editing botpress configuration file data/global/botpress.config.json. To read more about the configuration of botpress, click here https://botpress.io/docs/advanced/configuration
5. Test the bot you created through the emulator as shown below:
6. Embed your chatbot to a webpage by inserting the script below:
There is an example provided in /botpress/modules/channel-web/assets/examples:
7. Once you have successfully embedded your chatbot in your webpage, this is how it will look like: