aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/exts/moderation/clean.py17
-rw-r--r--bot/exts/utils/reminders.py21
2 files changed, 15 insertions, 23 deletions
diff --git a/bot/exts/moderation/clean.py b/bot/exts/moderation/clean.py
index a7605460d..1f0a2dce4 100644
--- a/bot/exts/moderation/clean.py
+++ b/bot/exts/moderation/clean.py
@@ -368,14 +368,15 @@ class Clean(Cog):
f"A log of the deleted messages can be found [here]({log_url})."
)
- await send_log_message(
- self.bot,
- icon_url=Icons.message_bulk_delete,
- colour=Colour(Colours.soft_red),
- title="Bulk message delete",
- text=message,
- channel_id=Channels.mod_log,
- )
+ for channel_id in [Channels.mod_log, Channels.message_log]:
+ await send_log_message(
+ self.bot,
+ icon_url=Icons.message_bulk_delete,
+ colour=Colour(Colours.soft_red),
+ title="Bulk message delete",
+ text=message,
+ channel_id=channel_id,
+ )
return log_url
diff --git a/bot/exts/utils/reminders.py b/bot/exts/utils/reminders.py
index c79e0499c..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.
"""
@@ -263,13 +263,9 @@ class Reminders(Cog):
if isinstance((resolved_message := reference.resolved), discord.Message):
content = resolved_message.content
- # If we weren't able to get the content of a replied message
- if content is None:
- await send_denial(ctx, "Your reminder must have a content and/or reply to a message.")
- return None
-
- # If the replied message has no content (e.g. only attachments/embeds)
- if content == "":
+ # If the replied message has no content, we couldn't get the content, or no content was provided
+ # (e.g. only attachments/embeds)
+ if content is None or content == "":
content = "*See referenced message.*"
return content
@@ -349,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(
@@ -473,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",))