diff --git a/DiscordChatExporter.Core/Discord/Data/Message.cs b/DiscordChatExporter.Core/Discord/Data/Message.cs index 71a5828..cdda0ab 100644 --- a/DiscordChatExporter.Core/Discord/Data/Message.cs +++ b/DiscordChatExporter.Core/Discord/Data/Message.cs @@ -10,7 +10,7 @@ using JsonExtensions.Reading; namespace DiscordChatExporter.Core.Discord.Data; // https://discord.com/developers/docs/resources/channel#message-object -public partial record Message( +public record Message( Snowflake Id, MessageKind Kind, User Author, @@ -26,16 +26,6 @@ public partial record Message( IReadOnlyList MentionedUsers, MessageReference? Reference, Message? ReferencedMessage) : IHasId -{ - public bool IsEmpty => - Kind == MessageKind.Default && - string.IsNullOrEmpty(Content) && - !Attachments.Any() && - !Embeds.Any() && - !Stickers.Any(); -} - -public partial record Message { private static IReadOnlyList NormalizeEmbeds(IReadOnlyList embeds) { diff --git a/DiscordChatExporter.Core/Discord/DiscordClient.cs b/DiscordChatExporter.Core/Discord/DiscordClient.cs index 5c73284..9ec5b11 100644 --- a/DiscordChatExporter.Core/Discord/DiscordClient.cs +++ b/DiscordChatExporter.Core/Discord/DiscordClient.cs @@ -323,11 +323,6 @@ public class DiscordClient if (message.Timestamp > lastMessage.Timestamp) yield break; - // Make sure the messages are not empty when exporting via a bot - // https://github.com/Tyrrrz/DiscordChatExporter/issues/918 - if (_resolvedTokenKind == TokenKind.Bot && message.IsEmpty && !message.Author.IsBot) - throw DiscordChatExporterException.MessageContentIntentMissing(); - // Report progress based on the duration of exported messages divided by total if (progress is not null) { diff --git a/DiscordChatExporter.Core/Exceptions/DiscordChatExporterException.cs b/DiscordChatExporter.Core/Exceptions/DiscordChatExporterException.cs index 97ec6d8..7543c5f 100644 --- a/DiscordChatExporter.Core/Exceptions/DiscordChatExporterException.cs +++ b/DiscordChatExporter.Core/Exceptions/DiscordChatExporterException.cs @@ -41,7 +41,4 @@ Failed to perform an HTTP request. internal static DiscordChatExporterException ChannelIsEmpty() => new("No messages found for the specified period."); - - internal static DiscordChatExporterException MessageContentIntentMissing() => - new("Failed to retrieve message content because the bot doesn't have the Message Content Intent enabled."); } \ No newline at end of file