fix(moderation): added a check to mute that prevents a discord api hour from timing someone out for longer than 28 days
All checks were successful
Pylint / Pylint (push) Successful in 1m13s

This commit is contained in:
Seaswimmer 2023-10-04 21:39:36 -04:00
parent 0deb589198
commit d3951f6548
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -202,6 +202,9 @@ class Moderation(commands.Cog):
except ValueError:
await ctx.message.reply(f"Please provide a valid duration!\nSee `{ctx.prefix}tdc`")
return
if parsed_time.days > 28:
await ctx.send("Please provide a duration that is less than 28 days.")
return
await target.timeout(parsed_time)
response = await ctx.send(content=f"{target.mention} has been muted for {humanize.precisedelta(parsed_time)}!\n**Reason** - `{reason}`")
try: