From 4bdfe3ee0a03c295840cc9c9398d15ae52545e76 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Sat, 27 Dec 2025 20:15:14 -0600 Subject: [PATCH] Fix injury commands failing to find certain players MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed /injury roll, /injury set-new, and /injury clear to use search_players() instead of get_players_by_name(). The /players?name= API endpoint fails to find some players (e.g., Gunnar Henderson) while the /players/search?q= endpoint works correctly. This fixes the "Player Not Found" error when users try to clear injuries for players that exist in the database. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- VERSION | 2 +- commands/injuries/management.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 9bff926..10f67f4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.25.4 +2.25.5 diff --git a/commands/injuries/management.py b/commands/injuries/management.py index 9108711..b76e4fd 100644 --- a/commands/injuries/management.py +++ b/commands/injuries/management.py @@ -73,8 +73,8 @@ class InjuryGroup(app_commands.Group): if not current: raise BotException("Failed to get current season information") - # Search for player - players = await player_service.get_players_by_name(player_name, current.season) + # Search for player using the search endpoint (more reliable than name param) + players = await player_service.search_players(player_name, limit=10, season=current.season) if not players: embed = EmbedTemplate.error( @@ -389,8 +389,8 @@ class InjuryGroup(app_commands.Group): if not current: raise BotException("Failed to get current season information") - # Search for player - players = await player_service.get_players_by_name(player_name, current.season) + # Search for player using the search endpoint (more reliable than name param) + players = await player_service.search_players(player_name, limit=10, season=current.season) if not players: embed = EmbedTemplate.error( @@ -570,8 +570,8 @@ class InjuryGroup(app_commands.Group): if not current: raise BotException("Failed to get current season information") - # Search for player - players = await player_service.get_players_by_name(player_name, current.season) + # Search for player using the search endpoint (more reliable than name param) + players = await player_service.search_players(player_name, limit=10, season=current.season) if not players: embed = EmbedTemplate.error(