Root Cause Fixes:
- Add _extract_items_and_count_from_response() override to DraftPickService
to handle API returning 'picks' key instead of 'draftpicks'
- Add custom from_api_data() to DraftPick model to handle API field mapping
(origowner/owner/player -> origowner_id/owner_id/player_id)
Enhancements:
- Add timer status to /draft-admin set-pick success message
- Shows relative deadline timestamp when timer active
- Shows "Timer Inactive" when timer not running
Also includes related draft module improvements from prior work.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Root cause: Field naming mismatch between bot model and database schema.
The database stores channel IDs in columns named 'result_channel' and
'ping_channel', but the bot's DraftData model incorrectly used
'result_channel_id' and 'ping_channel_id'.
Additionally, the draft data PATCH endpoint requires query parameters
instead of JSON body (like player, game, transaction, and injury endpoints).
Changes:
- models/draft_data.py: Renamed fields to match database schema
- result_channel_id → result_channel
- ping_channel_id → ping_channel
- services/draft_service.py: Added use_query_params=True to PATCH calls
- views/draft_views.py: Updated embed to use correct field names
- tasks/draft_monitor.py: Updated channel lookups to use correct field names
- tests/test_models.py: Updated test assertions to match new field names
This fixes:
- Channel configuration now saves correctly via /draft-admin channels
- Ping channel settings persist across bot restarts
- Result channel settings persist across bot restarts
- All draft data updates work properly
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fix Pydantic validation errors when channel IDs are not configured:
Issue:
- result_channel_id and ping_channel_id were required fields
- Database may not have these values configured yet
- /draft-admin info command failed with validation errors
Fixes:
1. models/draft_data.py:
- Make result_channel_id and ping_channel_id Optional[int]
- Update validator to handle None values
- Prevents validation errors on missing channel data
2. views/draft_views.py:
- Handle None channel IDs in admin info embed
- Display "Not configured" instead of invalid channel mentions
- Prevents formatting errors when channels not set
Testing:
- Validated model accepts None for channel IDs
- Validated model accepts int for channel IDs
- Validated model converts string channel IDs to int
- All validation tests pass
This allows draft system to work before channels are configured
via /draft-admin channels command.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add comprehensive embed and UI components for draft system:
- On the clock embed: Shows current pick with team info, deadline, recent/upcoming picks
- Draft status embed: Current state, timer status, lock status
- Player draft card: Player info when drafted
- Draft list embed: Team's auto-draft queue display
- Draft board embed: Round-by-round pick display
- Admin info embed: Detailed configuration for admins
- Error/success embeds: Pick validation feedback
All components follow EmbedTemplate patterns with consistent
styling and proper color usage. Ready for command integration.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>