From a0a263f0746aeac9854b148a2e3f3f480fa28847 Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Mon, 16 Oct 2023 17:22:28 +0300 Subject: [PATCH] Improve error message for forum channels Related to #1144 --- DiscordChatExporter.Core/Exporting/ChannelExporter.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/DiscordChatExporter.Core/Exporting/ChannelExporter.cs b/DiscordChatExporter.Core/Exporting/ChannelExporter.cs index 8bd53b0c..b4064fc1 100644 --- a/DiscordChatExporter.Core/Exporting/ChannelExporter.cs +++ b/DiscordChatExporter.Core/Exporting/ChannelExporter.cs @@ -22,11 +22,18 @@ public class ChannelExporter { // Forum channels don't have messages, they are just a list of threads if (request.Channel.Kind == ChannelKind.GuildForum) - throw new DiscordChatExporterException("Channel is a forum."); + { + throw new DiscordChatExporterException( + "Channel is a forum and cannot be exported directly. " + + "You need to pull its threads and export them individually." + ); + } // Check if the channel is empty if (request.Channel.IsEmpty) + { throw new DiscordChatExporterException("Channel does not contain any messages."); + } // Check if the 'after' boundary is valid if (request.After is not null && !request.Channel.MayHaveMessagesAfter(request.After.Value))