From 721fe198fc53aed16e20d82b3ba6d924b394d2cf Mon Sep 17 00:00:00 2001 From: phxntxm Date: Wed, 3 Aug 2016 20:40:35 -0500 Subject: [PATCH] Printing out the time left when a command is on cooldown --- bot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index cab6a90..57e6512 100644 --- a/bot.py +++ b/bot.py @@ -84,7 +84,9 @@ async def on_command_error(error, ctx): fmt = "You can't tell me what to do!" await bot.send_message(ctx.message.channel, fmt) elif isinstance(error, commands.CommandOnCooldown): - fmt = "This command is on cooldown! Hold your horses! >:c\nTry again in {}".format(error.retry_after) + m, s = divmod(error.retry_after, 60) + fmt = "This command is on cooldown! Hold your horses! >:c\nTry again in {} minutes and {} seconds"\ + .format(round(m), round(s)) await bot.send_message(ctx.message.channel, fmt) elif not isinstance(error, commands.CommandNotFound): with open("/home/phxntx5/public_html/Bonfire/error_log", 'a') as f: