diff options
author | 2019-10-25 15:27:47 +0200 | |
---|---|---|
committer | 2019-10-25 15:27:47 +0200 | |
commit | 662f60d6a3267e51206e6793b1ca1ca7f2690a57 (patch) | |
tree | 5ade16d0cf00c2cc876c511f73b12237bc31f603 | |
parent | Merge pull request #543 from atmishra/moderator-channel-check (diff) | |
parent | Merge branch 'master' into reminder-up (diff) |
Merge pull request #466 from Akarys42/reminder-up
New reminder features
-rw-r--r-- | bot/cogs/reminders.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/bot/cogs/reminders.py b/bot/cogs/reminders.py index b54622306..81990704b 100644 --- a/bot/cogs/reminders.py +++ b/bot/cogs/reminders.py @@ -2,7 +2,7 @@ import asyncio import logging import random import textwrap -from datetime import datetime +from datetime import datetime, timedelta from operator import itemgetter from typing import Optional @@ -104,7 +104,10 @@ class Reminders(Scheduler, Cog): name="It has arrived!" ) - embed.description = f"Here's your reminder: `{reminder['content']}`" + embed.description = f"Here's your reminder: `{reminder['content']}`." + + if reminder.get("jump_url"): # keep backward compatibility + embed.description += f"\n[Jump back to when you created the reminder]({reminder['jump_url']})" if late: embed.colour = Colour.red() @@ -167,14 +170,18 @@ class Reminders(Scheduler, Cog): json={ 'author': ctx.author.id, 'channel_id': ctx.message.channel.id, + 'jump_url': ctx.message.jump_url, 'content': content, 'expiration': expiration.isoformat() } ) + now = datetime.utcnow() - timedelta(seconds=1) + # Confirm to the user that it worked. await self._send_confirmation( - ctx, on_success="Your reminder has been created successfully!" + ctx, + on_success=f"Your reminder will arrive in {humanize_delta(relativedelta(expiration, now))}!" ) loop = asyncio.get_event_loop() |