From e0ad1fc3373b17be4d49859f79ca26310f2d3ae6 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Sun, 24 Sep 2023 16:59:45 -0400 Subject: [PATCH] fix(galaxy): pylint fixes --- galaxy/galaxy.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/galaxy/galaxy.py b/galaxy/galaxy.py index b915ea5..26b7e40 100644 --- a/galaxy/galaxy.py +++ b/galaxy/galaxy.py @@ -101,8 +101,7 @@ class Galaxy(commands.Cog): match = re.search(r'(?<=:)\d+(?=>)', input_string) if match: return int(match.group()) - else: - return input_string + return input_string @autoreact.command(name="emoji") @app_commands.describe(emoji="Which emoji are you setting Autoreact to use?") @@ -121,14 +120,14 @@ class Galaxy(commands.Cog): emoji_obj = emoji_to_find break else: - await interaction.response.send_message(content=f"You're trying to set the autoreact emoji to an emoji I don't have access to!", ephemeral=True) + await interaction.response.send_message(content="You're trying to set the autoreact emoji to an emoji I don't have access to!", ephemeral=True) return await self.config.guild(interaction.guild).autoreact_emoji.set(emoji_obj.id) embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"Autoreact's emoji has been set to {emoji_obj} ({emoji_obj.id}).") await interaction.response.send_message(embed=embed) else: await self.config.guild(interaction.guild).autoreact_emoji.set('💀') - embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"Autoreact's emoji has been set to 💀.") + embed=discord.Embed(color=await self.bot.get_embed_color(None), description="Autoreact's emoji has been set to 💀.") await interaction.response.send_message(embed=embed) @autoreact.command(name="set") @@ -146,7 +145,7 @@ class Galaxy(commands.Cog): async def autoreact_reset(self, interaction: discord.Interaction): """Resets Autoreact's target.""" await self.config.guild(interaction.guild).autoreact_target.set(0) - embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"Autoreact's target has been reset.") + embed=discord.Embed(color=await self.bot.get_embed_color(None), description="Autoreact's target has been reset.") await interaction.response.send_message(embed=embed) @commands.command() @@ -189,8 +188,8 @@ class Galaxy(commands.Cog): } try: insurance_dict[f'{ship_class}'] - except KeyError: - raise ValueError("Received value is not a valid ship class!") + except KeyError as error: + raise ValueError("Received value is not a valid ship class!") from error if ship_class == "super_capital": humanized_class = ship_class.replace("_", " ").title() else: @@ -348,7 +347,7 @@ class Galaxy(commands.Cog): @warehouse.error @unix.error - async def faq_handler(self, ctx, error): + async def faq_handler(self, error): """Error Handler for Galaxy.""" if isinstance(error, discord.NotFound): return