|
|
@ -333,10 +333,9 @@ public class DiscordClient
|
|
|
|
IProgress<Percentage>? progress = null,
|
|
|
|
IProgress<Percentage>? progress = null,
|
|
|
|
[EnumeratorCancellation] CancellationToken cancellationToken = default)
|
|
|
|
[EnumeratorCancellation] CancellationToken cancellationToken = default)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Get the last message in the specified range.
|
|
|
|
// Get the last message in the specified range, so we can later calculate progress based on its date.
|
|
|
|
// This snapshots the boundaries, which means that messages posted after the export started
|
|
|
|
// This also snapshots the boundaries, which means that messages posted after the export started
|
|
|
|
// will not appear in the output.
|
|
|
|
// will not appear in the output.
|
|
|
|
// Additionally, it provides the date of the last message, which is used to calculate progress.
|
|
|
|
|
|
|
|
var lastMessage = await TryGetLastMessageAsync(channelId, before, cancellationToken);
|
|
|
|
var lastMessage = await TryGetLastMessageAsync(channelId, before, cancellationToken);
|
|
|
|
if (lastMessage is null || lastMessage.Timestamp < after?.ToDate())
|
|
|
|
if (lastMessage is null || lastMessage.Timestamp < after?.ToDate())
|
|
|
|
yield break;
|
|
|
|
yield break;
|
|
|
|