The options for this config provider.
Throws if it is not possible to cast a value to its given type.
Readonly
configThe processed config object.
ConfigProvider
Optional
Readonly
defaultThe default config values.
ConfigProvider
Readonly
optionsThe options for this config provider.
ConfigProvider
Readonly
validatorThe validator for this config.
ConfigProvider
Get the value corresponding to the provided key.
The key of the configuration. Keys are upper-cased.
The corresponding value.
Private
processPrivate
processProcess the default configuration.
Optional
defaults: Record<string, ConfigValue>The defaults object.
Private
processProcess the environment variables object for configuration. Keys must begin with DISCORD_ to be added to the configuration provider.
Optional
env: ProcessEnv | Record<string, ConfigValue>The environment variables object.
Throws if it is not possible to cast a value to its given type.
Generated using TypeDoc
A client configuration provider. It accepts configuration from both ENV variables and JSON config file. Should be created before initializing client.
DISCORD_
all upper-cased.If multiple sources are specified, the configuration will be processed in the following order:
The ConfigProvider supports array types, you can supply them through the JSON config as a direct array or through environment variables through comma-separated values.
An example environment variable file would be:
An example JSON config file would be:
An example default object would be:
Getting values from this config would be done by:
It is also recommended specifying the types of the config. Check ConfigValidator for more information.