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:
parent
a814aadd61
commit
e3122fa23a
@ -113,7 +113,7 @@ class EnhancedPlayerCommands(commands.Cog):
|
|||||||
for player in players:
|
for player in players:
|
||||||
results.append({
|
results.append({
|
||||||
'name': player.name,
|
'name': player.name,
|
||||||
'detail': f"{player.primary_position} • WARA: {player.wara:.1f}",
|
'detail': f"{player.primary_position} • WARA: {player.wara:.2f}",
|
||||||
'player_obj': player
|
'player_obj': player
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -179,7 +179,7 @@ class TeamInfoCommands(commands.Cog):
|
|||||||
# Format: Position - Name (WARA)
|
# Format: Position - Name (WARA)
|
||||||
position = getattr(player, 'pos_1', 'N/A') or 'N/A'
|
position = getattr(player, 'pos_1', 'N/A') or 'N/A'
|
||||||
wara = getattr(player, 'wara', 0.0) or 0.0
|
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:
|
if core_text:
|
||||||
embed.add_field(name="Core Players", value=core_text, inline=False)
|
embed.add_field(name="Core Players", value=core_text, inline=False)
|
||||||
|
|||||||
@ -452,7 +452,7 @@ class TransactionCommands(commands.Cog):
|
|||||||
if current_roster and current_validation:
|
if current_roster and current_validation:
|
||||||
current_lines = []
|
current_lines = []
|
||||||
current_lines.append(f"**Players:** {current_validation.active_players} active, {current_validation.il_players} IL")
|
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:
|
if current_validation.errors:
|
||||||
current_lines.append(f"**❌ Errors:** {len(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:
|
if next_roster and next_validation:
|
||||||
next_lines = []
|
next_lines = []
|
||||||
next_lines.append(f"**Players:** {next_validation.active_players} active, {next_validation.il_players} IL")
|
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:
|
if next_validation.errors:
|
||||||
next_lines.append(f"**❌ Errors:** {len(next_validation.errors)}")
|
next_lines.append(f"**❌ Errors:** {len(next_validation.errors)}")
|
||||||
|
|||||||
@ -124,9 +124,9 @@ class RosterService:
|
|||||||
|
|
||||||
# WARA validation (if there are limits)
|
# WARA validation (if there are limits)
|
||||||
if validation.total_wara > 100: # Adjust based on league rules
|
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:
|
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")
|
logger.debug(f"Validated roster: legal={validation.is_legal}, {len(validation.errors)} errors, {len(validation.warnings)} warnings")
|
||||||
return validation
|
return validation
|
||||||
|
|||||||
@ -439,12 +439,15 @@ class DraftMonitorTask:
|
|||||||
sheet_url=sheet_url
|
sheet_url=sheet_url
|
||||||
)
|
)
|
||||||
|
|
||||||
# Mention the team's GM if available
|
# Mention the team's role (using team.lname)
|
||||||
gm_mention = ""
|
team_mention = ""
|
||||||
if next_pick.owner.gmid:
|
team_role = discord.utils.get(guild.roles, name=next_pick.owner.lname)
|
||||||
gm_mention = f"<@{next_pick.owner.gmid}> "
|
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}")
|
self.logger.info(f"Posted on-clock announcement for pick #{updated_draft_data.currentpick}")
|
||||||
|
|
||||||
# Reset poll interval to 30s for new pick
|
# Reset poll interval to 30s for new pick
|
||||||
|
|||||||
@ -707,7 +707,7 @@ class TransactionFreezeTask:
|
|||||||
|
|
||||||
for move in moves:
|
for move in moves:
|
||||||
move_string += (
|
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'
|
f'from {move.oldteam.abbrev} to {move.newteam.abbrev}\n'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -216,7 +216,7 @@ async def post_trade_to_log(
|
|||||||
sending_abbrev = txn.oldteam.abbrev
|
sending_abbrev = txn.oldteam.abbrev
|
||||||
|
|
||||||
moves_by_receiver[receiving_abbrev].append(
|
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
|
# Add a field for each team receiving players
|
||||||
|
|||||||
@ -94,7 +94,7 @@ class PlayerSelectionView(SelectMenuView):
|
|||||||
|
|
||||||
# Add WARA if available
|
# Add WARA if available
|
||||||
if player.wara is not None:
|
if player.wara is not None:
|
||||||
description += f" • WARA: {player.wara:.1f}"
|
description += f" • WARA: {player.wara:.2f}"
|
||||||
|
|
||||||
options.append(discord.SelectOption(
|
options.append(discord.SelectOption(
|
||||||
label=label,
|
label=label,
|
||||||
|
|||||||
@ -151,7 +151,7 @@ class SBAEmbedTemplate(EmbedTemplate):
|
|||||||
embed.add_field(name="Team", value=team_abbrev, inline=True)
|
embed.add_field(name="Team", value=team_abbrev, inline=True)
|
||||||
|
|
||||||
if wara is not None:
|
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(
|
embed.add_field(
|
||||||
name="Season",
|
name="Season",
|
||||||
|
|||||||
@ -212,7 +212,7 @@ class PlayerStatsView(BaseView):
|
|||||||
|
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name="sWAR",
|
name="sWAR",
|
||||||
value=f"{player.wara:.1f}",
|
value=f"{player.wara:.2f}",
|
||||||
inline=True
|
inline=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user