Round to seconds when time is over a minute in !ping
This commit is contained in:
parent
373200f4be
commit
25b9340266
1
echo.py
1
echo.py
|
@ -13,6 +13,7 @@ class EchoBot(Plugin):
|
||||||
elif abs(diff) < 60 * 1_000:
|
elif abs(diff) < 60 * 1_000:
|
||||||
return f"{round(diff / 1_000, 1)} seconds"
|
return f"{round(diff / 1_000, 1)} seconds"
|
||||||
minutes, seconds = divmod(diff / 1_000, 60)
|
minutes, seconds = divmod(diff / 1_000, 60)
|
||||||
|
seconds = round(seconds)
|
||||||
if abs(minutes) < 60:
|
if abs(minutes) < 60:
|
||||||
return f"{minutes} minutes and {seconds} seconds"
|
return f"{minutes} minutes and {seconds} seconds"
|
||||||
hours, minutes = divmod(minutes, 60)
|
hours, minutes = divmod(minutes, 60)
|
||||||
|
|
Loading…
Reference in a new issue