Jellyfin music bot for Discord. Name courtesy of @thornbill
Requirements related to the Jellyfin server:
- A Jellyfin Server accessible by the bot through its HTTP API
- An API key to the Jellyfin server
- Transcoding audio to
opus
codec be properly setup on the Jellyfin server
Requirements related to the bot server:
- A valid install of
ffmpeg
added to PATH - Python and Poetry
- An internet connection that does not block access to Discord Voice
Important
Due to how Discord voice works, you NEED a stable internet connection on the bot server, or else music might stutter, play fast/slow or otherwise not work properly. The device hosting the bot SHOULD have a hard wired connection to the internet whenever possible. It SHOULD NOT use Wi-fi or powerline adapters. If you don't have a good internet connection, please find somewhere else to host this bot. Since it isn't actually doing any transcoding, basically anything you can install the environment on will run it without problems. The connection to Jellyfin is buffered, so you don't need to worry about internet quality that much.
You will need to show file extensions if you are on Windows.
- Create a copy of
config.yml.example
and name itconfig.yml
, confirm rename the extension if asked. - Create a Discord application and get a bot token and supply it in
config.yml
- Supply your Jellyfin server address in
config.yml
- Create a Jellyfin API key in the dashboard and supply it in
config.yml
- Open a terminal in the bot folder
- run
poetry install
to install dependencies
- Open a terminal in the bot folder
- run
poetry run python3 main.py
to start the bot. You may need to runpoetry run python main.py
if you are on Windows. - press
Ctrl+C
in the terminal window to exit the bot. MacOS uses the same key bind.
It is normal to see these messages in the console. This is caused by a problem in Pycord and will be fixed in a future release of Pycord. Please ignore these warnings.
This list will assume the default prefix of jellychord
. This can be changed in the config.
/jellychord search <term> <type> <when>
Search for a list of items using<term>
. Options for<when>
term:now
stops current track and plays the specified track.next
places the specified track next in the queue.last
is the default behavior, places the specified track at the end of the playlist./jellychord play <term> <type> <when>
Parameters work the same as the above command, except it directly uses the first result returned from the server, instead of asking the user to choose from a list of options/jellychord skip
Skips the current playing track/jellychord nowplaying
Shows the current playing track/jellychord queue
Shows the current playlist/jellychord start
Starts the player and plays the playlist/jellychord pause
Pauses playback/jellychord resume
Resumes playback/jellychord stop
Stops playback and clears the playlist/jellychord shuffle
Shuffles the playlist/jellychord remove <index>
Removes the item at the specified index from the playlist. Index starts with 1./jellychord clear
Clears the queue for the current Discord server./jellychord promote <index>
Promotes the item at the specified index from the playlist to the front. Index starts with 1./jellychord demote <index>
Demotes the item at the specified index from the playlist to the back. Index starts with 1./jellychord playnow <index>
Skips the current playing track and play the specified index from the playlist. Index starts with 1. This does NOT discard tracks before the specified index. How this works is promote the specified index then skip the current track.
Intend to fix: All fixed, report issues here
Framework Limitation:
- Stage channels might be broken
I don't need myself but you are welcome to send PRs:
- Playlists (I don't have playlists on my server)
- Login as Jellyfin user instead of using apikey