Subcordant is a Discord bot that streams music from your Subsonic-API compatible server.
/play- takes asubsonicidparameter. Connects the bot to the voice channel currently occupied by the command issuer, if it is not yet connected. Enqueues all tracks from the specified album, playlist or track and initates playback, if not already playing. If the bot is already present in a different voice channel, playback will stop, the current playlist will be cleared and the bot will join the new channel/albumtrack- takes analbumidparameter andtracknumberparameter. Behaves the same as the/playcommand, but instead targets a single track from the specified album/track number combination/trackname- takes atracknameparameter. Behaves the same as thealbumtrackcommand, but instead takes the track name/albumname- takes analbumnameparameter. Behaves the same as thealbumtrackcommand, but instead takes the album name/clear- clears the playlist and stops playback/disconnect- disconnects the subcordant bot, stopping playback and clearing the playlist/skip- skips the currently playing song/help- describes all commands
Depending on your operating system, run either libdave_install.sh or libdave_install.ps1. For more info see the docs.
Run make build.
- FFmpeg must be installed and available on your path
- Create a Discord bot
Run the executable, specifying the following environment variables:
- SUBSONIC_URL
- SUBSONIC_USER
- SUBSONIC_PASSWORD
- DISCORD_BOT_TOKEN
The following flags are available:
streamFrom- valid values arestreamorfile, defaults tostreamif not specified. Subcordant will stream to the voice chat using:stream- the Subsonic/streamendpointfile- the file path returned from thepathfield on the song. This mode will only work if subcordant has access to the audio library folder, and that the API returns the actual absolute path of the song. For Navidrome, an admin can toggle to allow the subcordant player toReport Real Path, or use the Subsonic.DefaultReportRealPath configuration option. Consult your server's documentation for more information.
idleDisconnectTimeout- duration in minutes after which bot will disconnect when no music is playing. Defaults to 5 if not specified.
These instructions are for installing subcordant as a systemd unit on Linux. This enables subcordant to run on machine startup.
- Run
make buildor download a binary from the releases page - Create a directory at
/opt/subcordant - Add your subcordant executable to this path
- Run
chmod +x /opt/subcordant/subcordant - Run
groupadd subcordant - Run
useradd -m -g subcordant subcordant - Run
chown subcordant:subcordant /opt/subcordant - Run
vim /etc/systemd/system/subcordant.serviceand copy the contents of docs/subcordant.service into the file, replacing all the environment variable instances offoobarwith your values. - Run
systemctl daemon-reload - Run
systemctl start subcordant.service - Run
systemctl status subcordant.service
Please see the Issues associated with this repo to help contribute.
Run make run-tests.
Subcordant makes use of the following: