- Cleaning up IDE errors
This commit is contained in:
parent
5616cfec3a
commit
61e5c7999b
@ -85,7 +85,7 @@ class ScorebugCommands(commands.Cog):
|
||||
|
||||
# Store the scorecard in the tracker
|
||||
self.scorecard_tracker.publish_scorecard(
|
||||
text_channel_id=interaction.channel_id,
|
||||
text_channel_id=interaction.channel_id, # type: ignore
|
||||
sheet_url=url,
|
||||
publisher_id=interaction.user.id
|
||||
)
|
||||
@ -94,7 +94,7 @@ class ScorebugCommands(commands.Cog):
|
||||
embed = EmbedTemplate.success(
|
||||
title="Scorecard Published",
|
||||
description=(
|
||||
f"Your scorecard has been published to {interaction.channel.mention}\n\n"
|
||||
f"Your scorecard has been published to {interaction.channel.mention}\n\n" # type: ignore
|
||||
f"**Sheet:** {scorecard.title}\n"
|
||||
f"**Status:** Live tracking enabled\n"
|
||||
f"**Scorecard:** {scorecard_link}\n\n"
|
||||
@ -158,7 +158,7 @@ class ScorebugCommands(commands.Cog):
|
||||
await interaction.response.defer()
|
||||
|
||||
# Check if a scorecard is published in this channel
|
||||
sheet_url = self.scorecard_tracker.get_scorecard(interaction.channel_id)
|
||||
sheet_url = self.scorecard_tracker.get_scorecard(interaction.channel_id) # type: ignore
|
||||
|
||||
if not sheet_url:
|
||||
embed = EmbedTemplate.error(
|
||||
@ -201,7 +201,7 @@ class ScorebugCommands(commands.Cog):
|
||||
await interaction.edit_original_response(content=None, embed=embed)
|
||||
|
||||
# Update timestamp in tracker
|
||||
self.scorecard_tracker.update_timestamp(interaction.channel_id)
|
||||
self.scorecard_tracker.update_timestamp(interaction.channel_id) # type: ignore
|
||||
|
||||
except SheetsException as e:
|
||||
embed = EmbedTemplate.error(
|
||||
|
||||
@ -148,7 +148,7 @@ class PlayerStatsView(BaseView):
|
||||
show_pitching=self.show_pitching)
|
||||
|
||||
except Exception as e:
|
||||
self.logger.error("Failed to update embed", error=str(e), exc_info=True)
|
||||
self.logger.error("Failed to update embed", error=e, exc_info=True)
|
||||
|
||||
# Try to send error message
|
||||
try:
|
||||
@ -172,12 +172,10 @@ class PlayerStatsView(BaseView):
|
||||
|
||||
# Determine embed color based on team
|
||||
embed_color = EmbedColors.PRIMARY
|
||||
if hasattr(player, 'team') and player.team and hasattr(player.team, 'color'):
|
||||
try:
|
||||
# Convert hex color string to int
|
||||
embed_color = int(player.team.color, 16)
|
||||
except (ValueError, TypeError):
|
||||
embed_color = EmbedColors.PRIMARY
|
||||
if player.team and player.team.color:
|
||||
embed_color = int(player.team.color, 16)
|
||||
else:
|
||||
embed_color = EmbedColors.PRIMARY
|
||||
|
||||
# Create base embed with player name as title
|
||||
# Add injury indicator emoji if player is injured
|
||||
@ -204,7 +202,7 @@ class PlayerStatsView(BaseView):
|
||||
|
||||
# Add Major League affiliate if this is a Minor League team
|
||||
if player.team.roster_type() == RosterType.MINOR_LEAGUE:
|
||||
major_affiliate = player.team.get_major_league_affiliate()
|
||||
major_affiliate = player.team.major_league_affiliate()
|
||||
if major_affiliate:
|
||||
embed.add_field(
|
||||
name="Major Affiliate",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user