1
0
forked from sass/tipibot

Document cleanup

This commit is contained in:
Rene Arumetsa
2026-05-04 20:50:30 +03:00
parent 0e617d87a2
commit b0a3dcb03b
4 changed files with 151 additions and 995 deletions

View File

@@ -222,7 +222,7 @@ If a member joins and their birthday is within `BIRTHDAY_WINDOW_DAYS` days, a bi
## TipiCOIN Economy
All economy data is stored in **PocketBase** (`economy_users` collection - see `pb_client.py`). The currency is **TipiCOIN** (⬡), displayed as a custom Discord emoji configured in `economy.py → COIN`.
All economy data is stored in **PocketBase** (`economy_users` collection - see `core/pb_client.py`). The currency is **TipiCOIN** (⬡), displayed as a custom Discord emoji configured in `core/economy.py → COIN`.
---
@@ -279,17 +279,17 @@ Every successful economy action awards EXP:
| `/rob` success | +15 |
| Gambling win (`/roulette`, `/slots`, `/blackjack`) | Scaled by bet: <10⬡ = 0, 1099⬡ = +5, 100999⬡ = +10, 1 0009 999⬡ = +15, 10 00099 999⬡ = +20, 100 000+⬡ = +25 |
| `/beg` completed | +5 |
| `/fish` catch | +3 to +15 (varies by rarity) |
| `/fish` catch | +2 to +25 (varies by rarity: common 23, uncommon 67, rare 10, epic 1415, legendary 25) |
**Level formula:** `level = floor(√(total_exp ÷ 10))`
**Level formula:** `level = max(1, floor(√(total_exp ÷ 6)))`
| Level | EXP required | Milestone |
|---|---|---|
| 1 | 10 | TipiNOOB role |
| 5 | 250 | TipiGRINDER role |
| 10 | 1 000 | TipiHUSTLER role · **T2 shop unlocks** |
| 20 | 4 000 | TipiCHAD role · **T3 shop unlocks** |
| 30 | 9 000 | TipiLEGEND role |
| 1 | 0 | TipiNOOB role |
| 5 | 150 | TipiGRINDER role |
| 10 | 600 | TipiHUSTLER role · **T2 shop unlocks** |
| 20 | 2 400 | TipiCHAD role · **T3 shop unlocks** |
| 30 | 5 400 | TipiLEGEND role |
Use `/rank` to see your current EXP, level, progress bar to the next level, and leaderboard position.
@@ -448,7 +448,7 @@ All items are **permanent** once purchased **except Anticheat**, which expires a
Commands that accept a coin amount (`/give`, `/roulette`, `/rps`, `/slots`, `/blackjack`) accept `"all"` as the amount to wager your entire balance.
### Custom emoji
Change `COIN` in `economy.py` to any Discord emoji string:
Change `COIN` in `core/economy.py` to any Discord emoji string:
```python
COIN = "<:tipicoin:YOUR_EMOJI_ID>"
```
@@ -457,12 +457,12 @@ COIN = "<:tipicoin:YOUR_EMOJI_ID>"
## Logging
All logs are written to the `logs/` directory (auto-created on startup).
Logs are written under `logs/<BOT_PROFILE>/` (auto-created on startup), so dev and economy profiles keep separate log streams.
| File | Rotation | Contents |
|---|---|---|
| `logs/bot.log` | 5 MB x 5 backups | All INFO+ events: commands, errors, member sync |
| `logs/transactions.log` | Daily, 30 days | Economy transactions only: every balance change with user, amount, new balance |
| `logs/<profile>/bot.log` | 5 MB x 5 backups | All INFO+ events: commands, errors, member sync |
| `logs/<profile>/transactions.log` | Daily, 30 days | Economy transactions only: every balance change with user, amount, new balance |
The terminal output is **colour-coded** by log level (green = INFO, yellow = WARNING, red = ERROR).
@@ -473,28 +473,44 @@ Every slash command invocation is logged with the user ID, display name, and all
## Project Structure
```
├── bot.py # Discord client, all slash commands, event handlers
├── economy.py # TipiCOIN business logic, constants (SHOP, COOLDOWNS, etc.)
├── pb_client.py # Async PocketBase REST client (auth + CRUD for economy_users)
├── strings.py # All user-facing strings, command descriptions, help text
├── member_sync.py # Role/nickname/birthday sync logic
├── sheets.py # Google Sheets read/write + in-memory cache
├── config.py # Environment variable loader
├── requirements.txt # Python dependencies
├── .env.example # Template for secrets
├── .env # Your secrets (gitignored)
├── credentials.json # Google service account key (gitignored)
├── bot.py # Discord client, event handlers, shared helpers; wires command modules together
├── strings.py # All user-facing strings (command descriptions, help text, errors)
├── config.py # Environment variable loader
├── core/
│ ├── economy.py # TipiCOIN business logic, constants (SHOP, COOLDOWNS, EXP_REWARDS, ...)
│ ├── pb_client.py # Async PocketBase REST client (auth + CRUD for economy_users)
│ ├── sheets.py # Google Sheets read/write + in-memory cache
│ └── member_sync.py # Role/nickname/birthday sync logic
├── commands/
│ ├── dev_member_commands.py # /check, /member (dev profile)
│ ├── dev_member_runtime.py # on_member_join + birthday daily task helpers
│ ├── economy_admin_commands.py # /admincoins, /adminexp, /adminitem, /adminjail, ...
│ ├── economy_extra_commands.py # /heist, /jailbreak, /reminders, /request, ...
│ ├── economy_fish_commands.py # /fish, /fishbook, /fishsell
│ ├── economy_games_commands.py # /roulette, /slots, /blackjack, /rps
│ ├── economy_income_commands.py # /daily, /work, /beg, /crime, /rob
│ ├── economy_prestige_commands.py# /prestige, /prestigeshop, /prestigebuy
│ ├── economy_profile_commands.py # /balance, /rank, /stats, /cooldowns, /leaderboard
│ ├── economy_support_commands.py # /shop, /buy, /give, /economysetup
│ ├── info_commands.py # /patchnotes, /help auxiliaries
│ ├── ops_admin_commands.py # /sync, /restart, /shutdown, /pause, /send, /status
│ └── ops_channel_commands.py # channel allowlist gating
├── docs/
│ ├── DEV_NOTES.md # Developer reference (architecture, checklists, constants)
│ ├── CHANGELOG.md # Version history
│ └── POCKETBASE_SETUP.md # PocketBase collection schema + setup instructions
│ ├── DEV_NOTES.md # Developer reference (architecture, checklists, constants)
│ ├── PATCHNOTES.md # Player-facing patch notes (surfaced via /patchnotes)
│ └── POCKETBASE_SETUP.md # PocketBase collection schema + setup instructions
├── scripts/
│ ├── migrate_to_pb.py # One-time migration: economy.json → PocketBase
── add_stats_fields.py # Schema migration: add new fields to economy_users collection
├── data/
│ └── birthday_sent.json # Birthday dedup log (auto-created)
├── pb_data/ # PocketBase database files (auto-created, gitignored)
── logs/
├── bot.log # General rotating log (auto-created)
└── transactions.log # Daily economy transaction log (auto-created)
│ ├── migrate_to_pb.py # One-time legacy migration: economy.json → PocketBase
── add_stats_fields.py # Schema migration: add new fields to economy_users collection
│ └── reset_pb_collections.py # Destructive: deletes & recreates economy collections (--confirm required)
├── requirements.txt # Python dependencies
├── .env.example # Template for secrets
── .env # Your secrets (gitignored)
├── credentials.json # Google service account key (gitignored)
├── data/<BOT_PROFILE>/
│ └── birthday_sent.json # Birthday dedup log (auto-created per profile)
├── pb_data/ # PocketBase database files (auto-created, gitignored)
└── logs/<BOT_PROFILE>/
├── bot.log # General rotating log (auto-created)
└── transactions.log # Daily economy transaction log (auto-created)
```