aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Mark <[email protected]>2024-02-09 22:35:55 -0800
committerGravatar Mark <[email protected]>2024-02-09 22:42:38 -0800
commitca846dc77c6a1ffb2ea0de2b898446db265c56c7 (patch)
treed2acbb9632492133848f326165d6513bf97f63b9
parentBump sentry-sdk from 1.40.2 to 1.40.3 (#2919) (diff)
Reminders: show updated timestamp
When a reminder's duration is updated, show the new timestamp in the confirmation message that is sent. Resolve #2172
-rw-r--r--bot/exts/utils/reminders.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bot/exts/utils/reminders.py b/bot/exts/utils/reminders.py
index 07e014dd0..c79e0499c 100644
--- a/bot/exts/utils/reminders.py
+++ b/bot/exts/utils/reminders.py
@@ -459,7 +459,10 @@ class Reminders(Cog):
For example, to edit a reminder to expire in 3 days and 1 minute, you can do `!remind edit duration 1234 3d1M`.
"""
- await self.edit_reminder(ctx, id_, {"expiration": expiration.isoformat()})
+ formatted_time = time.discord_timestamp(expiration, time.TimestampFormats.DAY_TIME)
+ message = f"It will arrive on {formatted_time}."
+
+ await self.edit_reminder(ctx, id_, {"expiration": expiration.isoformat()}, message)
@edit_reminder_group.command(name="content", aliases=("reason",))
async def edit_reminder_content(self, ctx: Context, id_: int, *, content: str | None = None) -> None:
@@ -490,7 +493,7 @@ class Reminders(Cog):
await self.edit_reminder(ctx, id_, {"mentions": mention_ids})
@lock_arg(LOCK_NAMESPACE, "id_", raise_error=True)
- async def edit_reminder(self, ctx: Context, id_: int, payload: dict) -> None:
+ async def edit_reminder(self, ctx: Context, id_: int, payload: dict, message: str = "") -> None:
"""Edits a reminder with the given payload, then sends a confirmation message."""
if not await self._can_modify(ctx, id_):
return
@@ -499,7 +502,7 @@ class Reminders(Cog):
# Send a confirmation message to the channel
await self._send_confirmation(
ctx,
- on_success="That reminder has been edited successfully!",
+ on_success=" ".join(("That reminder has been edited successfully!", message)).rstrip(),
reminder_id=id_,
)
await self._reschedule_reminder(reminder)