Skip to main content

Prerequisites

Before installing Rosy Music Bot, ensure you have the following:

Node.js

Version 18.17.0 or higher

Discord Bot Token

Create a bot at Discord Developer Portal

YouTube API Key

Spotify API Credentials

Client ID and Secret from Spotify Dashboard
FFmpeg is included via the ffmpeg-static dependency, but you can install it manually if needed.

Installation

1

Clone the Repository

Clone the Rosy Music Bot repository to your local machine:
git clone https://github.com/GatuzoCXL/Rosy-Music-Bot.git
cd Rosy-Music-Bot
2

Install Dependencies

Install all required npm packages:
npm install
This will install:
  • discord.js v14.25.1
  • distube v5.2.3
  • @distube/spotify v2.0.2
  • @distube/yt-dlp v2.0.1
  • play-dl v1.9.7
  • And other required dependencies
3

Configure Environment Variables

Create a .env file in the root directory with your API credentials:
.env
TOKEN=your_discord_bot_token
YOUTUBE_API_KEY=your_youtube_api_key
SPOTIFY_CLIENT_ID=your_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
  1. Go to Discord Developer Portal
  2. Create a new application or select an existing one
  3. Navigate to the “Bot” section
  4. Copy the token (click “Reset Token” if needed)
  5. Enable “Message Content Intent” under Privileged Gateway Intents
  1. Go to Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the YouTube Data API v3
  4. Create credentials (API Key)
  5. Copy the API key
  1. Go to Spotify Developer Dashboard
  2. Create a new application
  3. Copy the Client ID
  4. Click “Show Client Secret” and copy it
Never share your .env file or commit it to version control. Keep your tokens and API keys secure.
4

Apply Critical Fix (Required)

After installing dependencies, you need to fix a known issue with yt-dlp:
This step is critical for the bot to work correctly. Without it, music playback will fail.
Open node_modules/@distube/yt-dlp/dist/index.js and find lines containing noCallHome: true (approximately lines 147 and 177).Comment them out:
// noCallHome: true,
This parameter causes playback errors and must be disabled.
5

Start the Bot

Run the bot using npm:
npm start
You should see output similar to:
[SUCCESS] ¡Bot conectado como RosyMusicBot#1234!
The bot will set its presence to “Listening to r!help 🎶”
6

Invite Bot to Your Server

Generate an invite link from the Discord Developer Portal:
  1. Go to your application in the Developer Portal
  2. Navigate to OAuth2 > URL Generator
  3. Select scopes: bot, applications.commands
  4. Select bot permissions:
    • Read Messages/View Channels
    • Send Messages
    • Embed Links
    • Connect
    • Speak
  5. Copy the generated URL and open it to invite the bot

Your First Command

Once the bot is running and invited to your server:
1

Join a Voice Channel

Connect to any voice channel in your Discord server.
2

Play a Song

In any text channel, use the play command:
r!play the scientist
The bot will:
  1. Search YouTube for “the scientist”
  2. Show you up to 5 results in a dropdown menu
  3. Wait for you to select a song (20 seconds)
  4. Join your voice channel and start playing
3

Try Other Commands

Explore more commands:
r!help      # View all available commands
r!queue     # See the current queue
r!status    # Check bot status and permissions
r!volume 75 # Set volume to 75%
r!skip      # Skip to the next song

Example Usage

r!play coldplay the scientist
# Bot searches YouTube and shows 5 results to choose from

Troubleshooting

This is usually caused by the noCallHome: true parameter in yt-dlp.Solution:
  1. Navigate to node_modules/@distube/yt-dlp/dist/index.js
  2. Find lines with noCallHome: true (around lines 147 and 177)
  3. Comment them out: // noCallHome: true,
  4. Restart the bot with npm start
If you encounter FFmpeg-related errors:Verify FFmpeg installation:
ffmpeg -version
Install manually if needed:Windows (using Chocolatey):
choco install ffmpeg
Linux:
sudo apt update
sudo apt install ffmpeg
macOS:
brew install ffmpeg
  • Verify the prefix is r! (configured in config.js)
  • Check that “Message Content Intent” is enabled in Discord Developer Portal
  • Ensure the bot has proper permissions in the server
  • Verify the TOKEN in .env is correct
The bot needs these permissions:
  • Read Messages/View Channels
  • Send Messages
  • Embed Links
  • Connect (to voice channels)
  • Speak (in voice channels)
Check permissions with:
r!status
The bot logs all activity to the console. Check the logs if you encounter issues.

Next Steps

Commands Reference

Learn about all available commands and their usage

Configuration

Customize the bot prefix, presence, and other settings

Architecture

Understand how the bot is built and structured

Troubleshooting

Detailed solutions for common issues

Build docs developers (and LLMs) love