From 0db16e8859d1f092c0bfe64a6e0b7ee44bf4a9f5 Mon Sep 17 00:00:00 2001 From: ShiroKSH Date: Tue, 14 Jul 2026 13:57:57 +0300 Subject: [PATCH] fix: align reverse range handling --- DiscordChatExporter.Core/Discord/DiscordClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;