Skip to content

A simple Discord music bot that uses yt_dlp to play songs from YouTube.

License

Notifications You must be signed in to change notification settings

MisutaaAsriel/discord-music-bot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quick Navigation

Commands

  • Play: The play command takes a YouTube URL as an argument and plays the song in the voice channel that the bot is connected to.
  • Skip: The skip command skips the current song.
  • Stop: Stops the current playback in the connected channel and disconnects.

Notes

The bot will automatically delete the cached file of a played song after it ends. This is to prevent the file from taking up too much space on the bot's hard drive.

Installation

Intents

Please make sure that the following intents are enabled under Bot settings in the discord developer portal for your application:

  • Presence
  • Server Members
  • Message Content

System Requirements

  • Python 3.11 or newer
  • FFMPEG

Dependencies

To install dependencies, use the following command:

pip install -r requirements.txt

Setup

  1. Set the environment variable DISCORD_TOKEN to your bot token:
DISCORD_TOKEN="your token here"
  1. Run the bot with:
python bot.py

Changelog

  • 1.0.0: Initial release.
  • 1.0.1: Added the ability to skip songs.
  • 1.0.2: Added the ability to delete files after songs end.
  • 1.0.3:
    • Added new stop command & command descriptions
    • Improved YT-DLP options for greater stability.
    • Disabled playlists from attempting to queue everything at once, which breaks the bot.
  • 1.0.4: Added new bot status messages, combined disconnect with stop.
  • 1.0.5:
    • Fixed some race conditions, skip command, and command layout.
    • Added more error handling, & status improvements.

Terms

This script is for educational purposes only. Use it at your own risk. The developer is not responsible for any damage caused by the misuse of this script.

About

A simple Discord music bot that uses yt_dlp to play songs from YouTube.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%