From f1e763673bfbb09c3311993d2b5eaeae56403303 Mon Sep 17 00:00:00 2001 From: Seaswimmer Date: Fri, 12 Jul 2024 16:02:19 -0400 Subject: [PATCH] fix(aurora): legitimately the final pylint fixes for now --- aurora/models/moderation_types.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/aurora/models/moderation_types.py b/aurora/models/moderation_types.py index 3244ea2..0511333 100644 --- a/aurora/models/moderation_types.py +++ b/aurora/models/moderation_types.py @@ -803,12 +803,14 @@ class Tempban(Ban): parsed_time = parse_relativedelta(duration) if not parsed_time: await ctx.send(content=error("Please provide a valid duration!"), ephemeral=True) + return cls try: parsed_time = timedelta_from_relativedelta(parsed_time) except ValueError: await ctx.send(content=error("Please provide a valid duration!"), ephemeral=True) + return cls - response_message = await ctx.send(content=f"{target.mention} has been {cls.verb} for {humanize_timedelta(parsed_time)}!\n{bold(text='Reason:')} {inline(text=reason)}") + response_message = await ctx.send(content=f"{target.mention} has been {cls.verb} for {humanize_timedelta(timedelta=parsed_time)}!\n{bold(text='Reason:')} {inline(text=reason)}") if silent is False: try: @@ -838,7 +840,7 @@ class Tempban(Ban): duration=parsed_time, reason=reason ) - await response_message.edit(content=f"{target.mention} has been {cls.verb} for {humanize_timedelta(parsed_time)}! (Case {inline(text=f'#{moderation.id}')})\n{bold(text='Reason:')} {inline(reason)}") + await response_message.edit(content=f"{target.mention} has been {cls.verb} for {humanize_timedelta(timedelta=parsed_time)}! (Case {inline(text=f'#{moderation.id}')})\n{bold(text='Reason:')} {inline(reason)}") await log(ctx, moderation.id) await send_evidenceformat(ctx, moderation.id) return cls @@ -1033,14 +1035,16 @@ class Slowmode(Type): parsed_time = parse_relativedelta(argument=duration) if not parsed_time: await ctx.send(content=error(text="Please provide a valid duration!"), ephemeral=True) + return cls try: parsed_time = timedelta_from_relativedelta(relativedelta=parsed_time) except ValueError: await ctx.send(content=error(text="Please provide a valid duration!"), ephemeral=True) + return cls if ceil(parsed_time.total_seconds()) > 21600: await ctx.send(content=error(text="The slowmode duration cannot exceed 6 hours!"), ephemeral=True) - return + return cls if isinstance(target, TextChannel): await target.edit(slowmode_delay=ceil(parsed_time.total_seconds())) @@ -1055,7 +1059,7 @@ class Slowmode(Type): duration=parsed_time, reason=None ) - await ctx.send(content=f"{ctx.author.mention} has {cls.verb} {target.mention} to {humanize_timedelta(parsed_time)}!\n{bold(text='Reason:')} {inline(text=reason)}") + await ctx.send(content=f"{ctx.author.mention} has {cls.verb} {target.mention} to {humanize_timedelta(timedelta=parsed_time)}!\n{bold(text='Reason:')} {inline(text=reason)}") await log(ctx=ctx, moderation_id=moderation.id) return cls