Don't consider it an error if there is nothing to export

With --after, no new messages in the given period will now result in an empty export, rather than an error exit.
This commit is contained in:
Leonardo Mosquera 2025-03-03 17:27:38 -03:00
parent b39d015133
commit ebbad6db06

View file

@ -40,10 +40,10 @@ public class ChannelExporter(DiscordClient discord)
// Check if the 'after' boundary is valid // Check if the 'after' boundary is valid
if (request.After is not null && !request.Channel.MayHaveMessagesAfter(request.After.Value)) if (request.After is not null && !request.Channel.MayHaveMessagesAfter(request.After.Value))
{ {
throw new DiscordChatExporterException( console.Error.WriteLine(
$"Channel '{request.Channel.Name}' " $"NOTE: Channel '{request.Channel.Name}' "
+ $"of guild '{request.Guild.Name}' " + $"of guild '{request.Guild.Name}' "
+ $"does not contain any messages within the specified period." + $"does not contain any messages within the specified period; an empty file will be created."
); );
} }