From ca846dc77c6a1ffb2ea0de2b898446db265c56c7 Mon Sep 17 00:00:00 2001 From: Mark <1515135+MarkKoz@users.noreply.github.com> Date: Fri, 9 Feb 2024 22:35:55 -0800 Subject: Reminders: show updated timestamp When a reminder's duration is updated, show the new timestamp in the confirmation message that is sent. Resolve #2172 --- bot/exts/utils/reminders.py | 9 ++++++--- 1 file 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) -- cgit v1.2.3