Discord_Music_bot
Discord_Music_bot copied to clipboard
This Is a discord bot made from the latest discord.py module as of March 2021. It will play songs from the directory and even will download from given youtube url and play it for 24/7 and would loop t...
Discord_Music_bot
This is a simple Discord Music bot that plays music 24/7 looping thorugh the available ones in directory. To run this bot we need to several packages such as PyNaCl, discord.py
Installation
Use the package manager pip
To install discord.py
python3 -m pip install -U discord.py
To install PyNaCl
pip install pynacl
To install youtube_dl
pip install youtube_dl
You also need to install FFmpeg API key for song lyrics should be acquired from Genius
Pre-Text:
This is a discord bot made using the lastest discord.py api as of march 2021. This bot plays mp3 file from the storage i.e. all the mp3 files available to play from the file of your bot. I did this program in python language and have used discord.py , youtube_dl , PyNaCl , FFmpeg and several other packages and api's. Initially this bot was build on repl.it IDE and can run for infinite time i.e. it will be online continuously using Uptimerobot
How to Install
-
Create a
pythonvirtual environment.I did in repl.it -
Clone the repo
git clone https://github.com/DivyaKumarBaid/Discord_Music_bot.gitor download the repository. -
Go to the cloned/downloaded directory
cd Discord_Music_bot -
Upload it in
repl.it -
Create a bot in discord developers portal
-
Copy the
Tokenof the bot and paste it in the.envfile asTOKEN -
Run the bot on
repl.it -
Copy the
urlthat appears on the right side of window -
Go to Uptimerobot and create a monitor and paste the copied
urland start the monitor.This will keep the bot alive even after you close it.For more precise steps have a look at FreeCodeCamp
Commands
add This adds a music to the playlist. The url must be of youtube
clear This command clears given number of messages and by default it clears last 5 messages
clear_playlist This command removes every available mp3 file
join This adds bot to the given channel and by default in General
play This command plays song from the available ones.Providing channel would let the bot run there else by default it will run in General
remove This command removes the specified .mp3 file
songs This command lists all the songs available to play
stop This stops the music playing and the bot leaves the voice channel
lyrics This displays the lyrics for the current playing song
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.