slowmode should properly error out on 7 hours now (#3453)

This commit is contained in:
Michael H 2020-01-26 20:01:22 -05:00 committed by Kowlin
parent a664615a2d
commit 97a9fde5fd

View File

@ -282,14 +282,15 @@ else:
async def convert(self, ctx: "Context", argument: str) -> timedelta:
if self.default_unit and argument.isdecimal():
delta = timedelta(**{self.default_unit: int(argument)})
else:
argument = argument + self.default_unit
delta = parse_timedelta(
argument,
minimum=self.minimum,
maximum=self.maximum,
allowed_units=self.allowed_units,
)
if delta is not None:
return delta
raise BadArgument() # This allows this to be a required argument.