fix(moderation): pylint fixes
All checks were successful
Pylint / Pylint (push) Successful in 1m10s

This commit is contained in:
Seaswimmer 2023-10-05 09:47:53 -04:00
parent 4cbf552204
commit 21c9e28452
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -184,14 +184,14 @@ class Moderation(commands.Cog):
cursor.execute(f"SELECT moderation_id FROM `moderation_{guild_id}` ORDER BY moderation_id DESC LIMIT 1")
return cursor.fetchone()[0] + 1
async def embed_factory(self, type: str, guild: discord.Guild, reason: str, moderation_type: str, response: discord.InteractionMessage, duration: timedelta = None):
async def embed_factory(self, embed_type: str, guild: discord.Guild, reason: str, moderation_type: str, response: discord.InteractionMessage, duration: timedelta = None):
"""This method creates an embed from set parameters, meant for either moderation logging or contacting the moderated user.
Valid arguments for 'type':
Valid arguments for 'embed_type':
- 'message'
- 'log' - WIP
- 'case' - WIP"""
if type == 'message':
if embed_type == 'message':
if moderation_type in ["kicked", "banned", "unbanned"]:
guild_name = guild.name
else:
@ -205,7 +205,6 @@ class Moderation(commands.Cog):
embed.set_author(name=guild.name, icon_url=guild.icon.url)
embed.set_footer(text=f"Case #{await self.get_next_case_number(guild.id)}", icon_url="https://cdn.discordapp.com/attachments/1070822161389994054/1159469476773904414/arrow-right-circle-icon-512x512-2p1e2aaw.png?ex=65312319&is=651eae19&hm=3cebdd28e805c13a79ec48ef87c32ca532ffa6b9ede2e48d0cf8e5e81f3a6818&")
return embed
else:
raise(TypeError("'type' argument is invalid!"))
@app_commands.command(name="warn")
@ -228,7 +227,7 @@ class Moderation(commands.Cog):
try:
parsed_time = parse(sval=duration, as_timedelta=True, raise_exception=True)
except ValueError:
await interaction.response.send_message(f"Please provide a valid duration!", ephemeral=True)
await interaction.response.send_message("Please provide a valid duration!", ephemeral=True)
return
if parsed_time.total_seconds() / 1000 > 2419200000:
await interaction.response.send_message("Please provide a duration that is less than 28 days.")