muse/README.md

94 lines
3.7 KiB
Markdown
Raw Normal View History

2020-03-24 23:25:33 +01:00
<p align="center">
2020-03-25 00:33:10 +01:00
<img width="250" height="250" src="https://raw.githubusercontent.com/codetheweb/muse/master/.github/logo.png">
2020-03-24 23:25:33 +01:00
</p>
2020-03-25 00:33:10 +01: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).
2022-02-05 22:59:29 +01:00
![Hero graphic](.github/hero.png)
2022-01-19 05:09:07 +01:00
## Features
2020-03-25 00:33:10 +01:00
- 🎥 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)
2020-03-25 00:34:33 +01:00
- 1⃣ Muse instance supports multiple guilds
- ✍️ Written in TypeScript, easily extendable
2020-03-25 00:33:10 +01:00
- ❤️ Loyal Packers fan
2022-01-19 05:09:07 +01:00
## Running
2020-03-25 00:33:10 +01:00
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](https://discordapp.com/developers/applications) by creating a 'New Application', then going to 'Bot'.
2020-03-25 00:33:10 +01:00
- `SPOTIFY_CLIENT_ID` and `SPOTIFY_CLIENT_SECRET` can be acquired [here](https://developer.spotify.com/dashboard/applications) with 'Create a Client ID'.
- `YOUTUBE_API_KEY` can be acquired by [creating a new project](https://console.developers.google.com) in Google's Developer Console, enabling the YouTube API, and creating an API key under credentials.
2021-09-22 16:22:06 +02:00
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.
2020-03-25 00:33:10 +01:00
2022-01-19 05:09:07 +01:00
### Versioning
2021-12-16 21:03:31 +01:00
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](https://github.com/codetheweb/muse/releases/).
2022-01-19 05:09:07 +01:00
### 🐳 Docker
2020-03-25 00:33:10 +01:00
2021-12-16 21:03:31 +01:00
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
2020-03-25 00:33:10 +01:00
(Replace empty config strings with correct values.)
```bash
2022-01-19 05:09:07 +01:00
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
2020-03-25 00:33:10 +01:00
```
This starts Muse and creates a data directory in your current directory.
**Docker Compose**:
```yaml
version: '3.4'
services:
muse:
2021-12-16 21:03:31 +01:00
image: codetheweb/muse:latest
2020-03-25 00:33:10 +01:00
restart: always
volumes:
- ./muse:/data
environment:
- DISCORD_TOKEN=
- YOUTUBE_API_KEY=
- SPOTIFY_CLIENT_ID=
- SPOTIFY_CLIENT_SECRET=
```
2022-01-19 05:09:07 +01:00
### Node.js
2020-03-25 00:33:10 +01:00
**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
2021-12-16 21:03:31 +01:00
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`)
2021-09-20 15:55:53 +02:00
**Note**: if you're on Windows, you may need to manually set the ffmpeg path. See [#345](https://github.com/codetheweb/muse/issues/345) for details.
2022-01-19 05:09:07 +01:00
## ⚙️ 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`.
2022-01-19 05:09:07 +01:00
### Bot-wide commands
2022-02-05 22:59:29 +01:00
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`.