2022-11-21 15:29:03 +00:00
|
|
|
# umi
|
|
|
|
|
|
|
|
a self-hostable single-guild discord bot for playing music and announcing vc channel joins/leaves
|
|
|
|
|
|
|
|
## Pre-requisites
|
|
|
|
|
|
|
|
Install dependencies:
|
|
|
|
|
|
|
|
- FFI: `libffi`
|
|
|
|
- NaCl: `libnacl` or `libsodium`
|
2022-12-12 14:58:47 +00:00
|
|
|
- FFmpeg: `ffmpeg`
|
2024-05-10 19:48:20 +00:00
|
|
|
- yt-dlp: `yt-dlp`
|
2024-05-13 05:48:38 +00:00
|
|
|
- opus: `opus`
|
2022-11-21 15:29:03 +00:00
|
|
|
|
|
|
|
Copy `.env.example` to `.env`:
|
|
|
|
|
|
|
|
- `DISCORD_BOT_TOKEN` is obtained from the [Discord Developer Dashboard](https://discord.com/developers/applications)
|
|
|
|
- Click or create an application
|
|
|
|
- Get your token from the "Bot" section in the sidebar menu
|
|
|
|
|
|
|
|
- `DISCORD_GUILD_ID` is obtained from within the Discord app
|
|
|
|
- Settings > Advanced > Developer Mode: enabled
|
|
|
|
- Right click the guild and select "Copy ID"
|
|
|
|
|
|
|
|
- `DISCORD_BOT_ADMIN_ROLE_ID` for reloading cogs
|
|
|
|
- `DISCORD_BOT_ADMIN_USER_ID` for reloading cogs
|
2022-12-12 12:01:52 +00:00
|
|
|
- `DISCORD_VCJOIN_CHANNEL` for the VCJoin cog
|
2022-11-21 15:29:03 +00:00
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
2024-12-01 08:22:17 +00:00
|
|
|
### with systemd
|
2022-11-21 15:29:03 +00:00
|
|
|
|
|
|
|
```sh
|
2024-12-01 08:22:17 +00:00
|
|
|
mkdir -p /srv/discord
|
|
|
|
cd /srv/discord
|
2022-11-21 15:29:03 +00:00
|
|
|
|
2024-12-01 08:22:17 +00:00
|
|
|
sudo useradd --system -s /srv/discord discord
|
|
|
|
sudo chown -R discord:discord /srv/discord
|
2022-11-21 15:29:03 +00:00
|
|
|
|
2024-12-01 08:22:17 +00:00
|
|
|
sudo -Hu discord git clone https://git.trwnh.com/a/umi.git
|
|
|
|
|
|
|
|
python -m venv .venv
|
|
|
|
.venv/bin/pip install -r umi/requirements.txt
|
|
|
|
|
|
|
|
sudo cp umi/umi@.service /etc/systemd/system/umi@.service
|
|
|
|
sudo systemctl daemon-reload
|
|
|
|
sudo systemctl start umi@umi
|
2022-12-12 14:58:47 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### ...with Docker Compose
|
|
|
|
|
|
|
|
```sh
|
2024-12-01 08:22:17 +00:00
|
|
|
mkdir -p /srv/discord
|
|
|
|
cd /srv/discord
|
|
|
|
|
|
|
|
sudo useradd --system -s /srv/discord discord
|
|
|
|
sudo chown -R discord:discord /srv/discord
|
|
|
|
|
|
|
|
sudo -Hu discord git clone https://git.trwnh.com/a/umi.git
|
|
|
|
|
|
|
|
cd umi
|
|
|
|
sudo docker compose build
|
|
|
|
sudo docker compose up -d
|
2024-11-13 23:26:19 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Log into YouTube
|
|
|
|
|
|
|
|
- Follow the instructions at https://github.com/yt-dlp/yt-dlp/wiki/Extractors#exporting-youtube-cookies
|
|
|
|
- Put your extracted cookies into config/cookies.txt
|