diff --git a/DiscordChatExporter.Core/Discord/DiscordClient.cs b/DiscordChatExporter.Core/Discord/DiscordClient.cs index d551f4c9..8d5ef4c3 100644 --- a/DiscordChatExporter.Core/Discord/DiscordClient.cs +++ b/DiscordChatExporter.Core/Discord/DiscordClient.cs @@ -796,8 +796,8 @@ public class DiscordClient( foreach (var message in messages) { - // Messages are ordered newest to oldest, so no later message can satisfy this bound. - if (after is not null && message.Id.CompareTo(after.Value) <= 0) + // Ensure that the messages are in range + if (message.Timestamp <= after?.ToDate()) yield break; lastMessage ??= message;