forked from solaluset/DandelionMusic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecf523f
commit 92c02c3
Showing
63 changed files
with
35,176 additions
and
1,113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"access_token": "BQB2JOzuo0VLdrdYihd6DWGugf65O0nS18Qmr6_AGXY9wvfrdH_KJQ_4oRpb-7_hy2O8JS7z3ZOrmjzaAQDTogcUNEiTZk0cLiZWHMwHNV2oW6p9u_Fl", "token_type": "Bearer", "expires_in": 3600, "expires_at": 1681772332} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,219 @@ | ||
 | ||
|
||
|
||
# DandelionMusic | ||
A Discord music bot written in Python with support for Youtube, SoundCloud, Spotify, Bandcamp, Twitter, and custom files. | ||
|
||
### Keep in mind: | ||
* The Wiki may have the answer you are looking for https://github.com/Krutyi-4el/DandelionMusic/wiki | ||
* Known problems are listed in Issues. If you are interested in this project feel free to submit an Issue. | ||
|
||
|
||
<h3>What's Coming?</h1> | ||
|
||
- See TODO in Projects tab | ||
|
||
## Prerequisites: | ||
|
||
#### API Keys | ||
* 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) | ||
|
||
#### Requirements (skip this if you've decided to use pre-built exe) | ||
|
||
* Installation of Python 3.8+ | ||
|
||
Install dependencies: | ||
``` | ||
pip install -r requirements.txt | ||
``` | ||
|
||
##### Windows | ||
Download `ffmpeg` and put it into a folder in PATH. | ||
|
||
If ffmpeg is not found, the script will try to download it automatically. | ||
##### Other platforms | ||
Install `ffmpeg` and `libopus` packages. | ||
|
||
### Installing - Self hosting | ||
|
||
1. Download release if available, alternatively download repository zip | ||
2. Complete Prerequisites | ||
3. Start ```run.py``` in project root (or the exe) | ||
4. See configuration options in config.json (more info at https://github.com/Krutyi-4el/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 | ||
|
||
### Docker image | ||
|
||
You can find pre-built Docker image at https://hub.docker.com/repository/docker/krutyi4el/dandelion-music/ | ||
|
||
See https://github.com/Krutyi-4el/DandelionMusic/wiki/Configuration for description of environment variables. | ||
|
||
## Commands: | ||
|
||
### Music | ||
|
||
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 | ||
|
||
#### Playlist Commands | ||
|
||
``` | ||
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 | ||
|
||
#### Audio Commands | ||
|
||
``` | ||
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. | ||
|
||
|
||
### General | ||
|
||
``` | ||
d!settings / d!setting / d!set | ||
``` | ||
* No Arguments: Lists server settings | ||
* Arguments: (setting) (value) | ||
* Use "unset" as an argument to reset a setting | ||
* Example: d!setting start_voice_channel ChannelName | ||
* Administrators 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.config.py | ||
|
||
|
||
### Utility | ||
|
||
``` | ||
d!reset / d!rs | ||
``` | ||
|
||
* Disconnect and reconnect to the voice channel | ||
|
||
``` | ||
d!ping | ||
``` | ||
|
||
* Test bot connectivity | ||
|
||
``` | ||
d!addbot | ||
``` | ||
|
||
* Displays information on how to add the bot to another server of yours. | ||
|
||
## License | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the [GNU General Public License](LICENSE) as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
|
||
## Acknowledgements | ||
|
||
https://github.com/adriansteffan/DiscordJockey |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Netscape HTTP Cookie File | ||
# https://curl.haxx.se/rfc/cookie_spec.html | ||
# More info at https://github.com/Krutyi-4el/DandelionMusic/wiki/Configuration#custom-cookies | ||
# This is a generated file! Do not edit. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
"This file is here to install the selected DB package and jsonc" | ||
"This file is here to automatically install the selected DB package" | ||
import os | ||
import sys | ||
from pathlib import Path | ||
|
||
try: | ||
import tomllib | ||
except ImportError: | ||
import tomli as tomllib | ||
|
||
from setuptools import setup | ||
|
||
from config import Config | ||
# imitate running in root directory | ||
cfg_dir = Path(__file__).parent | ||
for i, path in enumerate(sys.path): | ||
if Path(path).absolute() == cfg_dir: | ||
sys.path[i] = str(cfg_dir.parent) | ||
|
||
# inform that we're in installation phase | ||
os.environ["DANDELION_INSTALLING"] = "1" | ||
|
||
def main(): | ||
with open("db.txt", "w") as f, open("pyproject.toml", "rb") as t: | ||
print(Config().DATABASE_LIBRARY, file=f) | ||
# reuse jsonc already specified in toml | ||
print(tomllib.load(t)["build-system"]["requires"][-1], file=f) | ||
|
||
setup() | ||
|
||
os.remove("db.txt") | ||
from setuptools import setup | ||
from config.config import DATABASE_LIBRARY | ||
|
||
|
||
main() | ||
setup( | ||
name="MusicBot DB", | ||
install_requires=[DATABASE_LIBRARY], | ||
) |
Binary file not shown.
Oops, something went wrong.