A simple discord music bot written in Python
Moosic is a bot that born from the passing of groovy. It was a fun challenge to embrace. The bot has been used in some private servers for a while, and although some bugs are still existent, it works!
These are its main features:
- Play a song or a playlist from YouTube or Spotify.
- Basic controls of skipping, pausing, resuming, shuffling, disconnecting, and seeking.
- Basic information about reproduction queue with now playing, and queue.
- Supports three languages: Portuguese, English and Spanish.
This project uses discord.py, spotipy, and youtube-search-python.
- Python3
- Pip (should come installed with Python)
- PostgreSQL
NOTE: ALL DATABASE RELATED STEPS OR SUBSTEPS CAN BE SKIPPED IF YOU WISH NOT TO USE THE DATABASE. SEE STEP 3.
To import the SQL schema:
[postgres] createdb moosic
This will create the database moosic. Then, to import the schema of this project:
$ psql -U postgres -d moosic "database.sql"
You first need to set these enviroment variables in order for this bot to work properly:
- MOO_BOT_KEY : A discord bot application key.
- DATABASE_URL: An url to the PostgreSQL database. It follows a structure similar to "postgresql://user:password@host:port/database"
- SP_CLIENT : Client application key from Spotify.
- SP_SECRET : Secret application key from Spotify.
Once these are set, it's time to fetch the project's dependencies.
python3 -m pip install -r requirements.txt
And it should be enough.
Executing is the easiest step.
python moosic.py
In case you had trouble setting up the database, you might want to execute, instead:
python moosic.py --no-database
However, the language of the bot will only be available in portuguese. Also, MOO_BOT_KEY, SP_CLIENT and SP_SECRET must be existing environment variables. See Step 2.
moosic-bot is licensed under the MIT License.