updated README and added .env example
This commit is contained in:
@@ -47,8 +47,8 @@ cp .env.example .env
|
||||
| --- | --- | --- |
|
||||
| `BOT_TOKEN` | ✅ | Discord bot token (Developer Portal → your app → Bot) |
|
||||
| `GUILD_ID` | optional | Test server ID for instant command registration. If unset, commands register globally (can take up to an hour) |
|
||||
| `LAVALINK_URI` | optional | Defaults to `ws://localhost:2333` (matches `docker-compose.yml`) |
|
||||
| `LAVALINK_PASSWORD` | optional | Defaults to `youshallnotpass` (matches `lavalink/application.yml`) |
|
||||
| `LAVALINK_URI` | optional | Defaults to `ws://localhost:2333` for local runs. In `docker-compose.yaml` the bot is pointed at `ws://lavalink:2333` (the service name) |
|
||||
| `LAVALINK_PASSWORD` | ✅ | Shared secret between the bot and the Lavalink server. Compose passes the same value to the server as `LAVALINK_SERVER_PASSWORD`, so they always match. The bot **exits** if it's unset |
|
||||
|
||||
`.env` is gitignored, so your token stays local.
|
||||
|
||||
@@ -83,6 +83,33 @@ voice channel in your server and try `/play <song or url>`.
|
||||
- [ ] Run the bot: `./gradlew run`
|
||||
- [ ] In Discord, run `/hello` to confirm it responds, then `/play` from a voice channel
|
||||
|
||||
## Run with Docker (prebuilt image)
|
||||
|
||||
If you'd rather not build from source, `docker-compose.yaml` pulls the prebuilt
|
||||
bot image and runs it alongside Lavalink. You only need Docker — no JDK.
|
||||
|
||||
1. Create your config and the files the bot reads at runtime, next to the compose file:
|
||||
|
||||
```bash
|
||||
cp .env.example .env # then fill in BOT_TOKEN and LAVALINK_PASSWORD
|
||||
```
|
||||
|
||||
Make sure `catchphrases.txt`, `always100.txt`, and `always90.txt` exist as
|
||||
**files** here. They're mounted into the container — if any is missing, Docker
|
||||
creates an empty **directory** in its place and the mount breaks.
|
||||
|
||||
2. Pull and start both services:
|
||||
|
||||
```bash
|
||||
docker compose pull # fetch the bot + Lavalink images
|
||||
docker compose up -d # start in the background
|
||||
docker compose logs -f # watch logs; look for "Bot connected and ready as ..."
|
||||
docker compose down # stop
|
||||
```
|
||||
|
||||
The bot connects to Lavalink over the internal Docker network automatically, so
|
||||
you don't set `LAVALINK_URI` yourself here.
|
||||
|
||||
## Notes
|
||||
|
||||
- Queue state is kept in memory, so it resets if the bot restarts.
|
||||
|
||||
Reference in New Issue
Block a user