fix(aurora): fix some ruff errors
Some checks failed
Actions / Build Documentation (MkDocs) (push) Has been skipped
Actions / Build Documentation (MkDocs) (pull_request) Has been skipped
Actions / Lint Code (Ruff & Pylint) (push) Failing after 43s
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 43s

This commit is contained in:
cswimr 2025-01-25 19:45:04 +00:00
parent 3d4c438f37
commit 374a083528
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087

View file

@ -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"])