Go to file
2022-12-17 18:05:19 +01:00
.github/ISSUE_TEMPLATE 🔧 Add issue templates 2022-12-17 18:05:19 +01:00
img update REAMDE 2020-10-05 23:39:59 +02:00
patches bumb apiclient version 2021-04-18 01:18:15 +02:00
src fix: compile error 2022-12-15 19:54:59 +01:00
.dockerignore extend dockerignore 2020-10-05 23:48:15 +02:00
.eslintrc.json fix lint 2020-09-23 17:06:20 +02:00
.gitignore Refactor: convert to const exports 2022-08-07 18:26:55 +02:00
config.json.example Format code using Prettier 2022-08-07 16:14:24 +02:00
Dockerfile only install production in docker 2020-09-21 05:39:22 +02:00
LICENSE.md Update messages sent to users 2020-09-22 15:37:45 +03:00
package.json bumb apiclient version 2021-04-18 01:18:15 +02:00
parseENV.js Update parseENV.js 2021-10-15 08:04:29 -04:00
README.md Documentation: Add spacing between new and old docs 2022-08-07 21:54:52 +02:00
yarn.lock Format code using Prettier 2022-08-07 16:14:24 +02:00

Jellyfin Logo

Jellyfin Discord Music Bot

A fork of the original project with improved readability and stability, compatible with Jellyfin 10.8.x

Features

  • Simple Discord Bot that hooks into the Jellyfin API of your instance
  • Request, pause and play songs directly from your Discord Server
  • Interactive Media control message to control playback

🦾 About this fork

The original version is decent for Jellyfin 10.6.x and before. After the breaking changes of 10.7 and 10.8, users were unable to stream music from their Jellyfin. For this reason, I made this fork to address those changes to the API and improve the bot with my own ideas / features. Please check out the original project by KGT1.

I will gradually update documentation & code of the bot. Please wait patiently.









Original README from https://github.com/KGT1/jellyfin-discord-music-bot

Jellyfin Discord Music Bot is a Discord Bot for the Jellyfin Media Server!

Capabilities

Play to

Just summon the Bot into your Channel, than choose the Bot in Jellyfin as the Device you want to cast to

Image to Discord Play to Window

and start playing you favourite Music

Interactive Play Message

When you start playing something you can easily controll the Bot with just clicking on the Buttons under the Play Message

Image to Interactive Play Message

Commands

Beware that you'll always need to add your prefix(default: ?) in front of the command.

Command Description
summon Join the channel the author of the message(now you can cast to the Bot from within Jellyfin)
disconnect Disconnect from all current Voice Channels
play Play the following item(can be the name of the song or the Stream URL)
add Add the following item to the current playlist
pause/resume Pause/Resume audio
seek Where to Seek to in seconds or MM:SS
skip Skip this Song
spawn Spawns an Interactive Play Controller
help Display the help message

Limitations

  • No Playlist Repeat Mode.
  • Multi Server support.
  • Playing Video Content (if Discord ever adds this, I'll implement it into this Bot)

Getting Started

You'll need a Discord Application for this Bot to work, as you will host it yourself.

Generate an Api and bot here.

Click New Application.

image

The Name of the application will be the bot's name.

image

Go to the Bot tab.

image

Generate the bot, and grab the token. Also, recommend making the bot private.

image

Go to the OAuth2 page, click Bot Scope to get the url authorization link.

image

Authorize your room!

image

Next, join a voice channel and connect your bot with ?summon. This will connect your bot to the voice channel you're in and will create the device profile in Jellyfin.

Image to Discord Play to Window

From within Jellyfin, start playing content or from within Discord, use the bot commands to start enjoying music!

For official documentation to creating a bot.

How to retrieve your token

How to invite the Bot to your server

The simplest way to get started is using Docker:

docker run -d \
    --name jellyfin-discord-music-bot \
    -e DISCORD_PREFIX="?" \
    -e DISCORD_TOKEN="yourtokengoeshere" \
    -e JELLYFIN_SERVER_ADDRESS="https://jellyfin.DOMAIN" \
    -e JELLYFIN_USERNAME="" \
    -e JELLYFIN_PASSWORD="" \
    -e JELLYFIN_APP_NAME="Jellyfin Discord Music Bot" \
    -e MESSAGE_UPDATE_INTERVAL="2000" \
    --restart unless-stopped \
    kgt1/jellyfin-discord-music-bot

MESSAGE_UPDATE_INTERVAL is the amount of time in ms the play message gets updated with the current time

Alternatively you can run the Application natively with NodeJS:

Dependencies:

  • npm 6.14.6
  • NodeJS v12.18.3
  • ffmpeg 4.2.4
git clone https://github.com/kgt1/jellyfin-discord-music-bot.git
cd jellyfin-discord-music-bot
npm install

edit config.json and add your token,server-address etc.

npm run start

How to build

git clone https://github.com/kgt1/jellyfin-discord-music-bot.git
cd jellyfin-discord-music-bot
docker build -t YOUR_IMAGE_NAME .