A modular Discord music bot written in Python using discord.py.
This bot supports music playback, queue and playlist management, and more.
- Play music from supported sources, also with a normal search, instead of a link
- Queue, history, and playlist management
- Skip, pause, resume, and stop playback
- Autoplay mode using Last.fm (similar tracks, artist top tracks, similar artists)
- Modular command system
This bot uses environment variables for secrets:
-
Create a
.envfile in the root directory. -
Add your Discord token:
- BOT_TOKEN=your_token
-
For spotify, you will have to go to the website and get the spotify client id and secret, then put in the .env like this:
- SPOTIFY_CLIENT_ID=client_id
- SPOTIFY_CLIENT_SECRET=client_secret
-
For Last.fm (required for autoplay feature), get your API credentials from https://www.last.fm/api/account/create and add them to the .env:
- LASTFM_API_KEY=your_api_key
- LASTFM_API_SECRET=your_api_secret
-
Make sure
.envremains in.gitignoreso it is never committed.
- ffmpeg must be installed on your PC. Download from -> https://www.ffmpeg.org/download.html
- Install the libraries in requirements.txt by doing
pip install -r requirements.txt - Execute main.py
This bot is only for personal use