diff --git a/aurora/aurora.py b/aurora/aurora.py index 8702e52..2cfd78a 100644 --- a/aurora/aurora.py +++ b/aurora/aurora.py @@ -585,10 +585,10 @@ class Aurora(commands.Cog): try: before = parse(before) except (ParserError, OverflowError) as e: - if e == ParserError: + if isinstance(e, ParserError): await interaction.response.send_message(content=error("Invalid date format for `before` parameter!"), ephemeral=True) return - if e == OverflowError: + if isinstance(e, OverflowError): await interaction.response.send_message(content=error("Date is too far in the future!"), ephemeral=True) return @@ -596,10 +596,10 @@ class Aurora(commands.Cog): try: after = parse(after) except (ParserError, OverflowError) as e: - if e == ParserError: + if isinstance(e, ParserError): await interaction.response.send_message(content=error("Invalid date format for `after` parameter!"), ephemeral=True) return - if e == OverflowError: + if isinstance(e, OverflowError): await interaction.response.send_message(content=error("Date is too far in the future!"), ephemeral=True) return @@ -607,10 +607,10 @@ class Aurora(commands.Cog): try: on = parse(on) except (ParserError, OverflowError) as e: - if e == ParserError: + if isinstance(e, ParserError): await interaction.response.send_message(content=error("Invalid date format for `on` parameter!"), ephemeral=True) return - if e == OverflowError: + if isinstance(e, OverflowError): await interaction.response.send_message(content=error("Date is too far in the future!"), ephemeral=True) return @@ -777,9 +777,9 @@ class Aurora(commands.Cog): try: success, msg = await moderation.resolve(interaction.user.id, reason) except (ValueError, TypeError) as e: - if e == ValueError: + if isinstance(e, ValueError): await interaction.response.send_message(content=error("This case has already been resolved!"), ephemeral=True) - elif e == TypeError: + elif isinstance(e, TypeError): await interaction.response.send_message(content=error("This case type cannot be resolved!"), ephemeral=True) embed = await case_factory( @@ -1142,9 +1142,9 @@ class Aurora(commands.Cog): parsed_date = parse(date) await ctx.send(f"`{parsed_date}`") except (ParserError, OverflowError) as e: - if e == ParserError: + if isinstance(e, ParserError): await ctx.send(error("Invalid date format!")) - if e == OverflowError: + if isinstance(e, OverflowError): await ctx.send(error("Date is too far in the future!")) @aurora_convert.command(aliases=["td"])