From 061c3becb872282f0a7a257e582c246340fa8549 Mon Sep 17 00:00:00 2001 From: Rohan Date: Sun, 17 Feb 2019 17:37:25 +0530 Subject: I did the following changes: 1)Added a help text to .savethedate 2)Edited the error message for cooldowns so that it shows not only seconds remaining but also minutes(if cooldowntime>60 seconds) --- bot/seasons/evergreen/error_handler.py | 5 ++++- bot/seasons/valentines/savethedate.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'bot') diff --git a/bot/seasons/evergreen/error_handler.py b/bot/seasons/evergreen/error_handler.py index 6de35e60..c09a019e 100644 --- a/bot/seasons/evergreen/error_handler.py +++ b/bot/seasons/evergreen/error_handler.py @@ -42,9 +42,12 @@ class CommandErrorHandler: f"{ctx.author} called the command '{ctx.command}' " "but they were on cooldown!" ) + seconds = error.retry_after + remaining_minutes, remaining_seconds = divmod(seconds, 60) + error_message = f'{int(remaining_minutes)} minutes {math.ceil(remaining_seconds)} seconds' return await ctx.send( "This command is on cooldown," - f" please retry in {math.ceil(error.retry_after)}s." + f" please retry in {error_message}." ) if isinstance(error, commands.DisabledCommand): logging.debug( diff --git a/bot/seasons/valentines/savethedate.py b/bot/seasons/valentines/savethedate.py index a9bddd34..b9484be9 100644 --- a/bot/seasons/valentines/savethedate.py +++ b/bot/seasons/valentines/savethedate.py @@ -23,6 +23,9 @@ class SaveTheDate: @commands.command() async def savethedate(self, ctx): + """ + Gives you ideas for what to do on a date with your valentine. + """ with open(Path('bot', 'resources', 'valentines', 'date_ideas.json'), 'r', encoding="utf8") as f: valentine_dates = load(f) random_date = random.choice(valentine_dates['ideas']) -- cgit v1.2.3 From 984240c28f1520470e43deeb4c2629b6763eadda Mon Sep 17 00:00:00 2001 From: Rohan Date: Sun, 17 Feb 2019 21:16:54 +0530 Subject: Changed the variable name error_message to message --- bot/seasons/evergreen/error_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bot') diff --git a/bot/seasons/evergreen/error_handler.py b/bot/seasons/evergreen/error_handler.py index c09a019e..b594c688 100644 --- a/bot/seasons/evergreen/error_handler.py +++ b/bot/seasons/evergreen/error_handler.py @@ -44,10 +44,10 @@ class CommandErrorHandler: ) seconds = error.retry_after remaining_minutes, remaining_seconds = divmod(seconds, 60) - error_message = f'{int(remaining_minutes)} minutes {math.ceil(remaining_seconds)} seconds' + message = f'{int(remaining_minutes)} minutes {math.ceil(remaining_seconds)} seconds' return await ctx.send( "This command is on cooldown," - f" please retry in {error_message}." + f" please retry in {message}." ) if isinstance(error, commands.DisabledCommand): logging.debug( -- cgit v1.2.3 From 19c57bad4ed4546acb5c51ebed7466166acdc5bf Mon Sep 17 00:00:00 2001 From: Rohan Date: Sun, 17 Feb 2019 22:18:13 +0530 Subject: changed variable name from message to time_remaining --- bot/seasons/evergreen/error_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bot') diff --git a/bot/seasons/evergreen/error_handler.py b/bot/seasons/evergreen/error_handler.py index b594c688..47e18a31 100644 --- a/bot/seasons/evergreen/error_handler.py +++ b/bot/seasons/evergreen/error_handler.py @@ -44,10 +44,10 @@ class CommandErrorHandler: ) seconds = error.retry_after remaining_minutes, remaining_seconds = divmod(seconds, 60) - message = f'{int(remaining_minutes)} minutes {math.ceil(remaining_seconds)} seconds' + time_remaining = f'{int(remaining_minutes)} minutes {math.ceil(remaining_seconds)} seconds' return await ctx.send( "This command is on cooldown," - f" please retry in {message}." + f" please retry in {time_remaining}." ) if isinstance(error, commands.DisabledCommand): logging.debug( -- cgit v1.2.3