mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[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
This commit is contained in:
parent
ce6c17debc
commit
18986bcc42
@ -377,9 +377,20 @@ class ModSettings(MixinMeta):
|
|||||||
async def defaultduration(
|
async def defaultduration(
|
||||||
self,
|
self,
|
||||||
ctx: commands.Context,
|
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
|
guild = ctx.guild
|
||||||
await self.config.guild(guild).default_tempban_duration.set(duration.total_seconds())
|
await self.config.guild(guild).default_tempban_duration.set(duration.total_seconds())
|
||||||
await ctx.send(
|
await ctx.send(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user