Environment Variables
#
How to use environment variablesTo use environment variables, just run a command to set them. This will be different depending on your platform.
For Windows:
For macOS and Linux:
#
Using in a launcher scriptIf you would like to use environment variables in your launcher script, you can add them as Node.js process.env
object property definitions.
For example:
Keep this in mind though:
- You need to add the
process.env
definitions before therequire
statement that imports Cakebot, or it will have the possibility of crashing.
#
Environment variablesDISCORD_TOKEN
#
Requirement
This variable MUST be defined, or the bot will crash.
The token to log in to Discord with. This can be found in the 'Bot' section of your application on the Discord developer portal.
Type: String
Default: None
DEBUG
#
Debug switches debugging on and off. We suggest you keep it off unless you are contributing to the bot.
Type: String-literal boolean ("true"
or "false"
)
Default: false
BOT_PREFIX
#
The prefix for all the bots commands when used on Discord.
Type: String
Default: "-"
BOT_STATUS
#
The status that the bot displays on Discord.
Placeholders
You can use the following placeholders in the status:
(PREFIX)
- The bot's prefix (see alsoBOT_PREFIX
)
Type: String
Default: "Run (PREFIX)help"
WORDSAPI_TOKEN
#
The token for the WordsAPI API.
Leaving this as undefined will disable the command define
.
Type: String
Default: Undefined
GITHUB_TOKEN
#
The personal access token (PAT) for the GitHub API.
Leaving this as undefined will disable the commands homepage
and stars
.
Type: String
Default: Undefined