From 6c63c612131592ecaf2172de3a706841a800a108 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Tue, 21 Oct 2025 20:22:57 -0500 Subject: [PATCH] CLAUDE: Add Free Agency destination to /ilmove command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enhancement: Allow releasing players to Free Agency via /ilmove Changes: - Added "Free Agency" as destination choice in command options - Updated destination_map to include "fa" -> RosterType.FREE_AGENCY - Added logic to fetch FA team from config (free_agent_team_id: 498) - Set to_team correctly: FA team when releasing, user team otherwise This allows users to immediately release players to Free Agency for current week, complementing the existing ML/MiL/IL destination options. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- commands/transactions/ilmove.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/commands/transactions/ilmove.py b/commands/transactions/ilmove.py index fe169ae..cfc7662 100644 --- a/commands/transactions/ilmove.py +++ b/commands/transactions/ilmove.py @@ -45,13 +45,14 @@ class ILMoveCommands(commands.Cog): ) @app_commands.describe( player="Player name; begin typing for autocomplete", - destination="Where to move the player: Major League, Minor League, or Injured List" + destination="Where to move the player: Major League, Minor League, Injured List, or Free Agency" ) @app_commands.autocomplete(player=player_autocomplete) @app_commands.choices(destination=[ app_commands.Choice(name="Major League", value="ml"), app_commands.Choice(name="Minor League", value="mil"), - app_commands.Choice(name="Injured List", value="il") + app_commands.Choice(name="Injured List", value="il"), + app_commands.Choice(name="Free Agency", value="fa") ]) @logged_command("/ilmove") async def ilmove( @@ -124,7 +125,7 @@ class ILMoveCommands(commands.Cog): Args: builder: TransactionBuilder instance player_name: Name of player to move - destination_str: Destination string (ml, mil, il) + destination_str: Destination string (ml, mil, il, fa) Returns: Tuple of (success: bool, error_message: str) @@ -162,6 +163,7 @@ class ILMoveCommands(commands.Cog): "ml": RosterType.MAJOR_LEAGUE, "mil": RosterType.MINOR_LEAGUE, "il": RosterType.INJURED_LIST, + "fa": RosterType.FREE_AGENCY, } to_roster = destination_map.get(destination_str.lower()) @@ -202,13 +204,24 @@ class ILMoveCommands(commands.Cog): if from_roster is None: return False, f"{player.name} is not on your roster" + # Determine destination team (Free Agency if releasing player) + if to_roster == RosterType.FREE_AGENCY: + config = get_config() + fa_team = await team_service.get_team(config.free_agent_team_id) + if not fa_team: + self.logger.error(f"Could not load Free Agency team (ID: {config.free_agent_team_id})") + return False, "Could not load Free Agency team. Please try again." + to_team = fa_team + else: + to_team = builder.team + # Create move move = TransactionMove( player=player, from_roster=from_roster, to_roster=to_roster, from_team=builder.team, - to_team=builder.team + to_team=to_team ) success, error_message = builder.add_move(move)