Skip to main content

Environment Variables

Setting environment variables allows you to customise the bot to your liking.

The bot cannot run without specifying the minimum environment variables whilst others merely make the bot more unique, like embed colours.

Configure environment variables

Create a .env file in the folder you have cloned.

# Required
DISCORD_API_KEY=Your_Discord_API_Key
MONGODB_URI=MongoDB_URL

# Optional
DEFAULT_GUILD_ID=Default_Guild_Id
BOT_PLAYING=Bot_Playing
BOT_COLOR_HEX=EMBED_COLOR_HEX # Remove the hash from the hex value. E.g. #0067f4 -> 0067f4
Environment VariableRequiredDefaultDescription
DISCORD_API_KEYNo default; will fail withoutThis the API key you have retrieved from the Discord Developer Portal.
MONGODB_URINo default; will fail withoutTo store preferences, Notify uses MongoDB, an online database service. This is the uri you will have generated from that.
DEFAULT_GUILD_IDnullThis variable should only be used during development. It is the ID of the Discord server that you would like to register slash commands with. This is because by default, Discord can take up to an hour to register slash commands. In production, this can be omitted.
BOT_PLAYINGbandev.uk/notifyThis is what you would like to show the bot playing.
BOT_COLOR_HEX0067f4This is the hex value of the colour that you would like all embeds that the bot sends to use. Make sure you remove the # from the hex value.