Discomboluating

This commit is contained in:
AlacrisDevs
2026-04-04 21:06:43 +03:00
parent ae393f7c35
commit 14927b610d
15 changed files with 1701 additions and 1127 deletions

View File

@@ -70,7 +70,7 @@ The economy system stores all player data in [PocketBase](https://pocketbase.io/
1. Download `pocketbase.exe` (Windows) from https://pocketbase.io/docs/ and place it in the project root.
2. Start PocketBase: `.\pocketbase.exe serve`
3. Open the admin UI at http://127.0.0.1:8090/_/ and create a superuser account.
4. Create a collection named `economy_users` - see `docs/POCKETBASE_SETUP.md` for the full schema.
4. Create two collections for profile separation: `economy_users_dev` and `economy_users_prod` - see `docs/POCKETBASE_SETUP.md` for schema notes.
5. Set `PB_URL`, `PB_ADMIN_EMAIL`, `PB_ADMIN_PASSWORD` in `.env`.
6. **One-time data migration** (only if you have an existing `data/economy.json`): `python scripts/migrate_to_pb.py`
@@ -88,15 +88,25 @@ cp .env.example .env
| Variable | Description |
|---|---|
| `DISCORD_TOKEN` | Bot token from Discord Developer Portal |
| `BOT_PROFILE` | Runtime profile: `dev` or `economy` |
| `DISCORD_TOKEN_DEV` | Dev bot token from Discord Developer Portal |
| `DISCORD_TOKEN_ECONOMY` | Economy bot token from Discord Developer Portal |
| `DISCORD_TOKEN` | Legacy fallback token (optional) |
| `SHEET_ID` | ID from the Google Sheet URL |
| `GOOGLE_CREDS_PATH` | Path to `credentials.json` (default: `credentials.json`) |
| `GUILD_ID` | Right-click server → Copy Server ID (Developer Mode on) |
| `BIRTHDAY_CHANNEL_ID` | Channel for birthday `@here` pings |
| `GUILD_ID_DEV` | Dev bot guild ID |
| `GUILD_ID_ECONOMY` | Economy bot guild ID |
| `GUILD_ID` | Legacy fallback guild ID (optional) |
| `BIRTHDAY_CHANNEL_ID_DEV` | Channel for birthday `@here` pings in dev profile |
| `BIRTHDAY_CHANNEL_ID_ECONOMY` | Optional birthday channel in economy profile |
| `BIRTHDAY_CHANNEL_ID` | Legacy fallback birthday channel ID (optional) |
| `BIRTHDAY_WINDOW_DAYS` | Days before birthday that on-join check flags it (default: 7) |
| `PB_URL` | PocketBase base URL (default: `http://127.0.0.1:8090`) |
| `PB_ADMIN_EMAIL` | PocketBase superuser e-mail |
| `PB_ADMIN_PASSWORD` | PocketBase superuser password |
| `PB_ECONOMY_COLLECTION_DEV` | PocketBase collection used by `BOT_PROFILE=dev` |
| `PB_ECONOMY_COLLECTION_ECONOMY` | PocketBase collection used by `BOT_PROFILE=economy` |
| `PB_ECONOMY_COLLECTION` | Legacy fallback collection (optional) |
### 6. Install & Run
@@ -110,7 +120,12 @@ pip install -r requirements.txt
# Terminal 1 - keep running
.\pocketbase.exe serve
# Terminal 2
# Terminal 2 (dev bot)
set BOT_PROFILE=dev
python bot.py
# Terminal 3 (economy bot)
set BOT_PROFILE=economy
python bot.py
```
@@ -146,6 +161,8 @@ Admins (bot lacks permission to modify them) are silently skipped and still mark
## Admin Commands
> These commands are hidden from users who don't have the required permission. Override per-role in **Server Settings → Integrations → Bot**.
>
> Profile note: `/check`, `/member`, and `/birthdays` are available only when `BOT_PROFILE=dev`.
| Command | Permission | What it does |
|---|---|---|