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>).
- Node.js 22.12+
yt-dlpin PATHffmpegin PATHdenoin PATH (required for reliable YouTube extraction)- Discord bot token + application client ID
- Message Content intent enabled in the Discord dev portal (for mention commands)
- Copy
.env.exampleto.envand 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)
- Install dependencies:
npm install- Register slash commands:
npm run register-commands- Run the bot:
npm start- Install runtime deps:
brew install yt-dlp ffmpeg deno- Add the bot to your server (OAuth2 URL with
botandapplications.commandsscopes). - Enable "Message Content Intent" in the Discord portal (for mention commands).
- Register commands and start the bot:
npm run register-commands
npm start- In a voice channel, run:
/play https://www.youtube.com/watch?v=...- or
@Danny the DJ play https://www.youtube.com/shorts/QlKRD2bqTiQ
- 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.
LOG_LEVEL:info(default) ordebugDEFAULT_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 healthchecksHEALTHCHECK_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 videosYTDLP_COOKIES_FROM_BROWSER: browser name/profile for yt-dlp cookie importYTDLP_PROXY: proxy URL passed to yt-dlp for region-locked videosYTDLP_REMOTE_COMPONENTS: e.g.ejs:githubfor YouTube JS challenge solving
docs/SETUP.mdfor a full local setup checklist and troubleshooting notes.docs/PORTAINER.mdfor Portainer deployment steps on an x86_64 NAS.
Build and run the bot with Docker:
docker build -t musicbot .
docker run --env-file .env musicbotOr use Docker Compose:
docker compose up --buildTo pull the published image (GHCR):
docker pull ghcr.io/deanyo/dannythedj:latest
docker run --env-file .env ghcr.io/deanyo/dannythedj:latestTo 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.