WIP: Aurora V3 #48

Draft
cswimr wants to merge 21 commits from aurora/v3 into main
Showing only changes of commit 0a0bd10075 - Show all commits

View file

@ -939,7 +939,12 @@ class Slowmode(Type):
return cls()
if isinstance(target, TextChannel):
await target.edit(slowmode_delay=ceil(timedelta_interval.total_seconds()), reason=f"Slowmode set by {ctx.author.id} for: {reason}")
if reason:
await target.edit(slowmode_delay=ceil(timedelta_interval.total_seconds()), reason=f"Slowmode set by {ctx.author.id} for: {reason}")
else:
await target.edit(slowmode_delay=ceil(timedelta_interval.total_seconds()), reason=f"Slowmode set by {ctx.author.id}")
reason = "No reason given."
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=timedelta_interval)}!\n{bold(text='Reason:')} {inline(text=reason)}")