{"id":47979108,"url":"https://github.com/mcbabel/discord-music-bot","last_synced_at":"2026-04-04T11:00:39.361Z","repository":{"id":243751333,"uuid":"813347357","full_name":"MCbabel/discord-music-bot","owner":"MCbabel","description":"🎶 A powerful, feature-rich Discord Music Bot built with Node.js and discord.js v14. Seamless YouTube and Spotify integration with yt-dlp, Genius lyrics, custom playlists, and multi-language support (EN/DE/ES).","archived":false,"fork":false,"pushed_at":"2026-03-22T13:39:35.000Z","size":314,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-04T11:00:02.920Z","etag":null,"topics":["discord-api","discord-bot","discord-js","discord-music-bot","ffmpeg","github-actions","i18n","javascript","lyrics","music-bot","nodejs","open-source","spotify","youtube","yt-dlp"],"latest_commit_sha":null,"homepage":"https://melody-bot.mcbabel.de","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MCbabel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-10T23:01:05.000Z","updated_at":"2026-03-22T13:39:39.000Z","dependencies_parsed_at":"2024-06-11T01:43:55.460Z","dependency_job_id":null,"html_url":"https://github.com/MCbabel/discord-music-bot","commit_stats":null,"previous_names":["mcbabel/discord-music-bot"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/MCbabel/discord-music-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MCbabel%2Fdiscord-music-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MCbabel%2Fdiscord-music-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MCbabel%2Fdiscord-music-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MCbabel%2Fdiscord-music-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MCbabel","download_url":"https://codeload.github.com/MCbabel/discord-music-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MCbabel%2Fdiscord-music-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31397056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord-api","discord-bot","discord-js","discord-music-bot","ffmpeg","github-actions","i18n","javascript","lyrics","music-bot","nodejs","open-source","spotify","youtube","yt-dlp"],"created_at":"2026-04-04T11:00:16.456Z","updated_at":"2026-04-04T11:00:39.350Z","avatar_url":"https://github.com/MCbabel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎶 Discord Music Bot\n\nA feature-rich Discord music bot built with **discord.js v14** and **Node.js**. Supports 9 streaming services including YouTube, Spotify, SoundCloud, Bandcamp, Apple Music, Deezer, and Tidal — plus lyrics fetching via Genius, custom playlists, queue management, and more — all through modern slash commands.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/version-2.3.0-green\" alt=\"Version\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue\" alt=\"License\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/node-18%2B-brightgreen?logo=node.js\" alt=\"Node\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/discord.js-v14-5865F2?logo=discord\u0026logoColor=white\" alt=\"discord.js\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/services-9%20supported-red\" alt=\"9 Services\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/audio-yt--dlp-red\" alt=\"yt-dlp\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/FFmpeg-required-orange?logo=ffmpeg\" alt=\"FFmpeg\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/languages-EN%20%7C%20DE%20%7C%20ES-blueviolet\" alt=\"i18n\" /\u003e\n  \u003cimg src=\"https://img.shields.io/github/stars/MCbabel/discord-music-bot?style=flat\u0026label=stars\u0026color=yellow\" alt=\"GitHub Stars\" /\u003e\n  \u003cimg src=\"https://img.shields.io/github/downloads/MCbabel/discord-music-bot/total?label=downloads\u0026color=brightgreen\" alt=\"GitHub Downloads\" /\u003e\n\u003c/p\u003e\n\n---\n\n## Table of Contents\n\n- [Features](#features)\n- [Commands](#commands)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Running](#running)\n- [YouTube Authentication (cookies.txt)](#youtube-authentication-cookiestxt)\n- [Getting Spotify Credentials](#getting-spotify-credentials)\n- [Getting a Genius API Key](#getting-a-genius-api-key)\n- [Discord Bot Permissions](#discord-bot-permissions)\n- [Tech Stack](#tech-stack)\n- [Project Structure](#project-structure)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n\n- 🎵 **Multi-Service Playback** — Play from YouTube, SoundCloud, Bandcamp, and direct URLs natively via yt-dlp\n- 🟢 **Spotify Integration** — Paste a Spotify track link and the bot resolves it to YouTube for playback\n- 🍎 **Apple Music Support** — Paste an Apple Music track link — metadata is resolved via free API, then played via YouTube\n- 💜 **Deezer Support** — Paste a Deezer track link — metadata is resolved via free API, then played via YouTube\n- 🌊 **Tidal Support** — Paste a Tidal track link — metadata is resolved via free API, then played via YouTube\n- 📻 **Radio \u0026 Direct URLs** — Stream internet radio (Icecast/Shoutcast) or direct audio files (.mp3, .wav, .ogg, .flac, .m4a)\n- � **Lyrics Fetching** — Retrieve song lyrics from the Genius API\n- 📋 **Queue Management** — View, skip, loop, and control the playback queue\n- 🔀 **Song Crossfade** — Smooth transitions between tracks with configurable crossfade duration and pre-buffering\n- 🔊 **Volume Control** — Adjust playback volume from 0–100%\n- 🗳️ **Vote Skip** — Democratic skip voting for shared listening sessions\n- 🎶 **Custom Playlists** — Save and play user-created playlists\n- ⏱️ **Now Playing** — See what's currently playing with track details and source indicator\n- 🤖 **Auto-Disconnect** — Leaves the voice channel after 3 minutes of inactivity\n- 🧹 **Message Cleanup** — Bulk-delete messages with the `/clear` command\n\n### 🎵 Supported Services\n\n| Service | Type | API Key Required |\n|---------|------|-----------------|\n| YouTube | Direct Streaming (yt-dlp) | No |\n| Spotify | Metadata → YouTube | Yes (Client ID + Secret) |\n| SoundCloud | Direct Streaming (yt-dlp) | No |\n| Bandcamp | Direct Streaming (yt-dlp) | No |\n| Apple Music | Metadata → YouTube | No |\n| Deezer | Metadata → YouTube | No |\n| Tidal | Metadata → YouTube | No |\n| Direct URLs | HTTP Stream (.mp3, .wav, etc.) | No |\n| Internet Radio | HTTP Stream | No |\n\n## Commands\n\n### 🎵 Music\n\n| Command | Description |\n|---|---|\n| `/play \u003cquery\u003e` | Play a song by name, URL (YouTube, Spotify, SoundCloud, Bandcamp, Apple Music, Deezer, Tidal), or direct audio link |\n| `/pause` | Pause the current playback |\n| `/resume` | Resume paused playback |\n| `/skip` | Skip the current track |\n| `/stop` | Stop playback and clear the queue |\n| `/queue` | Show the current queue |\n| `/nowplaying` | Show the currently playing track |\n\n### 🔊 Controls\n\n| Command | Description |\n|---|---|\n| `/volume \u003cpercent\u003e` | Set the playback volume (0–100) |\n| `/loop \u003con/off\u003e` | Toggle loop for the current track |\n| `/vote_skip` | Vote to skip the current track |\n\n### 📜 Lyrics\n\n| Command | Description |\n|---|---|\n| `/lyrics` | Fetch lyrics for the currently playing song |\n\n### 🎶 Playlists\n\n| Command | Description |\n|---|---|\n| `/add_to_playlist \u003cname\u003e \u003curl\u003e` | Add a song to a custom playlist |\n| `/play_playlist \u003cname\u003e` | Play a saved playlist |\n| `/list_playlists` | List all saved playlists |\n\n### 🔗 Voice\n\n| Command | Description |\n|---|---|\n| `/join` | Join your voice channel |\n| `/leave` | Leave the voice channel |\n\n### 🧹 Utility\n\n| Command | Description |\n|---|---|\n| `/clear \u003cnumber\u003e` | Delete recent messages (1–100, requires Manage Messages) |\n| `/settings` | Manage server settings (audio, moderation, display) |\n| `/help` | Show all available commands |\n\n## ⚙️ Server Settings\n\nThe bot supports **10 customizable per-server settings** across three categories: **Audio**, **Moderation**, and **Display**. Server admins can fine-tune the bot's behavior using `/settings`.\n\n| Setting | Default | Range |\n|---------|---------|-------|\n| Default Volume | 50% | 1-100 |\n| Max Queue Size | 100 | 10-500 |\n| Inactivity Timeout | 3 min | 30-600s |\n| Max Song Duration | Unlimited | 0-3600s |\n| Crossfade Duration | 0 (off) | 0-10s |\n| Vote Skip Threshold | 50% | 1-100 |\n| DJ Role | None | Any role |\n| Text Channel | Any | Any channel |\n| Voice Channel | Any | Any channel |\n| Embed Color | #8b5cf6 | Any hex |\n\nUse `/settings view` to see current settings, or `/settings audio`, `/settings moderation`, `/settings display` to configure specific categories. Use `/settings reset` to restore defaults. Requires the **Manage Guild** permission.\n\n## Prerequisites\n\nBefore running the bot, make sure you have the following installed:\n\n| Requirement | Details |\n|---|---|\n| **Node.js** | v18.0.0 or higher — [Download](https://nodejs.org/) |\n| **yt-dlp** | Must be installed and available in your system PATH — [Install guide](https://github.com/yt-dlp/yt-dlp#installation) |\n| **FFmpeg** | Auto-bundled via `ffmpeg-static`, but a system install also works — [Download](https://ffmpeg.org/download.html) |\n| **Discord Bot Token** | Create a bot at the [Discord Developer Portal](https://discord.com/developers/applications) |\n| **Spotify API Credentials** | Client ID + Client Secret from the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard) |\n| **Genius API Token** | Client Access Token from [Genius API Clients](https://genius.com/api-clients) |\n\n## Installation\n\n1. **Clone the repository:**\n\n   ```sh\n   git clone https://github.com/MCbabel/discord-music-bot.git\n   cd discord-music-bot\n   ```\n\n2. **Install dependencies:**\n\n   ```sh\n   npm install\n   ```\n\n## Configuration\n\nCreate a `.env` file in the project root with the following required variables:\n\n```env\nDISCORD_TOKEN=your_discord_bot_token\nSPOTIFY_CLIENT_ID=your_spotify_client_id\nSPOTIFY_CLIENT_SECRET=your_spotify_client_secret\nGENIUS_ACCESS_TOKEN=your_genius_access_token\n```\n\n\u003e **Tip:** You can copy the structure above or reference the environment variables in [`src/config.js`](src/config.js) for the full list.\n\nAll four variables are **required** — the bot will exit with an error message if any are missing.\n\n## Running\n\nStart the bot with:\n\n```sh\nnpm start\n```\n\nOr directly:\n\n```sh\nnode src/index.js\n```\n\nFor development with auto-restart on file changes:\n\n```sh\nnpm run dev\n```\n\n## YouTube Authentication (cookies.txt)\n\nSome YouTube videos are age-restricted or region-locked. To access them, you can provide a `cookies.txt` file exported from your browser.\n\n**When is this needed?**\n- Age-restricted videos return errors without authentication\n- Some region-locked content requires a logged-in session\n\n**How to set it up:**\n\n1. See [`cookies.txt.example`](cookies.txt.example) for detailed instructions\n2. Export your YouTube cookies using a browser extension like \"Get cookies.txt LOCALLY\" or via `yt-dlp --cookies-from-browser`\n3. Save the file as `cookies.txt` in the project root\n4. Restart the bot — it will automatically detect and use the cookies\n\n## Getting Spotify Credentials\n\n1. Go to the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard) and log in\n2. Click **Create an App** and fill in the required details\n3. Copy your **Client ID** and **Client Secret** from the app dashboard\n4. Add them to your `.env` file as `SPOTIFY_CLIENT_ID` and `SPOTIFY_CLIENT_SECRET`\n\n## Getting a Genius API Key\n\n1. Go to the [Genius API Clients](https://genius.com/api-clients) page and log in or create an account\n\n   ![Genius API Account](Images/Genius_API_Account.png)\n\n2. Click **Create an API Client** and fill in the app details\n\n   ![Create API Client](Images/Create_API_Client.png)\n\n3. Copy your **Client Access Token**\n\n   ![Retrieve API Key](Images/Retrieve_API_Key.png)\n\n4. Add it to your `.env` file as `GENIUS_ACCESS_TOKEN`\n\n## Discord Bot Permissions\n\nInvite the bot to your server with the necessary permissions using the OAuth2 URL generator in the [Discord Developer Portal](https://discord.com/developers/applications). The bot requires:\n\n- **View Channels** — See text channels\n- **Send Messages** — Respond to commands\n- **Embed Links** — Send rich embed messages\n- **Read Message History** — Context for commands like `/lyrics`\n- **Manage Messages** — Required for the `/clear` command\n- **Connect** — Join voice channels\n- **Speak** — Play audio in voice channels\n- **Use Slash Commands** — Register and respond to slash commands\n\n## Tech Stack\n\n| Technology | Purpose |\n|---|---|\n| [discord.js](https://discord.js.org/) v14 | Discord API framework |\n| [@discordjs/voice](https://github.com/discordjs/discord.js/tree/main/packages/voice) | Voice connection \u0026 audio streaming |\n| [@discordjs/opus](https://github.com/discordjs/opus) | Opus audio encoding |\n| [yt-dlp](https://github.com/yt-dlp/yt-dlp) | YouTube audio extraction (subprocess) |\n| [play-dl](https://github.com/play-dl/play-dl) | YouTube search |\n| [ffmpeg-static](https://github.com/eugeneware/ffmpeg-static) | Bundled FFmpeg binary |\n| [spotify-web-api-node](https://github.com/thelinmichael/spotify-web-api-node) | Spotify metadata → YouTube bridge |\n| [genius-lyrics](https://github.com/zyrouge/genius-lyrics) | Lyrics fetching |\n| [dotenv](https://github.com/motdotla/dotenv) | Environment variable management |\n| [sodium-native](https://github.com/sodium-friends/sodium-native) | Voice encryption |\n\n## Project Structure\n\n```\nsrc/\n├── index.js              # Entry point — client setup, command registration\n├── config.js             # Configuration \u0026 environment variable validation\n├── messages.js           # Discord embed builders (now playing, queue, errors, etc.)\n├── audio/\n│   ├── player.js         # GuildPlayer — per-guild queue \u0026 playback management\n│   ├── resolver.js       # Unified URL/query resolver — auto-detects 9 services\n│   ├── crossfade.js      # Crossfade engine — pre-buffering \u0026 volume transitions\n│   ├── stream.js         # Stream creation for all source types\n│   ├── youtube.js        # yt-dlp integration — search, stream, info extraction\n│   ├── spotify.js        # Spotify → YouTube bridge (resolve track metadata)\n│   ├── applemusic.js     # Apple Music → YouTube bridge (free API)\n│   ├── deezer.js         # Deezer → YouTube bridge (free API)\n│   └── tidal.js          # Tidal → YouTube bridge (free API)\n├── commands/\n│   └── index.js          # All 20 slash command definitions \u0026 handlers\n├── i18n/\n│   ├── index.js          # i18n engine (EN, DE, ES)\n│   └── locales/          # Locale JSON files\n└── services/\n    ├── lyrics.js         # Genius lyrics fetching\n    ├── playlist.js       # Playlist persistence (JSON file storage)\n    └── settings.js       # Per-guild settings management\n```\n\n## Contributing\n\nContributions are welcome! Fork this repository and submit a pull request with your changes. Please make sure any modifications are clearly documented.\n\n## Planned Features\n\n- [x] Lyrics fetching using Genius API\n- [x] Music playback controls via buttons\n- [x] Custom playlists\n- [x] Voting to skip songs\n- [x] Auto-disconnect after inactivity\n- [x] Volume control\n- [x] User-specific playlists\n- [x] Song search functionality\n- [x] Now playing message with song progress\n- [x] Integration with more streaming services (SoundCloud, Bandcamp, Apple Music, Deezer, Tidal, Direct URLs, Radio)\n- [x] Customizable bot settings\n- [x] Song crossfade: Smoothly transition between songs with a configurable crossfade duration.\n- [ ] DJ Mode: Allow certain users to have elevated control over the bot, including song reordering and queue management.\n- [ ] Genre and Mood Playlists: Generate playlists based on specific genres or moods using AI recommendations.\n- [ ] Scheduled Playlists: Schedule specific playlists to play at designated times (e.g., morning playlists or weekend vibes).\n- [ ] Karaoke Mode: Display scrolling lyrics in sync with the song for a karaoke experience.\n- [ ] Advanced Equalizer: Allow users to adjust bass, treble, and other sound settings for a customized listening experience.\n- [ ] Real-time Voting for Upcoming Songs: Users can vote on which song in the queue should play next.\n- [ ] Music Trivia Game: Add a fun music quiz game that users can play in the server.\n- [ ] Save Favorite Tracks: Users can save their favorite tracks and easily access them for future playback.\n\n## License\n\nThis project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for full terms.\n\n---\n\nHappy listening! 🎵\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcbabel%2Fdiscord-music-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcbabel%2Fdiscord-music-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcbabel%2Fdiscord-music-bot/lists"}