From a26d1bccd6c4c67b68b4793bc4ec98f9f8a5ebe9 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Wed, 29 Oct 2025 01:48:15 -0500 Subject: [PATCH 1/2] CLAUDE: Update injury commands documentation for playoff support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated commands/injuries/CLAUDE.md to reflect playoff week validation: Documentation Changes: - Updated /injury set-new parameters to show week range 1-21 - Added "Week and Game Validation" section with playoff-specific limits - Updated automatic calculations note for variable games per week - Added playoff examples (weeks 19-21 with proper game numbers) - Added new "Configuration" section documenting playoff constants - Added week/game limits table showing all season phases - Updated Key Improvements to mention playoff support - Updated Last Updated to October 2025 Validation Details Now Documented: - Regular Season (Weeks 1-18): 1-4 games per week - Playoff Round 1 (Week 19): 1-5 games (best of 5) - Playoff Round 2 (Week 20): 1-7 games (best of 7) - Playoff Round 3 (Week 21): 1-7 games (best of 7) Configuration Section: Documents the playoff constants from config.py and explains: - How constants are used in views/modals.py validation - Week/game enforcement logic - Series types for each playoff round This complements the config.py changes from commit aad9c00. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- commands/injuries/CLAUDE.md | 66 ++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/commands/injuries/CLAUDE.md b/commands/injuries/CLAUDE.md index 94f03d5..91dc367 100644 --- a/commands/injuries/CLAUDE.md +++ b/commands/injuries/CLAUDE.md @@ -83,28 +83,46 @@ Record a new injury for a player on your team. **Parameters:** - `player_name` (required): Name of the player to injure -- `this_week` (required): Current week number -- `this_game` (required): Current game number (1-4) +- `this_week` (required): Current week number (1-21, including playoffs) +- `this_game` (required): Current game number (varies by week - see below) - `injury_games` (required): Total number of games player will be out -**Validation:** +**Week and Game Validation:** +- **Regular Season (Weeks 1-18)**: Game number must be 1-4 +- **Playoff Round 1 (Week 19)**: Game number must be 1-5 (best of 5 series) +- **Playoff Round 2 (Week 20)**: Game number must be 1-7 (best of 7 series) +- **Playoff Round 3 (Week 21)**: Game number must be 1-7 (best of 7 series) + +**Additional Validation:** - Player must exist in current season - Player cannot already have an active injury -- Game number must be between 1 and 4 - Injury duration must be at least 1 game **Automatic Calculations:** The command automatically calculates: -1. Injury start date (adjusts for game 4 edge case) +1. Injury start date (adjusts for final game of series edge case) 2. Return date based on injury duration -3. Week rollover when games exceed 4 per week +3. Week rollover when games exceed the max for that week (4 regular season, 5-7 playoffs) -**Example:** +**Examples:** + +Regular Season: ``` /injury set-new Mike Trout 5 2 4 ``` This records an injury occurring in week 5, game 2, with player out for 4 games (returns week 6, game 2). +Playoffs: +``` +/injury set-new Shohei Ohtani 19 3 2 +``` +This records an injury in playoff round 1 (week 19), game 3, with player out for 2 games (returns week 19, game 5). + +``` +/injury set-new Aaron Judge 20 5 8 +``` +This records an injury in playoff round 2 (week 20), game 5, with player out for 8 games (spans multiple weeks). + **Response:** - Confirmation embed with injury details - Player's name, position, and team @@ -479,6 +497,34 @@ The legacy injury commands were located in: - `discord-app/cogs/players.py` - `set_injury_slash()` and `clear_injury_slash()` - `discord-app/cogs/players.py` - `injury_roll_slash()` with manual rating/games input +## Configuration + +The injury system uses configuration constants from `config.py` to validate week and game numbers: + +### Season Structure +```python +weeks_per_season: int = 18 # Regular season weeks +games_per_week: int = 4 # Games per week in regular season +playoff_weeks_per_season: int = 3 # Playoff weeks (19-21) +playoff_round_one_games: int = 5 # Week 19: Best of 5 +playoff_round_two_games: int = 7 # Week 20: Best of 7 +playoff_round_three_games: int = 7 # Week 21: Best of 7 +``` + +These constants are used in: +- **`views/modals.py`**: `InjuryRollModal` and `ClearInjuryModal` for week/game validation +- **Validation Logic**: Ensures proper game number ranges based on week (regular season vs playoff rounds) + +### Week/Game Limits +The injury system automatically enforces proper limits based on the week: + +| Week Range | Season Phase | Max Games | Series Type | +|------------|--------------|-----------|-------------| +| 1-18 | Regular | 4 | N/A | +| 19 | Playoff R1 | 5 | Best of 5 | +| 20 | Playoff R2 | 7 | Best of 7 | +| 21 | Playoff R3 | 7 | Best of 7 | + ### Key Improvements 1. **Cleaner Command Structure:** Using GroupCog for organized subcommands (`/injury roll`, `/injury set-new`, `/injury clear`) @@ -492,6 +538,7 @@ The legacy injury commands were located in: 9. **Testability:** Comprehensive unit tests (26 tests) with mocked API calls 10. **Modern UI:** Consistent embed-based responses with color coding 11. **Official Tables:** Complete Strat-o-Matic injury tables built into the command +12. **Playoff Support:** Full support for injury rolls during playoff weeks with series-specific game limits (October 2025) ### Migration Details @@ -514,6 +561,9 @@ Players must have their `injury_rating` field updated to the new format for the --- -**Last Updated:** January 2025 +**Last Updated:** October 2025 **Version:** 2.0 **Status:** Active + +**Recent Updates:** +- **October 2025**: Added playoff support with series-specific game validation (weeks 19-21) From 1f2b3e58ed5ce0346bcec0c42b644b3f78f49cf5 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Wed, 29 Oct 2025 13:00:14 -0500 Subject: [PATCH 2/2] All pings on /cc --- commands/custom_commands/main.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/commands/custom_commands/main.py b/commands/custom_commands/main.py index 31367d7..3e38e95 100644 --- a/commands/custom_commands/main.py +++ b/commands/custom_commands/main.py @@ -62,13 +62,21 @@ class CustomCommandsCommands(commands.Cog): # description=response_content, # color=EmbedColors.PRIMARY # ) - + # # Add creator info in footer # embed.set_footer( # text=f"Created by {command.creator.username} • Used {command.use_count} times" # ) - - await interaction.followup.send(content=response_content) + + # Send with mentions enabled (users and roles, but not @everyone/@here) + await interaction.followup.send( + content=response_content, + allowed_mentions=discord.AllowedMentions( + users=True, # Allow user mentions (<@123456789>) + roles=True, # Allow role mentions (<@&987654321>) + everyone=False # Block @everyone/@here (already validated) + ) + ) @execute_custom_command.autocomplete('name') async def execute_custom_command_autocomplete(