aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar bast <[email protected]>2025-02-13 17:45:10 -0800
committerGravatar bast <[email protected]>2025-02-13 17:47:02 -0800
commitf3e3c8afc36754887791e28f02bc8f220e99c35a (patch)
treeeaa1e3b6c8190fed3f769239467fd7dbcbdb684f
parentPermit !remindme with no specified content (diff)
Clean up extraneous logic and typing variance now that reminders always have content
-rw-r--r--bot/exts/utils/reminders.py11
1 files 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",))