Personal Discord bot with Natural-language understanding (NLU) support using Discord.js and Rasa.
- Install Node.js as in their official guide.
As an alternative, you may deploy this project on cloud using Heroku.
- Install Yarn as in their official guide.
If you don't want to use Yarn, you may skip this step and use NPM (the default of Node.js) instead.
- Open this project directory in terminal, and install the dependencies.
$ yarn install
- Open the Discord developer portal and log into your account.
- Click on the
New Application
button to create a new app. - Select
Bot
tab and then click on theAdd Bot
button to create a new bot. - Add a new
BOT_TOKEN
variable in the.env
file with the value of your bot's token.BOT_TOKEN=NzkyNzE1NDU0MTk2MDg4ODQy
- Install MongoDB as in their official guide.
As an alternative, you may setup the database on cloud using MongoDB Atlas.
- Add a new
DB_URI
variable in the.env
file with the value of your MongoDB's URI.DB_URI=mongodb://user:pass@localhost:27017/db
- Setup the NLU API as in threeal/threeal-bot-nlu.
- Add a new
NLU_URL
variable in the.env
file with the value of your NLU API's URL.NLU_URL=http://localhost:5005/webhooks/rest/webhook
- (Optional) set optional value in
.env
file as follows:PORT
, fill it with the port number of the HTTP server that will redirect to the bot invitation address. If not provided, the HTTP server will be disabled.DEBUG_SERVER
, fill it with a Discord server's name that the bot only able to interacts with for debug purposes. If not provided, the bot will interact with all the Discord servers.
- (Optional) modify the code in this project as you desire and then check the code lint.
$ yarn lint
- Start the bot and test it on your Discord server.
$ yarn start