Closes#90
Replace sequential awaits with asyncio.gather() in all locations identified
in the issue:
- commands/gameplay/scorebug.py: parallel team lookups in publish_scorecard
and scorebug commands; also fix missing await on async scorecard_tracker calls
- commands/league/submit_scorecard.py: parallel away/home team lookups
- tasks/live_scorebug_tracker.py: parallel team lookups inside per-scorecard
loop (compounds across multiple active games); fix missing await on
get_all_scorecards
- commands/injuries/management.py: parallel get_current_state() +
search_players() in injury_roll, injury_set_new, and injury_clear
- services/trade_builder.py: parallel per-participant roster validation in
validate_trade()
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Read all spreadsheet data (plays, box score, pitching decisions) before any
database writes so formula errors like #N/A don't leave the DB in a partial
state. Also preserve SheetsException detail through the error chain and show
users the specific cell/error instead of a generic failure message.
Closes#78
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove hardcoded Giphy API key from config.py, load from env var (#19)
- URL-encode query parameters in APIClient._add_params (#20)
- URL-encode Giphy search phrases before building request URLs (#21)
- Replace internal exception details with generic messages to users (#22)
- Replace all bare except: with except Exception: (#23)
- Guard interaction.guild access in has_player_role (#24)
- Replace MD5 with SHA-256 for command change detection hash (#32)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ContextualLogger methods forwarded all **kwargs as extra={} to Python's
standard logger. When callers passed exc_info=True, it landed in the
extra dict and Python's LogRecord raised KeyError("Attempt to overwrite
'exc_info' in LogRecord") since exc_info is a reserved attribute.
This caused /submit-scorecard to crash after game data was already
posted, masking the original error and preventing proper rollback.
Fix: Extract exc_info and stack_info from kwargs before passing as extra,
forwarding them as proper logging parameters instead. Also fix direct
callers in submit_scorecard.py and views/players.py to use error=e.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements full Google Sheets scorecard submission with:
- Complete game data extraction (68 play fields, pitching decisions, box score)
- Transaction rollback support at 3 states (plays/game/complete)
- Duplicate game detection with confirmation dialog
- Permission-based submission (GMs only)
- Automated results posting to news channel
- Automatic standings recalculation
- Key plays display with WPA sorting
New Components:
- Play, Decision, Game models with full validation
- SheetsService for Google Sheets integration
- GameService, PlayService, DecisionService for data management
- ConfirmationView for user confirmations
- Discord helper utilities for channel operations
Services Enhanced:
- StandingsService: Added recalculate_standings() method
- CustomCommandsService: Fixed creator endpoint path
- Team/Player models: Added helper methods for display
Configuration:
- Added SHEETS_CREDENTIALS_PATH environment variable
- Added SBA_NETWORK_NEWS_CHANNEL and role constants
- Enabled pygsheets dependency
Documentation:
- Comprehensive README updates across all modules
- Added command, service, model, and view documentation
- Detailed workflow and error handling documentation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>