aboutsummaryrefslogtreecommitdiffstats
path: root/bot
diff options
context:
space:
mode:
authorGravatar scragly <[email protected]>2019-02-27 16:49:07 +1000
committerGravatar GitHub <[email protected]>2019-02-27 16:49:07 +1000
commit49b62496af48c0fadec7ceb9ce5cf3bfa68e6914 (patch)
treec765ffb2badf080213b841399a3129e1389b1edc /bot
parentMerge pull request #123 from RohanJnr/valentine_zodiac_iceman (diff)
parentchanged variable name from message to time_remaining (diff)
Merge pull request #120 from RohanJnr/small_changes_iceman
added help message for .savethedate and edited the error_message for cooldown error
Diffstat (limited to 'bot')
-rw-r--r--bot/seasons/evergreen/error_handler.py5
-rw-r--r--bot/seasons/valentines/savethedate.py3
2 files changed, 7 insertions, 1 deletions
diff --git a/bot/seasons/evergreen/error_handler.py b/bot/seasons/evergreen/error_handler.py
index 6de35e60..47e18a31 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)
+ 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 {math.ceil(error.retry_after)}s."
+ f" please retry in {time_remaining}."
)
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'])