Skip to content

EnchantressKay/KMusicBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YouTube Discord Bot

A powerful Discord bot built with Node.js that plays and searches YouTube videos in voice channels with queue support.

Features

  • YouTube Search: Search for songs directly by name.
  • Queue System: Add multiple songs to a queue.
  • Skip Support: Skip the current track to the next one in queue.
  • Per-Server Management: Separate queues for different Discord servers.

Prerequisites

  1. Node.js: Ensure you have Node.js 20+ installed.
  2. Discord Bot Token: Create a bot on the Discord Developer Portal.
    • Enable Message Content Intent, Server Members Intent, and Presence Intent in the "Bot" section.
    • Give the bot permissions to join and speak in voice channels.

Setup

  1. Clone this repository.
  2. Install dependencies:
    npm install
  3. Copy .env.example to .env:
    cp .env.example .env
  4. Fill in your DISCORD_TOKEN and optionally a DEFAULT_VOLUME (between 0.0 and 1.0, where 0.1 is 10%) in the .env file.

Usage

  1. Run the bot:
    node index.js
  2. In Discord, join a voice channel.
  3. Use the following commands:
    • !play <URL or Search Terms>: Searches and plays the audio. Adds to queue if something is already playing.
    • !skip: Skips the current song.
    • !queue: Shows the current list of songs in the queue.
    • !stop: Stops playback and clears the queue.
    • !leave: Makes the bot leave the voice channel.

Dependencies

  • discord.js: To interact with the Discord API.
  • @discordjs/voice: For voice channel support.
  • play-dl: To fetch, search, and stream YouTube audio.
  • dotenv: To manage environment variables.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors