Skip to content
ย 
ย 

Latest commit

ย 

History

2,225 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– Master-Bot

TypeScript Node.js pnpm Lavalink License: MIT PRs Welcome

Master-Bot is a production-ready, high-performance Discord Music and Utility Bot with a full-featured Next.js Web Dashboard. Built with TypeScript, Sapphire Framework, discord.js v14, Next.js 15, tRPC v11, Prisma ORM (SQLite), ioredis-mock (zero external Redis binaries needed), and Lavalink v4.


๐Ÿš€ Deployment

Master-Bot runs as a single Node.js process hosting the Discord bot and the Next.js dashboard โ€” locally, on a VPS, or via Docker. Music requires a Lavalink v4 server running externally on a Lavalink server you host yourself (Docker/VPS/Local). See the Deployment Wiki.

๐Ÿ  Self-host only: managed cloud platforms are intentionally not supported. Their OAuth/domain allowlists block fresh cloud subdomains (breaking dashboard login), and their paid tiers are a poor fit for an open-source bot. See the Deployment Wiki for the rationale.

Platform Notes
Docker / VPS Recommended. Dockerfile + docker-compose.yml run bot + dashboard and Lavalink in separate containers with persistent storage. Full guide in the Deployment Wiki.
Local pnpm install && pnpm build && pnpm start on any Node.js 20+ machine โ€” see Quick Start.

๐Ÿ’ก Audio Engine: Master-Bot runs its bot + dashboard in a single Node process and connects to a separate Lavalink v4 server (self-hosted via Docker or dedicated VPS). Set LAVA_ENABLED=true to enable music; set it to false to run without music while your Lavalink is offline.

๐ŸŒ Recommended Low-Cost Compatible VPS Providers

Provider Starting Price Key Benefits Recommended Plan
Hetzner Cloud ~โ‚ฌ3.79 / mo High performance, fast NVMe, EU/US locations CX22 (2 vCPU, 4 GB RAM) / CAX11
OVHcloud ~$4.20 / mo Unmetered bandwidth, strong anti-DDoS protection Starter / Value VPS
DigitalOcean ~$4.00 - $6.00 / mo 1-Click Docker droplets, low network latency Basic Droplet (1-2 GB RAM)
Linode (Akamai) ~$5.00 / mo High network reliability, 24/7 support Nanode 1GB / Shared 2GB
Vultr ~$3.50 - $5.00 / mo 30+ worldwide datacenters, fast provisioning Cloud Compute (1-2 GB RAM)

๐Ÿ—๏ธ Project Architecture & Structure

Master-Bot is organized as a unified Turborepo workspace managed with pnpm:

Master-Bot/
โ”œโ”€โ”€ apps/
โ”‚   โ”œโ”€โ”€ bot/                 # Sapphire & Discord.js v14 Bot Application + Internal Web Server
โ”‚   โ””โ”€โ”€ dashboard/           # Next.js 15 Web Dashboard (Tailwind CSS, NextAuth, tRPC)
โ”œโ”€โ”€ packages/
โ”‚   โ”œโ”€โ”€ auth/                # Shared NextAuth.js (Discord OAuth) Configuration
โ”‚   โ”œโ”€โ”€ config/              # Shared Tooling Config (eslint/, tailwind/)
โ”‚   โ””โ”€โ”€ db/                  # Shared Prisma ORM Client (SQLite) & In-Memory Redis (ioredis-mock)
โ”œโ”€โ”€ wiki/                    # Complete Project Documentation & Deployment Guides
โ”œโ”€โ”€ packages/db/prisma/       # Prisma schema + db.sqlite (auto-created on install)
โ”œโ”€โ”€ application.yml.example  # Lavalink v4 Configuration Template (copy to application.yml)
โ”œโ”€โ”€ Dockerfile               # Containerized single-service deployment
โ””โ”€โ”€ docker-compose.yml       # Bot + Lavalink containers for VPS self-hosting

๐Ÿ”„ Consolidated Runtime: Master-Bot runs both the Discord bot gateway and the Next.js web dashboard inside a single Node.js process on port PORT (/dashboard), with a single console window and zero external Redis dependencies. For full deployment details, follow the Deployment Wiki.


โšก Key Features

  • ๐ŸŽต High-Performance Audio Engine: Powered by Lavalink v4 with support for YouTube (multi-client + OAuth), Spotify metadata resolution (lavasrc-plugin), free built-in SoundCloud, Twitch, Vimeo, and direct audio streams. Includes interactive channel player embeds with real-time progress bars and audio filters (/bassboost, /karaoke, /nightcore, /vaporwave).
  • ๐Ÿ“š Custom Playlists: Per-user, per-server playlists via /create-playlist, /save-to-playlist, /my-playlists, /display-playlist, /delete-playlist, and /remove-from-playlist.
  • ๐Ÿ”จ Full Moderation Suite: Dedicated slash commands (/ban, /kick, /slowmode, /timeout, /purge) with permission hierarchy validation and safety checks.
  • ๐ŸŽซ Thread-Based Support Ticket System: Interactive ticket panel, thread management, a configurable manager role, and .txt transcript archiving.
  • ๐Ÿ“œ Granular Audit Logging: 20 event triggers across members, messages, channels, roles, voice, and moderation โ€” tuned per server via /set or the dashboard.
  • ๐Ÿ—„๏ธ Zero-Ops Database: SQLite via Prisma. The schema is generated and pushed automatically on pnpm install; no database server to install or manage.
  • ๐Ÿ”‘ Native YouTube Device-Flow OAuth: /youtube-auth authorizes a streaming account; the refresh token persists to .youtube-oauth.json without rewriting .env.
  • ๐ŸŒ Interactive Web Dashboard: Next.js 15 App Router command center โ€” per-server studios for welcome messages, audit logs, tickets, reminders, per-command toggles, music, broadcasts, integrations, and system telemetry.
  • ๐ŸŽฏ Feature Flags: Individual bot modules (Lavalink audio, GIFs, Twitch, News, IGDB) can be enabled or disabled via environment variables.
  • ๐Ÿš€ Cross-Platform Unified Launchers: pnpm dev and pnpm start manage ports, route output to isolated log files (logs/), and present a clean console status UI.
  • ๐Ÿ–ผ๏ธ Reaction GIFs & Media: Powered by Klipy API and Waifu.im (/gif, /hug, /waifu, /cat, /doggo, and more).
  • ๐ŸŽฎ Gaming & Info: Live Twitch channel alerts, IGDB game search, TVMaze TV show info, and a suite of fun utilities (/8ball, /urban, /trump, /kanye, /translate, and more).

