Fix sWAR display precision and draft team role pings

- Change sWAR formatting from 1 decimal to 2 decimal places across all displays
- Draft on-clock announcements now ping team role (via team.lname) instead of GM

🤖 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-12 18:41:46 -06:00
parent a814aadd61
commit e3122fa23a
10 changed files with 19 additions and 16 deletions

View File

@ -113,7 +113,7 @@ class EnhancedPlayerCommands(commands.Cog):
for player in players:
results.append({
'name': player.name,
'detail': f"{player.primary_position} • WARA: {player.wara:.1f}",
'detail': f"{player.primary_position} • WARA: {player.wara:.2f}",
'player_obj': player
})

View File

@ -179,7 +179,7 @@ class TeamInfoCommands(commands.Cog):
# Format: Position - Name (WARA)
position = getattr(player, 'pos_1', 'N/A') or 'N/A'
wara = getattr(player, 'wara', 0.0) or 0.0
core_text += f"{i}. {position} - {player.name} ({wara:.1f})\n"
core_text += f"{i}. {position} - {player.name} ({wara:.2f})\n"
if core_text:
embed.add_field(name="Core Players", value=core_text, inline=False)

View File

@ -452,7 +452,7 @@ class TransactionCommands(commands.Cog):
if current_roster and current_validation:
current_lines = []
current_lines.append(f"**Players:** {current_validation.active_players} active, {current_validation.il_players} IL")
current_lines.append(f"**sWAR:** {current_validation.total_sWAR:.1f}")
current_lines.append(f"**sWAR:** {current_validation.total_sWAR:.2f}")
if current_validation.errors:
current_lines.append(f"**❌ Errors:** {len(current_validation.errors)}")
@ -480,7 +480,7 @@ class TransactionCommands(commands.Cog):
if next_roster and next_validation:
next_lines = []
next_lines.append(f"**Players:** {next_validation.active_players} active, {next_validation.il_players} IL")
next_lines.append(f"**sWAR:** {next_validation.total_sWAR:.1f}")
next_lines.append(f"**sWAR:** {next_validation.total_sWAR:.2f}")
if next_validation.errors:
next_lines.append(f"**❌ Errors:** {len(next_validation.errors)}")

View File

@ -124,9 +124,9 @@ class RosterService:
# WARA validation (if there are limits)
if validation.total_wara > 100: # Adjust based on league rules
validation.warnings.append(f"High WARA total: {validation.total_wara:.1f}")
validation.warnings.append(f"High WARA total: {validation.total_wara:.2f}")
elif validation.total_wara < 20:
validation.warnings.append(f"Low WARA total: {validation.total_wara:.1f}")
validation.warnings.append(f"Low WARA total: {validation.total_wara:.2f}")
logger.debug(f"Validated roster: legal={validation.is_legal}, {len(validation.errors)} errors, {len(validation.warnings)} warnings")
return validation

View File

@ -439,12 +439,15 @@ class DraftMonitorTask:
sheet_url=sheet_url
)
# Mention the team's GM if available
gm_mention = ""
if next_pick.owner.gmid:
gm_mention = f"<@{next_pick.owner.gmid}> "
# Mention the team's role (using team.lname)
team_mention = ""
team_role = discord.utils.get(guild.roles, name=next_pick.owner.lname)
if team_role:
team_mention = f"{team_role.mention} "
else:
self.logger.warning(f"Could not find role for team {next_pick.owner.lname}")
await ping_channel.send(content=gm_mention, embed=embed)
await ping_channel.send(content=team_mention, embed=embed)
self.logger.info(f"Posted on-clock announcement for pick #{updated_draft_data.currentpick}")
# Reset poll interval to 30s for new pick

View File

@ -707,7 +707,7 @@ class TransactionFreezeTask:
for move in moves:
move_string += (
f'**{move.player.name}** ({move.player.wara:.1f}) '
f'**{move.player.name}** ({move.player.wara:.2f}) '
f'from {move.oldteam.abbrev} to {move.newteam.abbrev}\n'
)

View File

@ -216,7 +216,7 @@ async def post_trade_to_log(
sending_abbrev = txn.oldteam.abbrev
moves_by_receiver[receiving_abbrev].append(
f"**{txn.player.name}** ({txn.player.wara:.1f}) from {sending_abbrev}"
f"**{txn.player.name}** ({txn.player.wara:.2f}) from {sending_abbrev}"
)
# Add a field for each team receiving players

View File

@ -94,7 +94,7 @@ class PlayerSelectionView(SelectMenuView):
# Add WARA if available
if player.wara is not None:
description += f" • WARA: {player.wara:.1f}"
description += f" • WARA: {player.wara:.2f}"
options.append(discord.SelectOption(
label=label,

View File

@ -151,7 +151,7 @@ class SBAEmbedTemplate(EmbedTemplate):
embed.add_field(name="Team", value=team_abbrev, inline=True)
if wara is not None:
embed.add_field(name="WARA", value=f"{wara:.1f}", inline=True)
embed.add_field(name="WARA", value=f"{wara:.2f}", inline=True)
embed.add_field(
name="Season",

View File

@ -212,7 +212,7 @@ class PlayerStatsView(BaseView):
embed.add_field(
name="sWAR",
value=f"{player.wara:.1f}",
value=f"{player.wara:.2f}",
inline=True
)