🎧 a self-hosted midwestern Discord music bot that doesn't suck
Find a file
dependabot[bot] b9ac26978a
Bump ora from 6.0.1 to 6.1.0 (#531)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-12 10:05:57 -06:00
.github Use PAT to create release 2022-03-12 11:03:53 -05:00
migrations Configurable voice channel leave behavior (#514) 2022-02-11 20:05:02 -06:00
src Support for web streaming audio files (#550) 2022-03-12 09:50:29 -06:00
.dockerignore Switch back to NPM, optimize Dockerfile 2020-10-24 15:19:35 -04:00
.env.example Merge branch 'master' into feature/better-file-caching 2021-11-24 11:42:38 -06:00
.gitignore Switch back to NPM, optimize Dockerfile 2020-10-24 15:19:35 -04:00
.release-it.json Add release-it 2021-12-18 12:38:29 -06:00
CHANGELOG.md Release 1.4.0 2022-03-12 10:51:16 -05:00
Dockerfile Migrate to slash commands (#431) 2022-02-05 16:16:17 -06:00
LICENSE Initial commit 2020-03-07 17:04:01 -06:00
nodemon.json Configurable voice channel leave behavior (#514) 2022-02-11 20:05:02 -06:00
package.json Bump ora from 6.0.1 to 6.1.0 (#531) 2022-03-12 10:05:57 -06:00
README.md Add note about v1.0.0 2022-02-18 11:17:36 -06:00
schema.prisma Configurable voice channel leave behavior (#514) 2022-02-11 20:05:02 -06:00
tsconfig.json Migrate to slash commands (#431) 2022-02-05 16:16:17 -06:00
yarn.lock Bump ora from 6.0.1 to 6.1.0 (#531) 2022-03-12 10:05:57 -06:00

🚨: v1.0.0 was a breaking change. Please take a look at the release notes for upgrade instructions


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).

Hero graphic

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

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.

A 64-bit OS is required to run Muse.

Versioning

The master branch acts as the developing / bleeding edge branch and is not guaranteed to be stable.

When running a production instance, I recommend that you use the latest release.

🐳 Docker

There are a variety of image tags available:

  • :2: versions >= 2.0.0
  • :2.1: versions >= 2.1.0 and < 2.2.0
  • :2.1.1: an exact version specifier
  • :latest: whatever the latest version is

(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:latest

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

Docker Compose:

version: '3.4'

services:
  muse:
    image: codetheweb/muse:latest
    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. I recommend checking out a tagged release with git checkout v[latest release]
  4. yarn install (or npm i)
  5. yarn build (or npm run build)
  6. 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.

⚙️ Additional configuration (advanced)

Cache

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.

Bot-wide commands

If you have Muse running in a lot of guilds (10+) you may want to switch to registering commands bot-wide rather than for each guild. (The downside to this is that command updates can take up to an hour to propagate.) To do this, set the environment variable REGISTER_COMMANDS_ON_BOT to true.