# Velox Bot A Discord bot written in Go with a PostgreSQL backing store. It currently includes: - Fun commands (`/ping`, `/joke`, `/dice`, `/rps`, …) - Leveling system (opt-in per server via `/slvl toggle`) - Meeting rooms (voice lobby → auto-created temporary voice channels) - Scheduling (1:1 sessions with DM invites + reaction-based accept/decline/reschedule) - Projects (list/create projects + helpers) - Music (Lavalink-powered `/play`, `/queue`, `/volume`) - Twitch live notifications (per-guild `/config` setup) - Welcome messages, DMs, and default role assignment (per-guild `/config` setup) ## Requirements - Go (see `go.mod`) - PostgreSQL 16+ (or use the provided `docker-compose.yml`) - (Optional) [Air](https://github.com/air-verse/air) for live reload during development - (Optional) Lavalink if you want music commands ## Configuration The app loads environment variables from `.env` (see `internal/config/config.go`). Required: - `BOT_TOKEN`: Discord bot token - `APP_ID`: Discord application ID - `GUILD_ID`: Target guild/server ID (commands are registered per-guild) - `DB_HOST`: Postgres connection string (pgx), e.g. `postgres://velox:velox_pwd@localhost:5432/velox?sslmode=disable` Optional (music): - `LAVALINK_HOST`: Lavalink WebSocket/HTTP host (depends on your Lavalink setup) - `LAVALINK_PASSWORD`: Lavalink password Optional (Twitch live notifications): - `TWITCH_CLIENT_ID`: Twitch Client ID used to query live status ## Database setup If you use the compose file: ```bash docker compose up -d ``` Then apply the schema: ```bash psql "postgres://velox:velox_pwd@localhost:5432/velox?sslmode=disable" -f schema.sql ``` ## Run Plain Go: ```bash go run . ``` With live reload (Air): ```bash air ``` If you use `just`, a small workflow is included: ```bash just up # start postgres just start # start postgres + run air just down # stop postgres ``` ## Commands (high-level) - **Fun** - `/ping`, `/joke [type]`, `/coinflip`, `/dice ` - `/rps `, `/rpsstats`, `/rpsleaderboard` (server only) - **Help** - `/help` (sends a DM with command reference) - **Leveling** - `/slvl ...` admin/config - `/rank`, `/leaderboard`, `/rewards` - **Meetings** (**Manage Server**) - `/meeting set-lobby`, `/meeting lock`, `/meeting lock-private`, `/meeting unlock`, `/meeting invite`, `/meeting uninvite` - **Timezone** - `/timezone set`, `/timezone show` - **Scheduling** - `/schedule create`, `/schedule list`, `/schedule reschedule` - **Projects** - `/projects list`, `/projects create`, `/projects add-helper` - **Music** (requires **DJ** role) - `/play`, `/queue`, `/volume` - **Twitch live notifications** (**Manage Server**) - `/config addstreamer username:` — Add a streamer for notifications - `/config removestreamer username:` — Remove a streamer - `/config settwitchnotificationchannel channel:#channel` — Channel for live pings - **Welcome / onboarding** (**Manage Server**) - `/config setwelcomechannel channel:#channel` — Channel for welcome messages - `/config setwelcomemessage message:"..."` — Server welcome template (supports `{user}`, `{server}`) - `/config setwelcomedm message:"..."` — DM welcome template (supports `{user}`, `{server}`) - `/config setwelcomegif url:` — GIF/image used in welcome embed - `/config setdefaultrole role:@role` — Role automatically granted on join ## Notes - Slash commands are registered to the configured `GUILD_ID` on startup. - Some features require server permissions (e.g. **Manage Server**) or roles (e.g. **DJ** for music).