Fix injury commands failing to find certain players

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 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2025-12-27 20:15:14 -06:00
parent a056dced5c
commit 4bdfe3ee0a
2 changed files with 7 additions and 7 deletions

View File

@ -1 +1 @@
2.25.4 2.25.5

View File

@ -73,8 +73,8 @@ class InjuryGroup(app_commands.Group):
if not current: if not current:
raise BotException("Failed to get current season information") raise BotException("Failed to get current season information")
# Search for player # Search for player using the search endpoint (more reliable than name param)
players = await player_service.get_players_by_name(player_name, current.season) players = await player_service.search_players(player_name, limit=10, season=current.season)
if not players: if not players:
embed = EmbedTemplate.error( embed = EmbedTemplate.error(
@ -389,8 +389,8 @@ class InjuryGroup(app_commands.Group):
if not current: if not current:
raise BotException("Failed to get current season information") raise BotException("Failed to get current season information")
# Search for player # Search for player using the search endpoint (more reliable than name param)
players = await player_service.get_players_by_name(player_name, current.season) players = await player_service.search_players(player_name, limit=10, season=current.season)
if not players: if not players:
embed = EmbedTemplate.error( embed = EmbedTemplate.error(
@ -570,8 +570,8 @@ class InjuryGroup(app_commands.Group):
if not current: if not current:
raise BotException("Failed to get current season information") raise BotException("Failed to get current season information")
# Search for player # Search for player using the search endpoint (more reliable than name param)
players = await player_service.get_players_by_name(player_name, current.season) players = await player_service.search_players(player_name, limit=10, season=current.season)
if not players: if not players:
embed = EmbedTemplate.error( embed = EmbedTemplate.error(