mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-05 18:58:53 -05:00
Fix error message edge case in parse_timedelta (#6357)
This commit is contained in:
parent
80d0bab29a
commit
47d4675f52
@ -151,13 +151,19 @@ def parse_timedelta(
|
||||
raise BadArgument(
|
||||
_(
|
||||
"This amount of time is too large for this command. (Maximum: {maximum})"
|
||||
).format(maximum=humanize_timedelta(timedelta=maximum))
|
||||
).format(
|
||||
maximum=humanize_timedelta(seconds=math.floor(maximum.total_seconds()))
|
||||
or _("0 seconds")
|
||||
)
|
||||
)
|
||||
if delta < minimum:
|
||||
raise BadArgument(
|
||||
_(
|
||||
"This amount of time is too small for this command. (Minimum: {minimum})"
|
||||
).format(minimum=humanize_timedelta(timedelta=minimum))
|
||||
).format(
|
||||
minimum=humanize_timedelta(seconds=math.ceil(minimum.total_seconds()))
|
||||
or _("0 seconds")
|
||||
)
|
||||
)
|
||||
return delta
|
||||
return None
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user