- 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
|
# Store the scorecard in the tracker
|
||||||
self.scorecard_tracker.publish_scorecard(
|
self.scorecard_tracker.publish_scorecard(
|
||||||
text_channel_id=interaction.channel_id,
|
text_channel_id=interaction.channel_id, # type: ignore
|
||||||
sheet_url=url,
|
sheet_url=url,
|
||||||
publisher_id=interaction.user.id
|
publisher_id=interaction.user.id
|
||||||
)
|
)
|
||||||
@ -94,7 +94,7 @@ class ScorebugCommands(commands.Cog):
|
|||||||
embed = EmbedTemplate.success(
|
embed = EmbedTemplate.success(
|
||||||
title="Scorecard Published",
|
title="Scorecard Published",
|
||||||
description=(
|
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"**Sheet:** {scorecard.title}\n"
|
||||||
f"**Status:** Live tracking enabled\n"
|
f"**Status:** Live tracking enabled\n"
|
||||||
f"**Scorecard:** {scorecard_link}\n\n"
|
f"**Scorecard:** {scorecard_link}\n\n"
|
||||||
@ -158,7 +158,7 @@ class ScorebugCommands(commands.Cog):
|
|||||||
await interaction.response.defer()
|
await interaction.response.defer()
|
||||||
|
|
||||||
# Check if a scorecard is published in this channel
|
# 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:
|
if not sheet_url:
|
||||||
embed = EmbedTemplate.error(
|
embed = EmbedTemplate.error(
|
||||||
@ -201,7 +201,7 @@ class ScorebugCommands(commands.Cog):
|
|||||||
await interaction.edit_original_response(content=None, embed=embed)
|
await interaction.edit_original_response(content=None, embed=embed)
|
||||||
|
|
||||||
# Update timestamp in tracker
|
# 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:
|
except SheetsException as e:
|
||||||
embed = EmbedTemplate.error(
|
embed = EmbedTemplate.error(
|
||||||
|
|||||||
@ -148,7 +148,7 @@ class PlayerStatsView(BaseView):
|
|||||||
show_pitching=self.show_pitching)
|
show_pitching=self.show_pitching)
|
||||||
|
|
||||||
except Exception as e:
|
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 to send error message
|
||||||
try:
|
try:
|
||||||
@ -172,12 +172,10 @@ class PlayerStatsView(BaseView):
|
|||||||
|
|
||||||
# Determine embed color based on team
|
# Determine embed color based on team
|
||||||
embed_color = EmbedColors.PRIMARY
|
embed_color = EmbedColors.PRIMARY
|
||||||
if hasattr(player, 'team') and player.team and hasattr(player.team, 'color'):
|
if player.team and player.team.color:
|
||||||
try:
|
embed_color = int(player.team.color, 16)
|
||||||
# Convert hex color string to int
|
else:
|
||||||
embed_color = int(player.team.color, 16)
|
embed_color = EmbedColors.PRIMARY
|
||||||
except (ValueError, TypeError):
|
|
||||||
embed_color = EmbedColors.PRIMARY
|
|
||||||
|
|
||||||
# Create base embed with player name as title
|
# Create base embed with player name as title
|
||||||
# Add injury indicator emoji if player is injured
|
# 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
|
# Add Major League affiliate if this is a Minor League team
|
||||||
if player.team.roster_type() == RosterType.MINOR_LEAGUE:
|
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:
|
if major_affiliate:
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name="Major Affiliate",
|
name="Major Affiliate",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user