From 60493fbd77e554d9cfbd025ec8e12e24f95bbbd7 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Sun, 24 Sep 2023 16:33:13 -0400 Subject: [PATCH] misc(moderation): improved code structure --- cogs/moderation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cogs/moderation.py b/cogs/moderation.py index ce89ce7..321d277 100644 --- a/cogs/moderation.py +++ b/cogs/moderation.py @@ -28,7 +28,7 @@ class Moderation(commands.Cog): connection = mysql.connector.connect(host=db_host,user=db_user,password=db_password,database=db) return connection - def create_server_table(self, server): + def create_server_table(self, server: revolt.Server): database = Moderation.mysql_connect(self) cursor = database.cursor() try: @@ -84,7 +84,7 @@ class Moderation(commands.Cog): cursor.close() print("Tempban Handler run successful!") - def mysql_log(self, ctx: commands.Context, moderation_type, target_id, duration, reason): + def mysql_log(self, ctx: commands.Context, moderation_type: str, target_id: str, duration, reason:str ): timestamp = int(time.time()) if duration != "NULL": end_timedelta = datetime.fromtimestamp(timestamp) + duration @@ -229,7 +229,7 @@ class Moderation(commands.Cog): @commands.command(aliases=["tdc"]) - async def timedeltaconvert(self, ctx, *, duration): + async def timedeltaconvert(self, ctx: commands.Context, *, duration: str): required_role = utils.get(ctx.server.roles, id=required_role_id) if required_role not in ctx.author.roles: await ctx.message.reply("You do not have permission to use this command!")