-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Master-Bot is configured entirely through a single .env file located in the workspace root. Both the bot and the dashboard share this environment.
- Overview & Configuration Flow
- 🗄️ Database (
DB_URI) - 🤖 Discord & Dashboard URLs
- 🎵 Lavalink & Audio Gateway
- 📺 YouTube OAuth Credentials
- 🎧 Spotify & Third-Party APIs
- 🚩 Feature Toggles
- 🔑 API Keys & Acquisition Guide
- Related Guides
flowchart TD
Env[Workspace .env] --> BotEnv[apps/bot/src/env.ts]
Env --> DashEnv[apps/dashboard/src/env.mjs]
Env --> DBPackage[packages/db/scripts/prepare-schema.mjs]
BotEnv --> BotGateway[Discord Bot Gateway & Music]
DashEnv --> WebServer[Next.js 15 Web Dashboard]
DBPackage --> Prisma[Prisma Schema & Client: DB_URI]
DB_URI="file:/data/db.sqlite"Master-Bot uses Prisma ORM with a strict dual-database architecture:
-
SQLite (Default Zero-Ops): When set to a
file:...URI (e.g.file:/data/db.sqlite), Master-Bot uses local SQLite storage. The directory is created automatically on boot. No external database server or Docker container is needed. -
PostgreSQL (Production Scaling): Set
DB_URI="postgresql://user:password@host:5432/dbname?schema=public"for high-throughput multi-server production environments.
Important
The project strictly enforces a single environment variable: DB_URI. Redundant aliases such as DATABASE_URL or DB_URL are not supported.
| Variable | Default | Options | Description |
|---|---|---|---|
DASHBOARD_THEME |
dark |
dark, light, glassmorphism, cyberpunk, dracula, nord, emerald
|
Default visual theme rendered on first load. Users can toggle freely from the theme picker dropdown. |
DASHBOARD_COLOR_SCHEME |
default |
default, purple, blue, emerald, rose, amber, indigo, crimson, teal, sunset, cyan
|
Default accent color scheme overriding buttons, focus rings, and highlights. |
| Variable | Required | Description |
|---|---|---|
DISCORD_TOKEN |
✅ | Bot authentication token from the Discord Developer Portal. |
DISCORD_CLIENT_ID |
✅ | Discord application Client ID (used for OAuth2 and invite generation). |
DISCORD_CLIENT_SECRET |
✅ | Discord application Client Secret (used for web dashboard login). |
NEXTAUTH_SECRET |
✅ | 32+ character random signing secret (openssl rand -base64 32). |
INTERNAL_URL |
✅ | Host and port binding (0.0.0.0:3000). Binds to 0.0.0.0 so the service listens across all network interfaces, allowing both internal SSR requests and public traffic to reach the dashboard. |
PUBLIC_URL |
✅ | The canonical public HTTPS domain of your dashboard (e.g. https://your-domain.com). Used for dashboard links and OAuth callbacks. |
DISCORD_CALLBACK_URL |
✅ | Public bot invite authorization URL with administrator permissions. |
| Variable | Default | Description |
|---|---|---|
LAVA_HOST |
localhost |
Hostname or IP address of the Lavalink v4 server. |
LAVA_PORT |
2333 |
Port number for the Lavalink HTTP and WebSocket gateway. |
LAVA_PASS |
youshallnotpass |
Authorization password (must match application.yml). |
LAVA_SECURE |
false |
Set to true to enable TLS (WSS/HTTPS) for remote Lavalink nodes. |
LAVA_EXTERNAL |
false |
Set to true when connecting to a remote external Lavalink node. |
| Variable | Required | Description |
|---|---|---|
YOUTUBE_CLIENT_ID |
Optional | Google Cloud OAuth 2.0 Client ID. Powers YouTube live stream and video upload alerts. |
YOUTUBE_CLIENT_SECRET |
Optional | Google Cloud OAuth 2.0 Client Secret for YouTube alerts. |
YOUTUBE_REFRESH_TOKEN |
Optional | OAuth 2.0 refresh token for stream alerts and embedded Lavalink YouTube playback. |
YOUTUBE_CIPHER_URL |
https://cipher.kikkia.dev/ |
Remote endpoint for deciphering complex YouTube streaming signatures. |
YOUTUBE_CIPHER_PASSWORD |
Optional | Password for self-hosted cipher instances. |
Tip
Setting YOUTUBE_CLIENT_ID, YOUTUBE_CLIENT_SECRET, and YOUTUBE_REFRESH_TOKEN enables authenticated playback in Lavalink, bypassing YouTube IP throttling and robot verification challenges.
| Variable | Required | Description |
|---|---|---|
SPOTIFY_CLIENT_ID |
Optional | Spotify Developer client ID (resolves Spotify track/album metadata). |
SPOTIFY_CLIENT_SECRET |
Optional | Spotify Developer client secret. |
TWITCH_CLIENT_ID |
Optional | Twitch Developer Client ID (powers /twitch-status, Twitch alerts, and IGDB game lookups). |
TWITCH_CLIENT_SECRET |
Optional | Twitch Developer Client Secret. |
KLIPY_API |
Optional | API key from Klipy for reaction GIFs and search in /gif. |
NEWS_API |
Optional | NewsAPI key for global headline searches in /world-news. |
GENIUS_API |
Optional | Genius API client access token for fetching track lyrics in /lyrics. |
Disable individual bot features without code modifications:
| Variable | Default | Affected Capabilities |
|---|---|---|
LAVA_ENABLED |
true |
Audio engine and all music commands (/play, /queue, etc.). |
GIFS_ENABLED |
true |
Animated reaction GIFs and search (/gif). |
TWITCH_ENABLED |
true |
Twitch live streamer polling notifications and /twitch-status. |
NEWS_ENABLED |
true |
International news headlines command (/world-news). |
IGDB_ENABLED |
true |
Video game database search command (/game-search). |
Every external API utilized by Master-Bot offers a free access tier:
| Service | Portal | Purpose |
|---|---|---|
| Discord | Developer Portal | Bot token, client ID, client secret (mandatory). |
| Spotify | Developer Dashboard | Resolving Spotify playlist/track links to YouTube audio streams. |
| Twitch | Developer Console | Stream monitoring alerts and IGDB game database queries. |
| Google Cloud | Google Cloud Console | OAuth credentials for YouTube live notifications and unthrottled streaming. |
| NewsAPI | NewsAPI Registration | Global news headlines (/world-news). |
| Genius | Genius API Clients | Song lyrics lookup (/lyrics). |
| Klipy | Klipy | Reaction GIFs and animations (/gif). |
- Home — Return to wiki main page
- Getting Started — Prerequisites and initial workspace setup
- Commands Reference — Full breakdown of all slash commands
- Stream Alerts — YouTube and Twitch notification setup
- Deployment — Production self-hosting and container deployment
🏠 Home • 🏗️ Architecture • ⚙️ Configuration • 🎵 Music • 💻 Dashboard • ☁️ Deployment • ❓ FAQ
Master-Bot Documentation • Licensed under MIT • Maintained by galnir and the Master-Bot community
Master-Bot — Unified Discord music, moderation & utility bot with embedded Next.js 15 Web Dashboard, dual PostgreSQL/SQLite fallbacks, and embedded Lavalink v4 Audio.
- 🏠 Home — Project overview & quick start
- ⚡️ Getting Started — Prerequisites, installation & startup
-
⚙️ Configuration — Complete
.envreference & fallbacks
- 🏗️ Architecture — Unified single-process runtime & storage
- 🗄️ Database & Fallbacks — Dual PostgreSQL & SQLite
-
⚡️ Cache & State — External Redis &
ioredis-mock -
📜 Commands Reference — Complete catalog of slash commands &
/setoptions
- 🎵 Music & Audio — Embedded Lavalink v4, filters & playlists
- 🛡️ Moderation — Ban, timeout, slowmode & audit logging
-
🎫 Support Tickets — Thread tickets &
.txttranscripts - 👋 Welcome & Temp Channels — Greetings & dynamic voice hubs
- ⏰ Reminders & Stream Alerts — Scheduled reminders, YouTube & Twitch alerts
- 💻 Web Dashboard — Next.js 15 App Router, tRPC v11 & 9 Studios
- 🚀 Deployment Guide — Docker, Low-Cost VPS & Self-Hosting
- 🛠️ Developer Guide — Creating commands, listeners & features
-
🧪 Testing Suite —
@helix-origin/vitest-suitetesting toolkit - 🛡️ Privacy Policy — Data collection, retention & deletion rights
- 📜 Terms of Service — Service terms, permitted use & liability
- 🔒 Security Policy — Vulnerability reporting, advisories & hardening
- ❓ FAQ & Troubleshooting — Common questions & solutions
- 🤝 Contributing — Contributor guide & commit standards
- 📦 Standalone Audio: HELIX-Origin/Lavalink-Server
- 🧪 Vitest Suite: HELIX-Origin/vitest-suite
- 🤖 GitHub Repository: galnir/Master-Bot