Skip to content

Commit 6c23d29

Browse files
committed
Resolve git requests.
1 parent dff4a62 commit 6c23d29

2 files changed

Lines changed: 16 additions & 17 deletions

File tree

core/clients.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ async def append_log(
678678
),
679679
"mod": not isinstance(message.channel, DMChannel),
680680
},
681-
"content": message.content,
681+
"content": extract_forwarded_content(message) or message.content,
682682
"type": type_,
683683
"attachments": [
684684
{

core/thread.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,7 @@ async def snooze(self, moderator=None, command_used=None, snooze_for=None):
261261
{"channel_id": str(self.channel.id)},
262262
{"$set": {"snoozed": True, "snooze_data": self.snooze_data}},
263263
)
264-
import logging
265-
266-
logging.info(f"[SNOOZE] DB update result: {result.modified_count}")
264+
logger.info("[SNOOZE] DB update result: %s", result.modified_count)
267265

268266
# Dispatch thread_snoozed event for plugins
269267
self.bot.dispatch("thread_snoozed", self, moderator, snooze_for)
@@ -729,9 +727,7 @@ async def _ensure_genesis(force: bool = False):
729727
"$unset": {"snoozed": "", "snooze_data": ""},
730728
},
731729
)
732-
import logging
733-
734-
logging.info(f"[UNSNOOZE] DB update result: {result.modified_count}")
730+
logger.info("[UNSNOOZE] DB update result: %s", result.modified_count)
735731
# Notify in the configured channel
736732
notify_channel = self.bot.config.get("unsnooze_notify_channel") or "thread"
737733
notify_text = self.bot.config.get("unsnooze_text") or "This thread has been unsnoozed and restored."
@@ -3037,16 +3033,19 @@ async def callback(self, interaction: discord.Interaction):
30373033
# If channel isn't ready, we can't really invoke a command in it.
30383034
continue
30393035

3040-
from unittest.mock import MagicMock
3041-
3042-
# Create a mock message strictly for command invocation context
3043-
mock_msg = MagicMock(spec=discord.Message)
3044-
mock_msg.id = 0
3045-
mock_msg.channel = ch
3046-
mock_msg.guild = self.outer_thread.bot.modmail_guild
3047-
mock_msg.content = self.outer_thread.bot.prefix + al
3048-
mock_msg.author = self.outer_thread.bot.user
3049-
synthetic = DummyMessage(mock_msg)
3036+
# Create a minimal message-like object for command invocation context
3037+
stub_msg = SimpleNamespace(
3038+
id=0,
3039+
channel=ch,
3040+
guild=self.outer_thread.bot.modmail_guild,
3041+
content=self.outer_thread.bot.prefix + al,
3042+
author=self.outer_thread.bot.user,
3043+
attachments=[],
3044+
embeds=[],
3045+
stickers=[],
3046+
type=discord.MessageType.default,
3047+
)
3048+
synthetic = DummyMessage(stub_msg)
30503049

30513050
try:
30523051
synthetic.author = (

0 commit comments

Comments
 (0)