Skip to content

Repository files navigation

Danny the DJ

CI Docker Publish License

Danny the DJ icon

Discord YT music bot focused on YouTube playback via yt-dlp. Supports single videos, Shorts, and playlist URLs. Commands work as slash commands (/play) or by mentioning the bot (e.g. @Danny the DJ play <url>).

Requirements

  • Node.js 22.12+
  • yt-dlp in PATH
  • ffmpeg in PATH
  • deno in PATH (required for reliable YouTube extraction)
  • Discord bot token + application client ID
  • Message Content intent enabled in the Discord dev portal (for mention commands)

Setup

  1. Copy .env.example to .env and fill in:
    • DISCORD_TOKEN (Bot token from the Discord portal)
    • CLIENT_ID (Application ID)
    • GUILD_ID (optional, for faster command registration in a test server)
  2. Install dependencies:
npm install
  1. Register slash commands:
npm run register-commands
  1. Run the bot:
npm start

Quick Local Test

  1. Install runtime deps:
brew install yt-dlp ffmpeg deno
  1. Add the bot to your server (OAuth2 URL with bot and applications.commands scopes).
  2. Enable "Message Content Intent" in the Discord portal (for mention commands).
  3. Register commands and start the bot:
npm run register-commands
npm start
  1. In a voice channel, run:
    • /play https://www.youtube.com/watch?v=...
    • or @Danny the DJ play https://www.youtube.com/shorts/QlKRD2bqTiQ

Usage

  • Slash commands: /play <url>, /search <query>, /skip, /pause, /resume, /stop, /queue [page], /now, /pump, /lulaye, /about, /debug, /volume
  • Mention commands: @Bot play <url>, @Bot skip, @Bot queue, @Bot volume 80

If you pass text instead of a URL, the bot uses yt-dlp search (ytsearch1:) and queues the first result.

/debug requires Manage Server permissions and responds ephemerally. /volume accepts 0-200 (100 is default). If the voice channel becomes empty, the bot will leave automatically.

Optional Configuration

  • LOG_LEVEL: info (default) or debug
  • DEFAULT_VOLUME: 0-200 (default 100)
  • IDLE_DISCONNECT_SECONDS: idle timeout before leaving voice (default 5)
  • STREAM_START_TIMEOUT_MS: max time to wait for audio to start (default 15000)
  • HEALTHCHECK_PATH: file updated by the bot for container healthchecks
  • HEALTHCHECK_MAX_AGE_SECONDS: max age before healthcheck fails (default 120)
  • PLAYLIST_LIMIT: max tracks to queue from a playlist (default 50, 0 = unlimited)
  • RESOLVE_TIMEOUT_MS: max time to resolve a URL/search (default 20000)
  • SEARCH_TIMEOUT_MS: max time to resolve searches (default 20000)
  • SEARCH_RESULTS_LIMIT: number of results to return for /search (default 5)
  • DEBUG_LOG_CHANNEL_ID: channel ID for error summaries (optional)
  • DEBUG_LOG_THROTTLE_SECONDS: minimum seconds between error summaries (default 60)
  • YTDLP_COOKIES_PATH: path to exported YouTube cookies for age/region/private videos
  • YTDLP_COOKIES_FROM_BROWSER: browser name/profile for yt-dlp cookie import
  • YTDLP_PROXY: proxy URL passed to yt-dlp for region-locked videos
  • YTDLP_REMOTE_COMPONENTS: e.g. ejs:github for YouTube JS challenge solving

Additional Docs

  • docs/SETUP.md for a full local setup checklist and troubleshooting notes.
  • docs/PORTAINER.md for Portainer deployment steps on an x86_64 NAS.

Docker

Build and run the bot with Docker:

docker build -t musicbot .
docker run --env-file .env musicbot

Or use Docker Compose:

docker compose up --build

To pull the published image (GHCR):

docker pull ghcr.io/deanyo/dannythedj:latest
docker run --env-file .env ghcr.io/deanyo/dannythedj:latest

To publish a versioned image, create a git tag like v1.0.0 and push it. GHCR will receive both v1.0.0 and the commit SHA tags automatically.

About

Discord YT Music Bot aka Danny the DJ

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages