mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -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(
|
raise BadArgument(
|
||||||
_(
|
_(
|
||||||
"This amount of time is too large for this command. (Maximum: {maximum})"
|
"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:
|
if delta < minimum:
|
||||||
raise BadArgument(
|
raise BadArgument(
|
||||||
_(
|
_(
|
||||||
"This amount of time is too small for this command. (Minimum: {minimum})"
|
"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 delta
|
||||||
return None
|
return None
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user