master #3
Reference in New Issue
Block a user
Delete Branch "renkar/tipibot:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The economy had many coin faucets but almost no sinks: the /shop is one-time ownership, and gambling/rob fines route to the house (which players drain back via jackpots and heists), so they recirculate rather than destroy coins. Result: steady inflation. Add a consumables shop as a true recurring sink - buying destroys the coins and grants a temporary boost, so there's always something to spend on after gear is maxed: - Energiajook XL (500) - 1h of 2x earnings on /work, /beg, /crime - XP jook (500) - 1h of 2x EXP - Kohv (300) - instantly clears all cooldowns Timed buffs live in a new active_buffs field ({kind: expiry_iso}), pruned on read; rebuying extends the timer. Effects hook where they belong: earn_mult in income.do_work/do_beg/do_crime, exp_buff_mult in levels.award_exp; kohv is self-contained. New /consumables command browses the menu (with active buffs) or buys a boost. Covered by 9 tests. Note: active_buffs is a new PocketBase field - run scripts/sync_pb_schema.py before deploying or buffs won't persist. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Section titles are stacked single-cell rows: the "TipiLAN 2026 CS2" title sits above notice rows ("If a team withdraws..."), and parse_team_sections kept only the LAST one, so the notice clobbered the title and resolve_divider saw no game/year keywords -> None -> teams never positioned. - parse_team_sections now accumulates all single-cell rows above a header, so the game/year title survives alongside the notices. - _refresh_teams_sync resolves the divider from "<tab name> <section title>", so the game is taken reliably from the CS2/LoL worksheet name while the year still comes from the title, keeping year-scoped TEAM_DIVIDER_*_2026 vars. - regression test: title survives notice rows and still resolves. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XPRsW4tazVtYi2jNzVQkreThe registration-log sheet only has in-game nicknames, so matching Discord users to teams failed for ~10 of 40 teams. Fienta collects each competitor's Discord username (+ sometimes user ID) and team name per ticket, giving a reliable Discord-identity -> team mapping (validated: 201 usernames, 42 teams). - core/fienta.py: token-auth client; fetch /events/{id}/tickets?attendees=true, parse competitor/coach/substitute tickets into {username|id -> team} and {team -> game}; exclude visitor/supporter/LAN/early-bird/waiting-list. No-op when FIENTA_API_TOKEN/FIENTA_EVENT_ID unset. - member_sync: resolve_team() tries Fienta (id, then username) then the sheet; all_managed_team_names() and team_dividers() merge both sources. - /teamsync + hourly task refresh Fienta alongside the sheet; enabled when either source is configured. - config + .env.example: FIENTA_API_TOKEN, FIENTA_EVENT_ID. - tests: fienta parsing (game detection, inclusion rules, id/username mapping). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XPRsW4tazVtYi2jNzVQkreThree robustness/perf fixes from the review: 1. db_error UX: economy core returns {"ok": False, "reason": "db_error"} on a PocketBase outage, but no handler expected it - deferred commands hung on "thinking..." and others showed a misleading "you're broke". Added a shared reply_db_error helper (commands/_replies.py) + S.ERR["db_error"], and wired a db_error branch into every handler that can receive it (daily/work/beg/crime/ rob/give/buy/roulette/slots/blackjack/heist/fish/prestige/vanity/consumables/ request-funding). Also fixed a latent KeyError in vs-bot RPS that read res["balance"] without checking res["ok"]. 2. Deduped the item->cooldown mapping that was copied in do_daily/do_work/do_beg, do_fish_start, _maybe_remind and _restore_reminders. Single source of truth: store.ITEM_COOLDOWNS + effective_cooldown(cmd, items). 3. /leaderboard did six full-collection scans (one per tab). Added get_all_leaderboards() which scans once and builds all six views in memory. Tests: effective_cooldown cases, and get_all_leaderboards matches the individual queries + scans the collection exactly once. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VbAVsrZuYesea99mPMmPTA strategic counterpart to /rob: coins moved to the bank are safe from /rob and /heist (which only touch liquid balance) but earn no Bot Farm interest and can't be spent, gambled or given until withdrawn - the deliberate trade-off against keeping coins liquid. - New bank.py (do_deposit/do_withdraw), bank_balance schema field. - /bank (view), /deposit, /withdraw commands ('all' supported), with db_error handling; /balance shows the vault when non-zero. - Coins leaderboard and /status money-supply now count net worth (balance + bank_balance), so banking never hides you from the board or the supply metric. - Season reset wipes bank_balance too (no cross-season wealth hiding). 10 tests: deposit/withdraw math, guards, coin conservation, rob cannot touch the vault, and net-worth accounting on the leaderboard + stats. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VbAVsrZuYesea99mPMmPTView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.