aboutsummaryrefslogtreecommitdiffstats
path: root/bot/cogs/reminders.py
diff options
context:
space:
mode:
authorGravatar Sebastiaan Zeeff <[email protected]>2019-11-15 14:49:25 +0100
committerGravatar GitHub <[email protected]>2019-11-15 14:49:25 +0100
commit077fbcdface7e1b85fd2f3dadbb1449758b9e4a3 (patch)
treebfee0c74b71a870363c3ab2bcdbb940487aebe78 /bot/cogs/reminders.py
parentgroup and order constants (diff)
parentMerge pull request #619 from python-discord/moderation-logging (diff)
Merge branch 'master' into doc-command
Diffstat (limited to '')
-rw-r--r--bot/cogs/reminders.py13
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()