From 0792ca769118d9793e7c5f9df67276581a0ed37a Mon Sep 17 00:00:00 2001 From: "Jacob P." Date: Wed, 24 Jan 2024 01:34:41 +0100 Subject: [PATCH] Add third parameter for ID of parent channel --- DiscordChatExporter.Core/Exporting/ExportRequest.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DiscordChatExporter.Core/Exporting/ExportRequest.cs b/DiscordChatExporter.Core/Exporting/ExportRequest.cs index d5af1f0b..411379e9 100644 --- a/DiscordChatExporter.Core/Exporting/ExportRequest.cs +++ b/DiscordChatExporter.Core/Exporting/ExportRequest.cs @@ -209,15 +209,16 @@ public partial class ExportRequest // We are looking for any structure in the path which contains either %y or %z. If the channel is a thread, we can resolve the placeholders, otherwise, that whole structure needs to be removed. string formattedPath = Regex.Replace( preFormattedPath, - @"\\[^\\]*%[yz][^\\]*\\", + @"\\[^\\]*%[xyz][^\\]*\\", m => channel.IsThread ? Regex.Replace( m.Value, - "%[yz]", + "%[xyz]", n => n.Value switch { + "%x" => channel.Parent?.Id.ToString() ?? "", "%y" => channel .Parent?.Position