From f3e3c8afc36754887791e28f02bc8f220e99c35a Mon Sep 17 00:00:00 2001 From: bast Date: Thu, 13 Feb 2025 17:45:10 -0800 Subject: Clean up extraneous logic and typing variance now that reminders always have content --- bot/exts/utils/reminders.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/bot/exts/utils/reminders.py b/bot/exts/utils/reminders.py index 354444cb1..ccc5ac75a 100644 --- a/bot/exts/utils/reminders.py +++ b/bot/exts/utils/reminders.py @@ -252,9 +252,9 @@ class Reminders(Cog): await self.bot.api_client.delete(f"bot/reminders/{reminder['id']}") @staticmethod - async def try_get_content_from_reply(ctx: Context) -> str | None: + async def try_get_content_from_reply(ctx: Context) -> str: """ - Attempts to get content from the referenced message, if applicable. + Attempts to get content from the referenced message, if applicable, or provides a default. Differs from pydis_core.utils.commands.clean_text_or_reply as allows for messages with no content. """ @@ -345,9 +345,6 @@ class Reminders(Cog): # If `content` isn't provided then we try to get message content of a replied message if not content: content = await self.try_get_content_from_reply(ctx) - if not content: - # Couldn't get content from reply - return # Now we can attempt to actually set the reminder. reminder = await self.bot.api_client.post( @@ -469,9 +466,7 @@ class Reminders(Cog): """ if not content: content = await self.try_get_content_from_reply(ctx) - if not content: - # Message doesn't have a reply to get content from - return + await self.edit_reminder(ctx, id_, {"content": content}) @edit_reminder_group.command(name="mentions", aliases=("pings",)) -- cgit v1.2.3