๐Ÿ“‹ System Requirements

  • Node.js: 24.x LTS recommended (>=20.0.0 supported)
  • pnpm: >=8.0.0 (npm install -g pnpm)
  • Java: Java 17+ (21 LTS recommended) โ€” required only to self-host a Lavalink server (locally or via Docker/VPS).
  • Database: None โ€” SQLite file (db.sqlite) is created automatically

๐Ÿš€ Quick Start Guide

1. Clone & Install Dependencies

git clone https://github.com/galnir/Master-Bot.git
cd Master-Bot
pnpm install

pnpm install generates the Prisma client and creates the SQLite database (db.sqlite).

2. Configure Environment Variables

Create .env in the workspace root from .env.example:

cp .env.example .env

Fill in your mandatory credentials:

  • DATABASE_URL: SQLite database file path (file:./db.sqlite)
  • INTERNAL_URL: Internal SSR dashboard URL (http://localhost:3000)
  • PUBLIC_URL: Public HTTPS dashboard URL (https://your-domain.com)
  • DISCORD_CALLBACK_URL: Public OAuth2 bot invite URL
  • DISCORD_TOKEN: Bot token from the Discord Developer Portal
  • DISCORD_CLIENT_ID & DISCORD_CLIENT_SECRET: Application OAuth2 credentials

Optional audio/feature keys (Spotify, YouTube, Twitch, News, Genius, Klipy) and the LAVA_* + feature-flag variables are documented in the Configuration Wiki.

3. Run the Stack

pnpm dev

Starts the bot, dashboard, and (when LAVA_ENABLED=true and Java is present) a local Lavalink server with a unified status console and logs/. For production: pnpm build && pnpm start.


๐ŸŽต YouTube OAuth Setup

  1. Run /youtube-auth in Discord (or the terminal device-flow prompt at first launch).
  2. Open the returned URL, log in with the YouTube account you want to stream through, and approve the scopes.
  3. The bot stores the refresh token atomically in .youtube-oauth.json and keeps a YOUTUBE_REFRESH_TOKEN binding for Lavalink.

Authorized playback defeats YouTube throttling/blocking. See Music & Lavalink.


๐Ÿ“– Available Commands

Master-Bot ships with 74 slash commands across Music, Moderation, GIFs, Games, Utilities, News, and Reminders. For the complete, up-to-date list and the /set subcommands, see the Commands Reference.

Category Highlights
๐ŸŽต Music /play, /queue, /shuffle, /jump, /seek, /volume, /lyrics, /bassboost, /music-trivia, playlists, /youtube-auth
๐Ÿ”จ Moderation /ban, /kick, /timeout, /slowmode, /purge
โš™๏ธ Utility /set, /help, /reminder, /poll, /weather, /translate, /world-news, /8ball, /reddit, /urban
๐ŸŽฎ Games /connect-four, /tic-tac-toe, /rockpaperscissors, /game-search
๐Ÿ˜‚ GIFs /gif, /hug, /waifu, /cat, /doggo, /slap, and more
๐ŸŸฃ Twitch /twitch-status + live stream alerts via /set twitch

๐Ÿณ Docker Deployment

A portable Dockerfile (node:20-slim, port 3000) is included. For single-service container deployment and persistence guidance, see Deployment Wiki.


๐Ÿ“š Documentation & Wiki

Visit the Wiki for full documentation:


๐Ÿ‘ฅ Contributors โค๏ธ

โญ Bacon Fixation โ€” countless contributions across the project.

Contributor Contributions
ModoSN resolve-ip, rps, 8ball, bored, trump, advice, kanye, urban dictionary commands and visual updates
PhantomNimbi GIF commands, Lavalink v4 engine, Next.js 15 migration, moderation suite, support ticket system, live ASCII progress bar & auto-updater
rafaeldamasceno music-trivia and Dockerfile improvements
navidmafi LeaveTimeOut and MaxResponseTime options, update issue template, fix leave command
Kyoyo brought back now-playing
MontejoJorge brought back remind
malokdev uptime command
chimaerra minor command tweaks

๐Ÿค Contributing

We welcome contributions of all kinds! Please read our Contributing Guidelines to get started with local setup, coding standards, and pull request workflows.


๐Ÿ“„ License

Distributed under the MIT License. See LICENSE.md for more information.

About

A Discord music bot and dashboard with slash commands, playlist support, Spotify, music quiz, saved playlists, lyrics, gifs and more

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages