From 61e5c7999b1db08be5b897f73adffa903c477283 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Tue, 21 Oct 2025 10:58:08 -0500 Subject: [PATCH] - Cleaning up IDE errors --- commands/gameplay/scorebug.py | 8 ++++---- views/players.py | 14 ++++++-------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/commands/gameplay/scorebug.py b/commands/gameplay/scorebug.py index 901e48a..3d2bb9d 100644 --- a/commands/gameplay/scorebug.py +++ b/commands/gameplay/scorebug.py @@ -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( diff --git a/views/players.py b/views/players.py index 2c64dd8..8e56c4a 100644 --- a/views/players.py +++ b/views/players.py @@ -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",