Configuration
Two files configure the bot: .env for secrets and service addresses, and config.json for community/channel ids. Templates ship as .env.example and config.example.json.
.env
Loaded by examples/musicbot/serve.sh and by the systemd unit (EnvironmentFile=). Copy it from .env.example and keep it mode 600.
| Variable | Required | Meaning |
|---|---|---|
ROOT_TOKEN | Yes | The alt account's session Bearer token, captured per the Token Capture guide. Presented as Authorization: Bearer <token> on every API call. Treat it like a password. |
LAVALINK_PASSWORD | One of the two | Lavalink server password. If empty, the bot falls back to reading LAVALINK_PASSWORD_FILE. |
LAVALINK_PASSWORD_FILE | One of the two | File the Lavalink password is read from when LAVALINK_PASSWORD is unset. No default: one of LAVALINK_PASSWORD / LAVALINK_PASSWORD_FILE must be set, or the bot refuses to start (RB-E014). |
LAVALINK_BASE | No | Lavalink REST base URL. Default: http://127.0.0.1:2333. |
ROOTBOT_CONFIG | No | Explicit path to the bot's config.json. Overrides the default search (below). |
A Lavalink password is required: with neither LAVALINK_PASSWORD nor LAVALINK_PASSWORD_FILE set, the bot refuses to start and reports RB-E014. There is no default password file. (At playback time a track still falls back to yt-dlp when the Lavalink stream is unavailable, which will normally fail from a server IP, see Lavalink.)
config.json
The music bot loads its config from the first of these that exists:
$ROOTBOT_CONFIGexamples/musicbot/config.jsonconfig.jsonat the repository root
Fields (from config.example.json):
{
"community_id": "00000000-0000-0000-0000-000000000000",
"container_id": "00000000-0000-0000-0000-000000000000",
"communities": [
{ "id": "00000000-0000-0000-0000-000000000000", "name": "My Community" }
]
}| Field | Meaning |
|---|---|
community_id | Home community id. Used as the join target fallback when no follow-me target is pending, and as the discovery fallback seed. |
container_id | Default voice channel (container) id in the home community, paired with community_id for the fallback join. If discovery finds the home community but not this channel, the bot appends it as a voice channel so the fallback still works. |
communities | Fallback list of {id, name} used only when API discovery (ListMine) returns nothing. Normally you never maintain this, discovery finds every community the alt belongs to. |
In practice: once discovery works (discovery=api in the startup log), the ids in this file barely matter. They exist so the bot can still start against a known home community if the discovery call ever breaks.
Lavalink's application.yml
Lavalink has its own config, templated at deploy/lavalink/application.yml.template:
| Setting | Value in template | Notes |
|---|---|---|
server.port / server.address | 2333 / 127.0.0.1 | Localhost only, Lavalink is a sidecar, never expose it. |
lavalink.server.password | placeholder | Must match what the bot reads via LAVALINK_PASSWORD / PASSWORD.txt. |
lavalink.server.sources.youtube | false | Built-in source disabled; the plugin replaces it. |
plugins.youtube.clients | MUSIC, TV, TVHTML5_SIMPLY, WEB, WEBEMBEDDED, MWEB, ANDROID_VR | Client ladder. Only TV supports OAuth. |
plugins.youtube.oauth.enabled | true | Required for the TV-client path. |
plugins.youtube.oauth.refreshToken | placeholder | From the one-time device-code step. |
plugins.youtube.remoteCipher.url | https://cipher.kikkia.dev | Public demo cipher; self-host yt-cipher for heavy use. |
Full details: Lavalink.