Favourites¶
The Favourites cog allows the users to have one playlist without using a database, like the Playlist cog does.
Hint
To enable this cog, set the ENABLE_JSONFAV variable.
Requirements¶
Packages¶
No package is required!
env variables¶
Create a JSON file in
rsc/to store the playlists and set theMUSIC_FAV_LISTvariable with the file’s name. By default, the name isfavourite_songs.json.
How it works¶
As the requirements show, the setup is minimal. The cog stores the playlists in a JSON file, using the following template:
{ "discord_user_id_1": [ { "title": "song_name_1", "url": "song_url_1", "thumbnail": "thumbnail_url_1" }, { "title": "song_name_2", "url": "song_url_2", "thumbnail": "thumbnail_url_2" } ] }
This cog is compatible with the Music cog:
The
nowcommand allows to save the currently playing song to the user’s playlist.The
playcommands allows to play a song directly from the user’s playlist.
See also
The Playlist cog uses a PostgreSQL database to store as many playlists per user as needed.