Skip to main content

Welcome to Rosy Music Bot

Rosy is a powerful and easy-to-use Discord music bot built with Discord.js and Distube. This guide will walk you through everything you need to get started.

Prerequisites

Before setting up Rosy Music Bot, make sure you have:
  • Node.js (version 18.17.0 or higher) - Download here
  • npm (normally comes with Node.js)
  • A Discord Application and bot token
  • FFmpeg (included in dependencies, but manual installation may be needed)
The bot uses ffmpeg-static by default, but if you encounter issues, you may need to install FFmpeg manually.

Installation Steps

1. Clone the Repository

git clone https://github.com/GatuzoCXL/Rosy-Music-Bot.git
cd Rosy-Music-Bot

2. Install Dependencies

npm install
After running npm install, you’ll need to make a critical configuration change to fix playback issues. See the Troubleshooting guide for the yt-dlp fix.

3. Configure Environment Variables

Create a .env file in the root directory with the following:
TOKEN=your_discord_token_here
YOUTUBE_API_KEY=your_youtube_api_key
SPOTIFY_CLIENT_ID=your_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
Keep your .env file secure and never commit it to version control. Add it to your .gitignore file.

4. Obtain Required API Keys

Discord Bot Token

  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 bot token

YouTube API Key

  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 and copy the API Key

Spotify API Credentials

  1. Go to Spotify Developer Dashboard
  2. Create a new application
  3. Copy the Client ID and Client Secret

5. Start the Bot

npm start
You should see a message confirming the bot is connected:
¡Bot conectado como [YourBotName]!

First Time Configuration

Invite the Bot to Your Server

See the Inviting Bot guide for detailed instructions on generating an invite link and adding the bot to your server.

Required Permissions

The bot needs the following permissions:
  • Read Messages/View Channels - To see commands
  • Send Messages - To respond to commands
  • Embed Links - To display rich embeds
  • Connect - To join voice channels
  • Speak - To play audio
  • Use Voice Activity - For voice playback

Running Your First Commands

Play a Song

Join a voice channel and type:
r!play the scientist
Or use a direct URL:
r!play https://youtu.be/...
When searching by song name, the bot will show you up to 5 results to choose from. You have 20 seconds to select a song from the menu.

Basic Playback Controls

r!pause      # Pause current playback
r!resume     # Resume playback
r!skip       # Skip to next song
r!stop       # Stop playback and clear queue

Manage the Queue

r!queue      # View the current queue
r!volume 50  # Set volume (0-100)

Get Help

r!help       # Display all available commands

Common Workflows

Playing Multiple Songs

  1. Use r!play to add the first song
  2. Continue using r!play to add more songs to the queue
  3. Use r!queue to see all queued songs
  4. Songs will play automatically in order

Managing Playback

  1. Join a voice channel before using commands
  2. Use r!pause if you need to pause temporarily
  3. Use r!resume to continue
  4. Use r!skip to jump to the next song
  5. Use r!stop to end the session and clear the queue

Adjusting Audio

r!volume 30  # Lower volume
r!volume 80  # Higher volume
Volume is set per guild (server) and persists during the current session.

Tips for New Users

Search Tips: When searching by name, be specific. Include the artist name for better results:
  • Good: r!play the scientist coldplay
  • Less specific: r!play scientist
Multiple Results: When the bot shows multiple search results, use the dropdown menu to select the correct song. The menu times out after 20 seconds.
Voice Channel: Always join a voice channel before using music commands. The bot will remind you if you forget.
URL Support: The bot supports both YouTube and Spotify URLs. Direct URLs are processed immediately without search.

What’s Next?

Now that you have the basics down, explore:

Getting Help

If you encounter issues:
  1. Check the Troubleshooting guide
  2. Verify all prerequisites are installed correctly
  3. Ensure your .env file has valid credentials
  4. Check the bot’s console logs for error messages
If you see “NO_RESULT” or playback errors, you likely need to apply the yt-dlp fix. See the Troubleshooting guide for the solution.

Build docs developers (and LLMs) love