mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-21 10:25:09 -04:00
Remove message content intent check due to false positives
This commit is contained in:
parent
8695942328
commit
2259f19c44
3 changed files with 1 additions and 19 deletions
|
@ -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<User> 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<Embed> NormalizeEmbeds(IReadOnlyList<Embed> embeds)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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.");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue