A Discord music bot written in Python with support for Youtube, SoundCloud, Spotify, Bandcamp, Twitter, and custom files.
- The Wiki may have the answer you are looking for https://github.com/solaluset/DandelionMusic/wiki
- Known problems are listed in Issues. If you are interested in this project feel free to submit an Issue.
- See TODO in Projects tab
- Discord - https://discord.com/developers
- Spotify (optional) - https://developer.spotify.com/dashboard/
- Client ID
- Client Secret
- Note: Limited to 50 playlist items without API
Obtained keys must be entered into config.json
(or set as environment variables)
- Installation of Python 3.9+
Install dependencies:
pip install -r requirements.txt
Download ffmpeg
and put it into a folder in PATH.
If ffmpeg is not found, the script will try to download it automatically.
Install ffmpeg
and libopus
packages.
- Download release if available, alternatively download repository zip
- Complete Prerequisites
- Start
run.py
in project root (or the exe) - See configuration options in config.json (more info at https://github.com/solaluset/DandelionMusic/wiki/Configuration)
Button play plugin:
- Set emoji with the setting command to enable this feature
- Emote must be available for bot
- Needs Manage Message permissions
Custom Cookies:
- Extract cookies.txt from you browser using your preferred method
- Overwrite the existing cookies.txt in /config/cookies/
- (Optional) Set a custom cookies.txt location by modifying COOKIE_PATH in config.py
You can find pre-built Docker image at https://hub.docker.com/repository/docker/solaluset/dandelion-music/
See https://github.com/solaluset/DandelionMusic/wiki/Configuration for description of environment variables.
After the bot has joined your server, use d!help
to display help and command information.
d!p [link/video title/key words/playlist-link/soundcloud link/spotify link/bandcamp link/twitter link]
- Plays the audio of supported website
- A link to the video (https://ww...)
- The title of a video ex. (Gennifer Flowers - Fever Dolls)
- A link to a YouTube playlist
- If a song is playing, it will be added to queue
d!skip / d!s
- Skips the current song and plays next in queue.
d!q
- Show the list of songs in queue
d!shuffle / d!sh
- Shuffle the queue
d!l / d!loop [all/single/off]
- Loops the entire queue by default.
d!loop single
loops current track.
d!mv / d!move
- Move song position in queue
d!pause
- Pauses the current song.
d!resume
- Resumes the paused song.
d!prev
- Goes back one song and plays the last song again.
d!np
- Shows more details about the current song.
d!volume / d!vol
- Adjust the volume 1-100%
- Pass no arguments for current volume
d!remove / d!rm
- Removes a song from the queue (defaults to last song)
d!stop / d!st
- Stops the current song and clears the playqueue.
d!settings / d!setting / d!set
- No Arguments: Lists server settings
- Arguments: (setting) (value)
- Omit the value to reset a setting
- Example: d!setting start_voice_channel ChannelName
- Administrators and DJs only
d!c
- Connects the bot to the user's voice channel
d!dc
- Disconnects the bot from the current voice channel
d!history
- Shows you the titles of the X last played songs. Configurable in config.json
d!reset / d!rs
- Resets the player. May recover the bot after unexpected problems.
d!ping
- Test bot connectivity
d!addbot
- Displays information on how to add the bot to another server of yours.
d!shutdown
- Stops the bot completely. May be useful after you move the bot to background. Works only for bot owner.
- Note that unlike other commands, this one doesn't have a slash variant. This allows it to be hidden.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.