Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Personal Discord bot with NLU support using Discord.js and Rasa

License

Notifications You must be signed in to change notification settings

threeal-archive/threeal-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Threeal Bot

Personal Discord bot with Natural-language understanding (NLU) support using Discord.js and Rasa.

Project Setup

  • 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

Bot Setup

  • 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 the Add 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
    

Database Setup

  • 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
    

NLU Setup

  • 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
    

Usage

  • (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