Skip to content

DaniloNicacio/discord-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Discord Music Bot

Discord bot that allows playing YouTube music in a voice channel. The bot accepts commands to add songs to the playlist, play the next song, pause, resume, stop, and leave the voice channel.

The bot uses the discord.py library to communicate with the Discord API and the yt_dlp library to download and convert the audio of YouTube videos to the MP3 format. Additionally, the code uses regular expressions to extract the YouTube video ID from a search query.

The bot maintains a playlist of songs, which is updated with new song requests from users. When the playlist is not empty, the bot plays the next song on the list in a continuous loop until the playlist is empty or the bot is interrupted.

Install

Dependencies

Install the dependencies

pip install discord.py yt_dlp

FFMPEG

FFMPEG is crucial to this bot works, so install it before use the bot If you're using windows, remember to add to Path

Windows:

https://www.ffmpeg.org/download.html#build-windows

MacOS

brew install ffmpeg

Linux (Ubuntu)

sudo apt-get install ffmpeg

Usage

This bot use the "&" prefix but you can easily change it in the code

Available commands

  • &play: adds a song to the playlist and plays it if it's the first song in the list.
  • &pause: pauses the current song.
  • &resume: resumes the current song.
  • &stop: stops the current song and clears the playlist.
  • &leave: makes the bot leave the voice channel.

About

Discord music bot created in python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages