To use environment variables, just run a command to set them. This will be different depending on your platform.
set VARIABLE_NAME="some value"
For macOS and Linux:
export VARIABLE_NAME="some value"
If you would like to use environment variables in your launcher script, you can add them as Node.js
process.env object property definitions.
/* eslint-disable */ // You can pick which ones to define, with the exception being DISCORD_TOKEN since it is required.process.env.DISCORD_TOKEN = "BLAHBLAHBLAH"process.env.DEBUG = "false" const start = require("./build/index").start // other stuff here
Keep this in mind though:
- You need to add the
process.envdefinitions before the
requirestatement that imports Cakebot, or it will have the possibility of crashing.
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.
Debug switches debugging on and off. We suggest you keep it off unless you are contributing to the bot.
Type: String-literal boolean (
The prefix for all the bots commands when used on Discord.
The status that the bot displays on Discord.
You can use the following placeholders in the status:
(PREFIX)- The bot's prefix (see also
The token for the WordsAPI API.
Leaving this as undefined will disable the command
The personal access token (PAT) for the GitHub API.
Leaving this as undefined will disable the commands