🎧 a self-hosted midwestern Discord music bot that doesn't suck
Find a file
Max Isom f5149dfaba
Move file caching logic to new FileCache service
Also: removes the -re ffmpeg option.
If this option is passed, ffmpeg won't write to fs-capacitor (and the cache file) as fast as possible.
In other words, the cache file won't finish writing until the entire stream has been played.
2021-11-19 12:13:45 -05:00
.github chore: update Lint & build action to use nodejs 16 2021-11-16 02:59:51 -03:00
src Move file caching logic to new FileCache service 2021-11-19 12:13:45 -05:00
.dockerignore Switch back to NPM, optimize Dockerfile 2020-10-24 15:19:35 -04:00
.env.example Move file caching logic to new FileCache service 2021-11-19 12:13:45 -05:00
.gitignore Switch back to NPM, optimize Dockerfile 2020-10-24 15:19:35 -04:00
Dockerfile feat: discord.js v13 2021-11-12 16:30:18 -03:00
LICENSE Initial commit 2020-03-07 17:04:01 -06:00
nodemon.json Fix nodemon config 2021-04-01 15:19:14 -04:00
package.json Better DX for yarn dev 2021-11-19 12:02:33 -05:00
README.md Move file caching logic to new FileCache service 2021-11-19 12:13:45 -05:00
tsconfig.json Move to ESM, use ytsr, implement caching 2021-09-19 22:09:09 -04:00
yarn.lock Better DX for yarn dev 2021-11-19 12:02:33 -05:00

Muse is a highly-opinionated midwestern self-hosted Discord music bot that doesn't suck. It's made for small to medium-sized Discord servers/guilds (think about a group the size of you, your friends, and your friend's friends).

Features

  • 🎥 Livestreams
  • Seeking within a song/video
  • 💾 Local caching for better performance
  • 📋 No vote-to-skip - this is anarchy, not a democracy
  • ↔️ Autoconverts playlists / artists / albums / songs from Spotify
  • ↗️ Users can add custom shortcuts (aliases)
  • 1 Muse instance supports multiple guilds
  • ✍️ Written in TypeScript, easily extendable
  • ❤️ Loyal Packers fan

Design Philosophy

I believe it makes much more sense to let Discord handle user permissions (whenever possible) rather than building them into a bot and adding additional complexity. Instead of only allowing users with a certain role to control Muse, Muse allows anyone who has access to its bound channel to control it. Instead of specifying the owner as a user ID in the config, Muse simply looks at the guild owner.

Running

Muse is written in TypeScript. You can either run Muse with Docker (recommended) or directly with Node.js. Both methods require API keys passed in as environment variables:

  • DISCORD_TOKEN can be acquired here by creating a 'New Application', then going to 'Bot'.
  • SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET can be acquired here with 'Create a Client ID'.
  • YOUTUBE_API_KEY can be acquired by creating a new project in Google's Developer Console, enabling the YouTube API, and creating an API key under credentials.

Muse will log a URL when run. Open this URL in a browser to invite Muse to your server. Muse will DM the server owner after it's added with setup instructions.

Docker

(Replace empty config strings with correct values.)

docker run -it -v "$(pwd)/data":/data -e DISCORD_TOKEN='' -e SPOTIFY_CLIENT_ID='' -e SPOTIFY_CLIENT_SECRET='' -e YOUTUBE_API_KEY='' codetheweb/muse

This starts Muse and creates a data directory in your current directory.

Docker Compose:

version: '3.4'

services:
  muse:
    image: codetheweb/muse
    restart: always
    volumes:
      - ./muse:/data
    environment:
      - DISCORD_TOKEN=
      - YOUTUBE_API_KEY=
      - SPOTIFY_CLIENT_ID=
      - SPOTIFY_CLIENT_SECRET=

Node.js

Prerequisites: Node.js, ffmpeg

  1. git clone https://github.com/codetheweb/muse.git && cd muse
  2. Copy .env.example to .env and populate with values
  3. yarn install (or npm i)
  4. yarn build (or npm run build)
  5. yarn start (or npm run start)

Note: if you're on Windows, you may need to manually set the ffmpeg path. See #345 for details.

Advanced

By default, Muse limits the total cache size to around 2 GB. If you want to change this, set the environment variable CACHE_LIMIT. For example, CACHE_LIMIT=512MB or CACHE_LIMIT=10GB.