From 18986bcc4285561a09cfd5861a8f67e4b046aa03 Mon Sep 17 00:00:00 2001 From: aikaterna <20862007+aikaterna@users.noreply.github.com> Date: Sun, 25 Oct 2020 12:43:44 -0700 Subject: [PATCH] [Mod] Fix + more info for modset defaultduration (#4525) * [Mod] Fix + more info for modset defaultduration * Update settings.py * Duration must be greater than zero * Don't need the extra parens here --- redbot/cogs/mod/settings.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/redbot/cogs/mod/settings.py b/redbot/cogs/mod/settings.py index b482c7b64..22864f6d1 100644 --- a/redbot/cogs/mod/settings.py +++ b/redbot/cogs/mod/settings.py @@ -377,9 +377,20 @@ class ModSettings(MixinMeta): async def defaultduration( self, ctx: commands.Context, - duration: Optional[commands.TimedeltaConverter] = timedelta(days=0), + *, + duration: commands.TimedeltaConverter( + minimum=timedelta(seconds=1), default_unit="seconds" + ), ): - """Set the default time to be used when a user is tempbanned.""" + """Set the default time to be used when a user is tempbanned. + + Accepts: seconds, minutes, hours, days, weeks + `duration` must be greater than zero. + + Examples: + `[p]modset defaultduration 7d12h10m` + `[p]modset defaultduration 7 days 12 hours 10 minutes` + """ guild = ctx.guild await self.config.guild(guild).default_tempban_duration.set(duration.total_seconds()) await ctx.send(