Shorten error messages for when attempting to export a period with no messages (#1201)

This commit is contained in:
Oleksii Holub 2024-02-13 19:13:38 +02:00 committed by GitHub
parent 7c04db40f8
commit c0ea57e9b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,8 +20,8 @@ public class ChannelExporter(DiscordClient discord)
if (request.Channel.Kind == ChannelKind.GuildForum) if (request.Channel.Kind == ChannelKind.GuildForum)
{ {
throw new DiscordChatExporterException( throw new DiscordChatExporterException(
$"Channel '{request.Channel.Name}' (#{request.Channel.Id}) " $"Channel '{request.Channel.Name}' "
+ $"of guild '{request.Guild.Name}' (#{request.Guild.Id}) " + $"of guild '{request.Guild.Name}' "
+ $"is a forum and cannot be exported directly. " + $"is a forum and cannot be exported directly. "
+ "You need to pull its threads and export them individually." + "You need to pull its threads and export them individually."
); );
@ -31,8 +31,8 @@ public class ChannelExporter(DiscordClient discord)
if (request.Channel.IsEmpty) if (request.Channel.IsEmpty)
{ {
throw new DiscordChatExporterException( throw new DiscordChatExporterException(
$"Channel '{request.Channel.Name}' (#{request.Channel.Id}) " $"Channel '{request.Channel.Name}' "
+ $"of guild '{request.Guild.Name}' (#{request.Guild.Id}) " + $"of guild '{request.Guild.Name}' "
+ $"does not contain any messages." + $"does not contain any messages."
); );
} }
@ -41,8 +41,8 @@ public class ChannelExporter(DiscordClient discord)
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( throw new DiscordChatExporterException(
$"Channel '{request.Channel.Name}' (#{request.Channel.Id}) " $"Channel '{request.Channel.Name}' "
+ $"of guild '{request.Guild.Name}' (#{request.Guild.Id}) " + $"of guild '{request.Guild.Name}' "
+ $"does not contain any messages within the specified period." + $"does not contain any messages within the specified period."
); );
} }
@ -54,8 +54,8 @@ public class ChannelExporter(DiscordClient discord)
) )
{ {
throw new DiscordChatExporterException( throw new DiscordChatExporterException(
$"Channel '{request.Channel.Name}' (#{request.Channel.Id}) " $"Channel '{request.Channel.Name}' "
+ $"of guild '{request.Guild.Name}' (#{request.Guild.Id}) " + $"of guild '{request.Guild.Name}' "
+ $"does not contain any messages within the specified period." + $"does not contain any messages within the specified period."
); );
} }