From 27a460fa6e4cbefe4cdc63a445c7d0bf6f8013bf Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Wed, 8 Jan 2025 10:27:15 -0500 Subject: [PATCH] refactor(commands): use format_duration for cooldown message --- core.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core.py b/core.py index 3a272cb..b09c65c 100644 --- a/core.py +++ b/core.py @@ -48,10 +48,12 @@ async def on_message(message, edited=False): try: if cooldowns := command_cooldowns.get(message.author.id): - if (end_time := cooldowns.get(matched)) and time.time() < end_time: + if (end_time := cooldowns.get(matched)) and int(time.time()) < int( + end_time + ): await utils.reply( message, - f"please wait **{round(end_time - time.time(), 1)}s** before using this command again!", + f"please wait **{utils.format_duration(int(end_time - time.time()), natural=True)}** before using this command again!", ) return