Bass is a feature-rich discord music bot.
With features like the button-controlled player message, easy interop with spotify links,
built-in lyrics search and many more features, it offers the best listening experience.
- Multi-source playback — YouTube, Spotify, SoundCloud, and more via Lavalink
- Load Playlists — Support for YouTube and Spotify playlists and albums
- Interactive player message — Button controls for play/pause, skip, previous, stop, and loop
- Queue management — View, shuffle, move, remove tracks, and save/load queues across sessions
- Search — Search for tracks directly from Discord with
/search - Loop modes — Loop the current track or the entire queue
- History — Restore your previous queue with
/historyand/loadqueue - Web dashboard — Monitor active players, guilds, and activity from a browser
- Lyrics — Look up lyrics for the current song with
/lyrics - Channel binding — Restrict bot commands to specific channels with
/bindchannel
| Command | Description |
|---|---|
/play |
Play a song by URL or search query |
/search |
Search and pick from results |
/queue |
View the current queue |
/shuffle |
Shuffle the queue |
/lyrics |
Show lyrics for the current track |
/loop |
Toggle loop (track / queue / off) |
/history |
View previous queues |
/loadqueue |
Restore a saved queue |
/seek |
Jump to a position in the track |
/volume |
Adjust playback volume |
/w2g |
Create a Watch2Gether room |
The easiest way to run BassBot is with Docker Compose.
mkdir bassbot && cd bassbot
mkdir bot web
# Docker Compose file
curl -O https://raw.githubusercontent.com/tomfln/bassbot/main/config/compose.yml
# Environment template (rename to .env)
curl -o .env https://raw.githubusercontent.com/tomfln/bassbot/main/config/.env.example
# Lavalink config (into the data directory)
mkdir -p bassbot-data
curl -o bassbot-data/application.yml https://raw.githubusercontent.com/tomfln/bassbot/main/config/application.ymlOpen .env and set all required values. Docker Compose will warn you about any missing variables.
| Variable | Required | Description |
|---|---|---|
DISCORD_BOT_TOKEN |
Yes | Bot token (Developer Portal → Bot) |
DISCORD_APP_ID |
Yes | Application ID (General Information) |
DISCORD_OAUTH_CLIENT_SECRET |
Yes | OAuth client secret (OAuth2 page) |
JWT_SECRET |
Yes | Shared secret for bot ↔ web auth. Generate: openssl rand -hex 32 |
BETTER_AUTH_SECRET |
Yes | Web auth encryption secret. Generate: openssl rand -hex 32 |
WEB_BASE_URL |
Yes | Public URL of the dashboard (e.g. http://localhost:3000) |
LAVALINK_HOST |
No | Lavalink address (default: lavalink:2333) |
LAVALINK_PASSWORD |
No | Lavalink password (default: youshallnotpass) |
W2G_KEY |
No | Watch2Gether API key |
ADMIN_USERS |
No | Comma-separated Discord usernames auto-promoted to admin |
API_PORT |
No | Bot REST API port (default: 3001) |
WEB_PORT |
No | Web dashboard port (default: 3000) |
API_URL |
No | Bot API URL from the browser — only set when bot is on a different domain |
BOT_DATA_PATH |
No | Bot data bind-mount path (default: ./bot) |
WEB_DATA_PATH |
No | Web data bind-mount path (default: ./web) |
LAVALINK_CONFIG |
No | Path to Lavalink application.yml (default: ./application.yml) |
Named volumes: If you prefer Docker named volumes instead of bind mounts, see the commented-out sections in
compose.yml.
To enable Spotify link support, edit bassbot-data/application.yml, enable the spotify source and set your Spotify API credentials under plugins.lavasrc.spotify:
lavasrc:
# ...
sources:
spotify: true
# ...
spotify:
clientId: "your_spotify_client_id"
clientSecret: "your_spotify_client_secret"You can create these at the Spotify Developer Dashboard.
docker compose up -dThe bot will start, connect to Lavalink, and be ready to use. Invite it to your server, join a voice channel, and run /play.
YouTube requires OAuth authentication for reliable playback. Without it, you may encounter errors or age-restricted content blocks.
Warning: Use a burner Google account, not your main one. OAuth tokens give access to the account's YouTube data.
-
In
lavalink/application.yml, make sure OAuth is enabled without a refresh token:plugins: youtube: oauth: enabled: true
-
Start the stack:
docker compose up -d
-
Watch the Lavalink logs:
docker logs -f lavalink
-
Lavalink will print a message like:
To give youtube-source access to your account, go to https://www.google.com/device and enter code XXXX-XXXX -
Open the URL in your browser, sign in with a burner Google account, and enter the code.
-
Once authorized, Lavalink logs will show:
Token retrieved successfully. Store your refresh token as this can be reused. (1//0xxxx...) -
Copy the refresh token and add it to
lavalink/application.yml:plugins: youtube: oauth: enabled: true refreshToken: "1//0xxxx..." skipInitialization: true
-
Restart Lavalink to apply:
docker compose restart lavalink
From now on, Lavalink will use the refresh token automatically — no manual login needed.
The web dashboard lets users control music playback from a browser. It uses Discord OAuth for authentication.
- Go to the Discord Developer Portal
- Select your bot application (or create a new one)
- Go to OAuth2 → General
- Copy the Client ID and Client Secret
- Add a redirect URL:
http://localhost:3000/rest/auth/callback/discord(or your production domain)
Make sure these variables are set in your .env:
DISCORD_APP_ID=your_client_id
DISCORD_OAUTH_CLIENT_SECRET=your_client_secret
JWT_SECRET=your-random-secret-here
BETTER_AUTH_SECRET=your-random-secret-here
WEB_BASE_URL=http://localhost:3000Set ADMIN_USERS=yourdiscordusername in .env to auto-promote yourself on login. Once you're an admin, you can promote other users from the Admin → Users page.
- Clone the repository
- Run
bun install - Copy
.env.exampleto.envand fill in the values - Run
bun devto start the bot and dashboard in dev mode
- TypeScript — Fully typed codebase with custom type-safe command framework
- Bun — Fast JS runtime, no build step needed
- Lavalink + Shoukaku — Reliable audio playback with Spotify support
- Discord.js — Discord API interaction
- Drizzle ORM + SQLite — Lightweight embedded database for persistence
- Next.js — Dashboard for monitoring the bot
This project is licensed under the MIT license. See the LICENSE file for more information.
Contributions are welcome! Please open an issue or a pull request.