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: 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.