From ea31731c8b498f1b878a2a321d56422ab38b8517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Sun, 18 Apr 2021 23:58:16 +0200 Subject: [PATCH] Update countdown --- main.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 571d8d1..65bda5c 100644 --- a/main.py +++ b/main.py @@ -64,13 +64,15 @@ async def reminders(ctx): countdown.seconds // 60 % 60, ) - the_final_countdown = "" - if days != 0: - the_final_countdown += f"{days} days, " - if hours != 0: - the_final_countdown += f"{hours} hours, " - if minutes != 0: - the_final_countdown += f"{minutes} minutes" + the_final_countdown = ", ".join( + f"{x} {y}{'s'*(x!=1)}" + for x, y in ( + (days, "day"), + (hours, "hour"), + (minutes, "minute"), + ) + if x + ) embed.add_field( name=f"{message}",