-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Advanced Config Options
Setting a different file to use as the config file is possible via the -Dconfig=/path/to/config.file
command-line option. For example:
java -Dconfig=alternate_config.txt -jar JMusicBot.jar
will run the bot, loading from alternate_config.txt
instead of config.txt
.
Similar to the -Dconfig
option, any setting in the config file can also be set from the command line. For example, to set the prefix from the command line (instead of from the config), you would use -Dprefix="!!"
(values need to be quoted if they contain spaces or some special characters). For example:
java -Dprefix="!" -jar JMusicBot.jar
To use environment variables for the config, there are two options. For the following examples, assume that a prefix has been set to the environment variable CUSTOM_PREFIX
.
To use environment variables from the command line, use the same system from above, but substitute in a resolved variable name. For example:
java -Dprefix="$CUSTOM_PREFIX" -jar JMusicBot.jar
To use an environment in the config file, specify it as follows
// this is in the config file
prefix = ${CUSTOM_PREFIX}