Creating your own Bot
.env configuration
Development Environment
Setting up your node module
First we need to create a new directory and initialize our node package:
Getting ready to create your own command modules requires a short bit of setup. We need to initialize our node package, install a few packages and create a src/
directory as follows.
Configuration
The autobots framework relies on environment variables for configuration. We use the dotenv
module to load the .env
configuration file in the project root at boot time.
The required variables are:
Variable Name | Description |
| Discord bot token. |
| The directory which you will publish your node modules under. |
| The pattern to look for node modules directory names. |
Here is an example of a .env
file with some custom variables for our testbot that we'll read in later:
Create this file in your project root directory and name it .env
.
bot.js
Create a file named bot.js
. This will be our bootstrap file which will initialize our bot: