Skip to content

Discord (App)

This scrobbler uses Now Playing functionality to set your Discord Rich Presence to the music you are currently monitoring with multi-scrobbler.

This integration uses an existing Discord application to set your Rich Presence.

You must create a Discord App in order to use this integration. Creating an App is free and simple.

Go to the Discord Developer Portal

  • Click on “New Application” and give it a name
  • Copy the Application Id (Client Id) shown after creation
  • Add this Id to your Multi-Scrobbler config
    • Env Config => DISCORD_APPLICATION_ID=12345678
    • File Config => "applicationId": "12345678"

This integration uses an existing, running Discord application to communicate with Discord and set Rich Presence. Multi-scrobbler must be able to communicate with the Discord application, either by being on the same machine or over a network.

Kasm Workspaces provides a self-hostable Discord container image. This image provides a desktop-like experience, through browser-based VNC, to use the official Discord application.

This containerized approach can be used instead of configuring MS to use a Native Discord application on a specific machine.

Advantages

  • Setup is much simpler
    • Discord runs in the same stack as multi-scrobbler
    • Configuration is copy-paste. Skip all of the Discord Connection instructions.
  • Get a Headless-like experience without needing to break Discord TOS

Disadvantages

  • Image only available for x86 arch
  • Image and container are large (1GB+)
  • Discord does not notify other clients of notifications in a channel if any client is viewing that channel.
    • To avoid this, make sure your container discord instance is not viewing any server/channel/dm.
  • Sometimes, Discord does not deliver “notifications you missed” to mobile because this depends on all clients being offline.

Setup

Setup is basically the same as using the instructions for Discord on Linux with MS on Same Host (Docker).

1. Add Discord Service to Multi-Scrobbler Docker Compose Stack

Detailed Explanation
  • Add the kasmweb/discord service to your compose stack
    • Mount the directory containing Discord’s unix socket to a named volume
  • Configure MS to use Discord’s unix socket
    • Mount the unix socket volume into MS’s container
    • Add ENV DISCORD_IPC_LOCATIONS to point to the mounted volume

Use this example docker-compose.yaml to modify your existing multi-scrobbler docker-compose.yaml:

Example
docker-compose.yaml
services:
multi-scrobbler:
image: foxxmd/multi-scrobbler:latest
environment:
# ...
- DISCORD_APPLICATION_ID=12345678
# add below line
- DISCORD_IPC_LOCATIONS=/run/discord-ipc-0
volumes:
# ...
# add below line
- kasm_run:/run
# ...
# .. add discord service below
kasmcord:
container_name: kasmcord
image: kasmweb/discord:1.19.0
ports:
# VNC port to use in web browser
- 6901:6901
shm_size: 512m
environment:
# set a password for VNC access
VNC_PW: hunter2
XDG_RUNTIME_DIR: /run/user/1000
volumes:
- kasm_run:/run/user/1000
- kasm_config:/home/kasm-user/.config
user: "0"
entrypoint: >
sh -c "chmod 700 /run/user/1000 &&
chown -R kasm-user:kasm-user /run/user/1000 &&
chown -R kasm-user:kasm-user /home/kasm-user/.config &&
sed -i 's|/usr/share/discord/Discord|/usr/bin/discord|g' /dockerstartup/custom_startup.sh &&
su kasm-user -c '/dockerstartup/kasm_default_profile.sh /dockerstartup/vnc_startup.sh /dockerstartup/kasm_startup.sh'"
volumes:
kasm_run:
name: kasm_run
kasm_config:
name: kasm_config

Then re-deploy your stack.

2. Login to Discord

Navigate in your browser to the IP/host Multi-Scrobbler/Discord are running on. Use the port set in the kasmcord service:

# basic auth login
# user: kasm_user
# pass is what was set in env VNC_PW
https://192.168.MY.HOST:6901

Login to Discord normally. After login is complete MS should connect automatically when a Now Playing event happens. If it does not or reports authentication failure then restart MS (but not Discord).

If MS works then you are done and can move on to Optional Setup.

Multi-scrobbler can display Album Art in your Discord status. The image that is used differs based on if the image URL is publically accessible.

The order in which multi-scrobbler determines what image to use is the same as the order of the tabs shown below.

MS can use external URLs for artwork.

External URLs that are not from known music services are disabled by default. This is to preserve your privacy because Discord does not host images, it only links to them and the URL is visible to other users.

Why Should I Care?

There are some scenarios where you may not want your artwork URLs to be visible, for example:

  • A Source may be accessible only on your LAN (Jellyfin at http://192.168.0.101)
  • A Source may be internet-facing but you do not want to expose this information to discord/other users
  • A Source may be internet-facing but requires authentication to view the image

MS will use your artwork URLs only if:

  • artwork url is from a known music service/Cover Art Archive or
  • artwork url starts with https and
    • artwork (DISCORD_ARTWORK) is
    • true => always uses the url
    • a list of custom domains keywords an external artwork url should contain EX
      • ENV => DISCORD_ARTWORK=mycdn,jellyfin
      • File Config => "artwork": ["mycdn","jellyfin"]
Examples

None of the below URLs will ever be used because they are not https

http://foobar.com/cool.jpg (Error: not used)Errornot used1
http://192.168.0.112/fun.png (Error: not used)Errornot used2
  • Line 1, error: not used
  • Line 2, error: not used
  1. 1.NOT allowed, not http
  2. 2.NOT allowed, not http

When DISCORD_ARTWORK is not set:

https://archive.org/download/dir/myimage.jpg1
https://spotify.com/assets/cover.png?size=10002
https://example.com/cool.jpg (Error: not used)Errornot used3
https://anything.com/neat.jpg (Error: not used)Errornot used4
  • Line 3, error: not used
  • Line 4, error: not used
  1. 1.allowed, is https and known service
  2. 2.allowed, is https and known service
  3. 3.NOT allowed, is https but not a known service and DISCORD_ARTWORK is not set
  4. 4.NOT allowed, is https but not a known service and DISCORD_ARTWORK is not set

Setting DISCORD_ARTWORK=true

https://archive.org/my/dir/myimage.jpg1
http://foobar.com/cool.jpg (Error: not used)Errornot used2
https://example.com/cool.jpg3
https://anything.com/neat.jpg4
  • Line 2, error: not used
  1. 1.allowed, is https and known service
  2. 2.NOT allowed, not http
  3. 3.allowed, is https
  4. 4.allowed, is https

Setting DISCORD_ARTWORK=mycdn,jellyfin

https://archive.org/my/dir/myimage.jpg1
http://foobar.com/cool.jpg (Error: not used)Errornot used2
https://example.com/cool.jpg (Error: not used)Errornot used3
https://jellyfin.mydomain.com/neat.jpg4
  • Line 2, error: not used
  • Line 3, error: not used
  1. 1.allowed, is https and known service
  2. 2.NOT allowed, not http
  3. 3.NOT allowed, is https but does not contain "mycdn" or "jellyfin"
  4. 4.allowed, is https and contains "jellyfin"

Configuration Type

This is configuration for the ENV Config Type.

Environmental Variable Type Default Description
DISCORD_ID string A globally unique ID EX myComponentId
DISCORD_NAME string Value of DISCORD_ID A vanity name EX My Cool Component
DISCORD_APPLICATION_ID string Application ID
DISCORD_IPC_LOCATIONS string A commera-separated list of host:port network locations or file paths to unix socket for Discord
DISCORD_ARTWORK boolean A boolean indicating if external artwork URLs should be used. Or a comma-separated list of allowed domains
DISCORD_ARTWORK_DEFAULT_URL string or boolean A URL of an image to use as a fallback if the album art URL cannot be used. Or false to use discord’s default.

Bold/Italic = Required