feat: add get_away_team and get_home_team methods to StratGame (#21) #67

Closed
cal wants to merge 13 commits from ai/paper-dynasty-discord-21 into main

13 Commits

Author SHA1 Message Date
Cal Corum
109b88b9e5 feat: add get_away_team and get_home_team methods to StratGame (#21)
Implements the TODO at db_calls_gameplay.py:190. Both async methods
delegate to get_game_team(), which already handles the SBA vs PD
distinction, returning the appropriate Team dict without callers
needing to repeat the lookup logic inline.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 01:33:08 -06:00
Cal Corum
da55cbe4d4 feat: limit scouting to Standard/Premium packs, simplify scout view
All checks were successful
Build Docker Image / build (push) Successful in 1m17s
- Add SCOUTABLE_PACK_TYPES env var (default: Standard,Premium) to control
  which pack types offer scout opportunities
- Unify embed construction into build_scout_embed() — removes 3 near-duplicate
  embed builders across scout_view.py and scouting.py
- Replace manual total_scouts counter with derived property from claims dict
- Remove redundant db_get("current") API call per scout click — use PD_SEASON
- Remove duplicate expiry computation in create_scout_opportunity
- Move send_to_channel to top-level import, remove redundant local import
- Update tests to match simplified code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 21:12:46 -06:00
Cal Corum
e160be4137 fix: add missing pack, description, image fields to scouting test fixtures
All checks were successful
Build Docker Image / build (push) Successful in 51s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:47:52 -06:00
Cal Corum
8e605c2140 fix: add pack_id to scouted card creation, enhance embed with card links
All checks were successful
Build Docker Image / build (push) Successful in 1m16s
- Include pack_id in db_post("cards") payload (API requires it)
- Player names now link to card image URLs in scout embed
- Display format: "🟡 All-Star — [2023 Mike Trout](card_image_url)"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 13:22:57 -06:00
Cal Corum
77c3f3004c fix: align scouting rarity symbols with system colors
All checks were successful
Build Docker Image / build (push) Successful in 1m22s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 13:03:15 -06:00
Cal Corum
ed00a97c0d fix: update owner_only to use Cal's correct Discord ID
All checks were successful
Build Docker Image / build (push) Successful in 1m22s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 15:57:25 -06:00
cal
0aafc3fa46 Merge pull request 'feat: Scouting feature (Wonder Pick-style social pack opening)' (#50) from feature/scouting into next-release
All checks were successful
Build Docker Image / build (push) Successful in 2m51s
Reviewed-on: #50
2026-03-05 03:17:07 +00:00
cal
0ce0707e3e Update .gitea/workflows/docker-build.yml 2026-03-05 03:16:36 +00:00
cal
75b9968149 Update .gitea/workflows/docker-build.yml 2026-03-05 03:15:37 +00:00
cal
89f80727bd Update .gitea/workflows/docker-build.yml 2026-03-05 03:12:20 +00:00
Cal Corum
d569e91905 fix: Address PR review findings — two bugs and cleanup
- Fix int_timestamp() no-arg path returning seconds instead of
  milliseconds, which would silently break the daily scout token cap
  against the real API
- Acknowledge double-click interactions with ephemeral message instead
  of silently returning (Discord requires all interactions to be acked)
- Reorder scout flow: create card copy before consuming token so a
  failure doesn't cost the player a token for nothing
- Move build_scouted_card_list import to top of scout_view.py
- Remove unused asyncio import from helpers/scouting.py
- Fix footer text inconsistency ("One scout per player" everywhere)
- Update tests for new operation order and double-click behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 03:04:53 +00:00
Cal Corum
d538c679c3 refactor: Consolidate scouting utilities, add test suite, use Discord timestamps
- Consolidate SCOUT_TOKENS_PER_DAY and get_scout_tokens_used() into
  helpers/scouting.py (was duplicated across 3 files)
- Add midnight_timestamp() utility to helpers/utils.py
- Remove _build_scouted_ids() wrapper, use self.claims directly
- Fix build_scout_embed return type annotation
- Use Discord <t:UNIX:R> relative timestamps for scout window countdown
- Add 66-test suite covering helpers, ScoutView, and cog

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 03:04:53 +00:00
Cal Corum
14103e48b7 feat: Add Scouting feature (Wonder Pick-style social pack opening)
When a player opens a pack, a scout opportunity is posted to #pack-openings
with face-down card buttons. Other players can blind-pick one card using
daily scout tokens (2/day), receiving a copy. The opener keeps all cards.

New files:
- discord_ui/scout_view.py: ScoutView with dynamic buttons and claim logic
- helpers/scouting.py: create_scout_opportunity() and embed builder
- cogs/economy_new/scouting.py: /scout-tokens command and cleanup task

Modified:
- helpers/main.py: Hook into open_st_pr_packs() after display_cards()
- paperdynasty.py: Register scouting cog

Requires new API endpoints in paper-dynasty-database (scout_opportunities).
Tracks #44.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 03:04:53 +00:00