diff options
| author | 2019-02-17 17:37:25 +0530 | |
|---|---|---|
| committer | 2019-02-17 17:37:25 +0530 | |
| commit | 061c3becb872282f0a7a257e582c246340fa8549 (patch) | |
| tree | 3c4f369eab0cd0f89d83d38869b2382801f41681 /bot/seasons/evergreen/error_handler.py | |
| parent | Merge pull request #111 from astieman/RollMethod (diff) | |
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)
Diffstat (limited to 'bot/seasons/evergreen/error_handler.py')
| -rw-r--r-- | bot/seasons/evergreen/error_handler.py | 5 |
1 files changed, 4 insertions, 1 deletions
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(
|