Skip to content

Commit

Permalink
Clean up extraneous logic and typing variance now that reminders alwa…
Browse files Browse the repository at this point in the history
…ys have content
  • Loading branch information
bast0006 committed Feb 14, 2025
1 parent a8cd139 commit f3e3c8a
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions bot/exts/utils/reminders.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ async def send_reminder(self, reminder: dict, expected_time: time.Timestamp | No
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.
"""
Expand Down Expand Up @@ -345,9 +345,6 @@ async def new_reminder(
# 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(
Expand Down Expand Up @@ -469,9 +466,7 @@ async def edit_reminder_content(self, ctx: Context, id_: int, *, content: str |
"""
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",))
Expand Down

0 comments on commit f3e3c8a

Please sign in to comment.