diff --git a/aurora/models/moderation_types.py b/aurora/models/moderation_types.py index cc6eafb..3d8e613 100644 --- a/aurora/models/moderation_types.py +++ b/aurora/models/moderation_types.py @@ -933,15 +933,16 @@ class Slowmode(Type): async def handler(cls, ctx: commands.Context, target: Messageable, silent: bool, duration: str | None, reason: str, interval: int) -> "Slowmode": # pylint: disable=unused-argument """Set the slowmode in a channel.""" bot = ctx.bot - if ceil(interval) > 21600: + timedelta_interval = timedelta(seconds=interval) + if ceil(timedelta_interval.total_seconds()) > 21600: await ctx.send(content=error(text="The slowmode interval cannot exceed 6 hours!"), ephemeral=True) return cls() if isinstance(target, TextChannel): - await target.edit(slowmode_delay=ceil(interval)) + await target.edit(slowmode_delay=ceil(timedelta_interval.total_seconds()), reason=f"Slowmode set by {ctx.author.id} for: {reason}") assert ctx.guild moderation = await Moderation.log(bot=bot, guild_id=ctx.guild.id, moderator_id=ctx.author.id, moderation_type=cls(), target_type="channel", target_id=target.id, role_id=None, duration=None, reason=reason, metadata={"interval": interval}) - 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 ctx.send(content=f"{ctx.author.mention} has {cls.verb} {target.mention} to {humanize_timedelta(timedelta=timedelta_interval)}!\n{bold(text='Reason:')} {inline(text=reason)}") await log(ctx=ctx, moderation_id=moderation.id) return cls()