Tyrrrz / DiscordChatExporter

Exports Discord chat logs to a file
MIT License
7.65k stars 699 forks source link

Thread names get exported as `#deleted-channel` in mentions #1261

Open ShadowJonathan opened 3 months ago

ShadowJonathan commented 3 months ago

Version

2.43.3

Flavor

CLI (Command-Line Interface)

Platform

Linux (Debian)

Export format

HTML

Steps to reproduce

Details

This piece of code is relevant;

https://github.com/Tyrrrz/DiscordChatExporter/blob/281e0f608ad0784bce1dc2d2cc7b76e419905ebd/DiscordChatExporter.Core/Exporting/HtmlMarkdownVisitor.cs#L284

It only looks for a name of the channel, not of a thread.

Even discord seems to struggle, not fetching a corresponding thread, only saying #unknown

Checklist

Tyrrrz commented 3 months ago

The issue is that we don't preload all threads as we do with channels, so we can't resolve the mentions the same way:

https://github.com/Tyrrrz/DiscordChatExporter/blob/281e0f608ad0784bce1dc2d2cc7b76e419905ebd/DiscordChatExporter.Core/Exporting/ExportContext.cs#L34-L49

We should employ a strategy similar to members:

https://github.com/Tyrrrz/DiscordChatExporter/blob/281e0f608ad0784bce1dc2d2cc7b76e419905ebd/DiscordChatExporter.Core/Exporting/ExportContext.cs#L51-L86