connexions: test

This commit is contained in:
Amazed 2020-09-26 18:00:38 +02:00
parent 8a448834f8
commit 4337af8d54

View File

@ -361,19 +361,19 @@ class WynncraftCog(commands.Cog):
async def connexions(self, ctx):
def td_format(seconds):
periods = [
('year', 60 * 60 * 24 * 365),
('month', 60 * 60 * 24 * 30),
('day', 60 * 60 * 24),
('hour', 60 * 60),
('an', 60 * 60 * 24 * 365),
('mois', 60 * 60 * 24 * 30),
('jour', 60 * 60 * 24),
('heure', 60 * 60),
('minute', 60),
('second', 1)
('seconde', 1)
]
strings = []
for period_name, period_seconds in periods:
if seconds > period_seconds:
period_value, seconds = divmod(seconds, period_seconds)
has_s = 's' if period_value > 1 else ''
has_s = 's' if period_value > 1 and period_name != "mois" else ''
strings.append("%s %s%s" % (int(period_value), period_name, has_s))
break