categorize forum channel messages are thread starter

This commit is contained in:
rambros 2026-03-25 12:35:22 +05:30
parent 8fe70dc9e0
commit 4b24b29c03
2 changed files with 9 additions and 0 deletions

View file

@ -543,7 +543,13 @@ class DiscordExporter:
content = msg.content or "" content = msg.content or ""
msg_type = int(msg.type.value) if hasattr(msg.type, "value") else 0 msg_type = int(msg.type.value) if hasattr(msg.type, "value") else 0
# Force MessageType.thread_starter_message (21) for forum post starter messages
if isinstance(msg.channel, discord.Thread) and isinstance(msg.channel.parent, discord.ForumChannel):
if msg.id == msg.channel.id:
msg_type = 21
is_forwarded = getattr(msg.flags, 'forwarded', False) is_forwarded = getattr(msg.flags, 'forwarded', False)
if is_forwarded and hasattr(msg, 'message_snapshots') and msg.message_snapshots: if is_forwarded and hasattr(msg, 'message_snapshots') and msg.message_snapshots:
msg_type = 100 # Custom Forward type msg_type = 100 # Custom Forward type
snapshot = msg.message_snapshots[0] snapshot = msg.message_snapshots[0]

View file

@ -184,6 +184,9 @@ class OperationPane(Container):
self.run_validate() self.run_validate()
def _base_dir(self) -> str: def _base_dir(self) -> str:
# If the config file is in the root, our base directory is current (.)
if str(self.config_path) == "reaper_config.yaml":
return "."
return f"ReaperFiles-{self.cfg_name}" return f"ReaperFiles-{self.cfg_name}"
def _rebuild_engine(self): def _rebuild_engine(self):