mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
slowmode should properly error out on 7 hours now (#3453)
This commit is contained in:
parent
a664615a2d
commit
97a9fde5fd
@ -282,14 +282,15 @@ else:
|
|||||||
|
|
||||||
async def convert(self, ctx: "Context", argument: str) -> timedelta:
|
async def convert(self, ctx: "Context", argument: str) -> timedelta:
|
||||||
if self.default_unit and argument.isdecimal():
|
if self.default_unit and argument.isdecimal():
|
||||||
delta = timedelta(**{self.default_unit: int(argument)})
|
argument = argument + self.default_unit
|
||||||
else:
|
|
||||||
delta = parse_timedelta(
|
delta = parse_timedelta(
|
||||||
argument,
|
argument,
|
||||||
minimum=self.minimum,
|
minimum=self.minimum,
|
||||||
maximum=self.maximum,
|
maximum=self.maximum,
|
||||||
allowed_units=self.allowed_units,
|
allowed_units=self.allowed_units,
|
||||||
)
|
)
|
||||||
|
|
||||||
if delta is not None:
|
if delta is not None:
|
||||||
return delta
|
return delta
|
||||||
raise BadArgument() # This allows this to be a required argument.
|
raise BadArgument() # This allows this to be a required argument.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user