Skip to content

Commit 09069ff

Browse files
authored
fix: show forwarded message in logviewer.
Signed-off-by: lorenzo132 <50767078+lorenzo132@users.noreply.github.com>
1 parent 88f00f7 commit 09069ff

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

core/thread.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@ async def snooze(self, moderator=None, command_used=None, snooze_for=None):
205205
"messages": [
206206
{
207207
"author_id": m.author.id,
208-
"content": m.content,
208+
"content": (
209+
(m.content or "")
210+
+ (("\n" + extract_forwarded_content(m)) if extract_forwarded_content(m) else "")
211+
).strip(),
209212
"attachments": [a.url for a in m.attachments],
210213
"embeds": [e.to_dict() for e in m.embeds],
211214
"created_at": m.created_at.isoformat(),
@@ -224,16 +227,12 @@ async def snooze(self, moderator=None, command_used=None, snooze_for=None):
224227
"author_name": (
225228
getattr(m.embeds[0].author, "name", "").split(" (")[0]
226229
if m.embeds and m.embeds[0].author and m.author == self.bot.user
227-
else getattr(m.author, "name", None)
228-
if m.author != self.bot.user
229-
else None
230+
else getattr(m.author, "name", None) if m.author != self.bot.user else None
230231
),
231232
"author_avatar": (
232233
getattr(m.embeds[0].author, "icon_url", None)
233234
if m.embeds and m.embeds[0].author and m.author == self.bot.user
234-
else m.author.display_avatar.url
235-
if m.author != self.bot.user
236-
else None
235+
else m.author.display_avatar.url if m.author != self.bot.user else None
237236
),
238237
}
239238
async for m in channel.history(limit=None, oldest_first=True)
@@ -259,6 +258,9 @@ async def snooze(self, moderator=None, command_used=None, snooze_for=None):
259258

260259
logging.info(f"[SNOOZE] DB update result: {result.modified_count}")
261260

261+
# Dispatch thread_snoozed event for plugins
262+
self.bot.dispatch("thread_snoozed", self, moderator, snooze_for)
263+
262264
behavior = behavior_pre
263265
if behavior == "move":
264266
# Move the channel to the snoozed category (if configured) and optionally apply a prefix
@@ -751,6 +753,9 @@ async def _ensure_genesis(force: bool = False):
751753
# Mark unsnooze as complete
752754
self._unsnoozing = False
753755

756+
# Dispatch thread_unsnoozed event for plugins
757+
self.bot.dispatch("thread_unsnoozed", self)
758+
754759
# Process queued commands
755760
await self._process_command_queue()
756761

0 commit comments

Comments
 (0)