Add documentation about loading config values programmatically

master
Dragory 2019-12-03 02:45:42 +02:00
parent 8dd6513ca3
commit 5d71312788
2 changed files with 7 additions and 1 deletions

View File

@ -1,7 +1,7 @@
# Changelog # Changelog
## v2.29.0 ## v2.29.0
* **Change default configuration format to .ini** * **Default configuration format is now .ini**
* Existing `config.json` files will continue to work and will not be deprecated * Existing `config.json` files will continue to work and will not be deprecated
* This makes the default configuration format for the bot much more approachable than JSON * This makes the default configuration format for the bot much more approachable than JSON
* Config values can now also be loaded from environment variables * Config values can now also be loaded from environment variables

View File

@ -7,6 +7,7 @@ Haven't set up the bot yet? Check out [Setting up the bot](setup.md) first!
- [Required options](#required-options) - [Required options](#required-options)
- [Other options](#other-options) - [Other options](#other-options)
- [config.ini vs config.json](#configini-vs-configjson) - [config.ini vs config.json](#configini-vs-configjson)
- [Other formats](#other-formats)
- [Environment variables](#environment-variables) - [Environment variables](#environment-variables)
## Configuration file ## Configuration file
@ -315,6 +316,11 @@ This is the second line of the greeting."
} }
``` ```
## Other formats
Loading config values programmatically is also supported.
Create a `config.js` in the bot's folder and export the config object with `module.exports`.
All other configuration files take precedence, so make sure you don't have both.
## Environment variables ## Environment variables
Config options can be passed via environment variables. Config options can be passed via environment variables.