Implement /draft slash command with comprehensive pick validation: Core Features: - Global pick lock (asyncio.Lock) prevents concurrent picks - 30-second stale lock auto-override for crash recovery - FA player autocomplete with position and sWAR display - Complete pick validation (GM status, turn order, cap space) - Player team updates and draft pick recording - Success/error embeds following EmbedTemplate patterns Architecture: - Uses @logged_command decorator (no manual error handling) - Service layer integration (no direct API access) - TeamService caching for GM validation (80% API reduction) - Global lock in cog instance (not database - local only) - Draft monitor task can acquire same lock for auto-draft Validation Flow: 1. Check global lock (reject if active pick <30s) 2. Validate user is GM (cached lookup) 3. Get draft state and current pick 4. Validate user's turn or has skipped pick 5. Validate player is FA and cap space available 6. Execute pick with atomic updates 7. Post success and advance to next pick Ready for /draft-status and /draft-admin commands next. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
8 lines
241 B
Python
8 lines
241 B
Python
"""
|
|
Draft Commands Package for Discord Bot v2.0
|
|
|
|
Contains slash commands for draft operations:
|
|
- /draft - Make a draft pick with autocomplete
|
|
- /draft-status - View current draft state
|
|
- /draft-admin - Admin controls for draft management
|
|
""" |