Fixed MessageCache GetMany with Before direction

This commit is contained in:
RogueException
2016-10-06 05:06:25 -03:00
parent 5415b8f8f6
commit bb1fc2c42a

View File

@@ -61,8 +61,10 @@ namespace Discord.WebSocket
else
cachedMessageIds = _orderedMessages.Where(x => x > fromMessageId.Value);
if (dir == Direction.Before)
cachedMessageIds = cachedMessageIds.Reverse();
return cachedMessageIds
.Take(limit)
.Select(x =>
{
SocketMessage msg;
@@ -71,6 +73,7 @@ namespace Discord.WebSocket
return null;
})
.Where(x => x != null)
.Take(limit)
.ToImmutableArray();
}
}