When a gauntlet game ended for Event ID 9, the post_result function would crash with:
"UnboundLocalError: cannot access local variable 'team_id' where it is not associated with a value"
Event ID 9 was missing team_id initialization, while all other events (3,4,5,6,7,8)
properly set team_id. Added team_id = None to match the pattern used by Events 5, 6, and 8.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Event ID 9 (Live 25) gauntlet rewards were being given without cardset_id
assigned, causing Team Choice packs to be unconfigured and unusable.
Root cause: Line 1923 checked if event ID was in [3, 4, 5, 6, 8], but
Event ID 9 was missing from this list. This caused the entire reward
assignment block (lines 1923-1957) including Event 9's cardset logic
(lines 1945-1948) to be skipped.
Event 9 should assign:
- cardset_id 27 for standard packs (2005 Live)
- cardset_id 26 for Promo Choice packs (pack_type_id 9)
Added 9 to the event ID list at line 1923 to enable proper cardset
assignment for Event 9 gauntlet rewards.
Fixes: Team Choice packs from Event 9 gauntlet missing cardset_id
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Users reported that end-of-run messages to #pd-news-ticker were no longer
appearing when gauntlet teams lost their second game. The news-ticker
announcement was only happening for 10-win completions, not 2-loss endings.
Changes:
- Updated end_run() to accept bot and main_team parameters
- Added send_to_channel() call when losses == 2 (natural run end)
- Skips news-ticker for manual resets (force_end=True)
- Updated post_result() to pass bot and main_team to end_run()
- Updated manual reset calls to explicitly pass force_end=True
Now when a gauntlet team loses their second game, #pd-news-ticker will
show: "The **[Team]** have completed their **[Event]** Gauntlet run
with a final record of [wins]-[losses]."
The draft completion message to news-ticker was already working correctly
at cogs/players_new/gauntlet.py:178-183.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Multiple fixes to resolve PlayNotFoundException and lineup initialization errors:
1. gauntlets.py:
- Fixed Team object subscriptable errors (use .id instead of ['id'])
- Added fallback cardsets (24, 25, 26) for Event 9 RP shortage
- Fixed draft_team type handling (can be Team object or dict)
2. cogs/gameplay.py:
- Fixed gauntlet game creation flow to read field player lineup from sheets
- Catches LineupsMissingException when SP not yet selected
- Instructs user to run /gamestate after SP selection
3. utilities/dropdown.py:
- Fixed SelectStartingPitcher to create own session instead of using closed session
- Store game/team IDs instead of objects to avoid detached session issues
- Added exception handling for failed legality check API calls
These changes fix the issue where gauntlet games would fail to initialize
because the SP lineup entry wasn't being committed to the database.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed missing draft configuration for Event ID 9 "Live 25" gauntlet that was causing crashes when users tried to start a gauntlet run.
Changes:
- Added cardset configuration for Event 9 (cardsets 27, 28, 29)
- Added Event 9 to max_counts progressive difficulty logic
- Added Event 9 to draft_loop() events list
- Opponent configuration for Event 9 was already present
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Handle gamestates without full lineups
Added /set command for lineup and SP
Fixed uncapped hit bugs
Added league_name property to Games
Fix get_team for gauntlets
Fixed SelectSP dropdown bug