From 9dc3fe77bd8e75cfebdaae4c4af39b877da18f3d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Nov 2019 19:18:35 -0400 Subject: [PATCH] added retry after --- r0b3bot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/r0b3bot.py b/r0b3bot.py index 97c437f..deba6a3 100644 --- a/r0b3bot.py +++ b/r0b3bot.py @@ -38,14 +38,15 @@ hassapi = remote.API(HASS_IP_ADDRESS, HASS_API_KEY) @bot.event async def on_command_error(error, ctx): - print(error) + print(error.retry_after) if isinstance(error, commands.CommandOnCooldown): msg = 'This command is ratelimited, please try again in {:.2f}s'.format(error.retry_after) - await bot.send_message(ctx.message.channel, msg) + await ctx.send_message(ctx.message.channel, msg) else: print('Oopsie, I found an error...') print(f"Error: {error}") + @bot.event async def on_ready(): print('Logged in as')