Skip to content

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.

VariableRequiredMeaning
ROOT_TOKENYesThe 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_PASSWORDOne of the twoLavalink server password. If empty, the bot falls back to reading LAVALINK_PASSWORD_FILE.
LAVALINK_PASSWORD_FILEOne of the twoFile 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_BASENoLavalink REST base URL. Default: http://127.0.0.1:2333.
ROOTBOT_CONFIGNoExplicit 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:

  1. $ROOTBOT_CONFIG
  2. examples/musicbot/config.json
  3. config.json at 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" }
  ]
}
FieldMeaning
community_idHome community id. Used as the join target fallback when no follow-me target is pending, and as the discovery fallback seed.
container_idDefault 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.
communitiesFallback 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 has its own config, templated at deploy/lavalink/application.yml.template:

SettingValue in templateNotes
server.port / server.address2333 / 127.0.0.1Localhost only, Lavalink is a sidecar, never expose it.
lavalink.server.passwordplaceholderMust match what the bot reads via LAVALINK_PASSWORD / PASSWORD.txt.
lavalink.server.sources.youtubefalseBuilt-in source disabled; the plugin replaces it.
plugins.youtube.clientsMUSIC, TV, TVHTML5_SIMPLY, WEB, WEBEMBEDDED, MWEB, ANDROID_VRClient ladder. Only TV supports OAuth.
plugins.youtube.oauth.enabledtrueRequired for the TV-client path.
plugins.youtube.oauth.refreshTokenplaceholderFrom the one-time device-code step.
plugins.youtube.remoteCipher.urlhttps://cipher.kikkia.devPublic demo cipher; self-host yt-cipher for heavy use.

Full details: Lavalink.