Skip to content

Getting Started

RootBot runs a normal Root user account headlessly as a bot. Setup has four parts, in order: an account and a token, configuration, the Lavalink sidecar that fetches YouTube audio, and deployment to a Linux VPS.

Prerequisites

You needWhy
A Root alt accountThe bot is this account. Throwaway, nothing paid attached, Root's Terms of Use do not permit automated use (Section 2.5), so ban risk is real. Never your main. See Limits.
A Windows PC with the Root clientOnly for the one-time token capture, signed in as the alt.
A Linux VPS (Ubuntu)Runs the bot and Lavalink. Python 3.11+, ffmpeg, Java 17+, curl (the deploy script installs what is missing). Direct internet egress, LiveKit media does not survive a proxied-only sandbox.
A burner Google accountFor the Lavalink YouTube OAuth step. Never your main Google account; Google may terminate accounts used this way.

The setup flow

1. Capture the Bearer token

The bot logs in with the alt's session Bearer token, lifted from the real client's own traffic, the same trick as Discord token login. Root's API traffic ignores the Windows system proxy, so the capture uses Proxifier + mitmproxy.

→ Token Capture

The result is one value, ROOT_TOKEN, which you treat like a password.

2. Configure

From the repository root:

cp .env.example .env
cp config.example.json examples/musicbot/config.json

Set ROOT_TOKEN in .env. The ids in config.json are only a fallback seed, at startup the bot discovers the alt's communities automatically via the API, so the example's all-zero ids work until discovery runs.

→ Configuration for every setting.

The bot never talks to YouTube directly: datacenter IPs get bot-checked and cookie sessions get SABR-flagged. A local Lavalink 4.2.2 with the youtube-source plugin does all fetching. The plugin must be built from a specific source commit, and its TV client needs a one-time OAuth device-code approval with the burner Google account.

→ Lavalink

4. Deploy

bash deploy/deploy.sh root@your-vps

This ships the code, builds a venv, downloads Lavalink, installs systemd units for both services, and starts them (the bot only starts once .env contains a token). If plain ssh cannot reach the box, override the SSH command:

ROOTBOT_SSH="ssh -i ~/.ssh/mykey -p 2222" bash deploy/deploy.sh root@your-vps

→ Deployment

Or run it manually

python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
bash examples/musicbot/serve.sh   # loads .env, runs the bot in foreground

First run checklist

  • serve.log shows a line like serve: self=<account-id> discovery=api watching N containers in M communities, primed K messages. discovery=api means ListMine found the alt's communities; config means it fell back to config.json.
  • The alt must be a member of a community for the bot to see it. If a community is missing, invite/add the alt there, the bot rescans every 60 seconds and picks it up without a restart.
  • In chat, !ping answers pong. Sit in a voice channel and !play <song name>, the bot joins your channel and plays.

Stability promise

Patch releases never break the public API, config keys, or the rootbot CLI's flags; a break may land only at a minor bump, and only after a deprecation warning one release ahead. rootbot.testing is provisional and may change in any release. The full policy is in the README.

Tests

The repo ships a stubbed test suite (no network, no LiveKit):

python3 tests/contracts/test_framework.py   # ALL 82 checks
python3 tests/contracts/test_serve.py       # ALL 150 checks

It covers wire parsing of ListMine responses, watcher routing, follow-me, smart shuffle, autoplay, text cards, and the playback loop.