Trying to fix !rank again

This commit is contained in:
runebaas 2018-08-26 12:33:04 +02:00
parent cbe88a1721
commit 707be4abe2
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6

View file

@ -157,9 +157,10 @@ namespace Geekbot.net.Commands.User.Ranking
// .Take(amount) // .Take(amount)
// .ToDictionary(key => key.UserId.AsUlong(), key => key.MessageCount); // .ToDictionary(key => key.UserId.AsUlong(), key => key.MessageCount);
return _redis.Db return _redis.Db
.HashGetAll($"{Context.Guild.Id}:Messages").ToDictionary().Take(amount + 1) .HashGetAll($"{Context.Guild.Id}:Messages")
.Where(user => !user.Key.Equals(0)) .Where(user => !user.Key.Equals(0))
.OrderByDescending(s => s.Value) .OrderByDescending(s => s.Value)
.Take(amount)
.ToDictionary(user => ulong.Parse(user.Key), user => int.Parse(user.Value)); .ToDictionary(user => ulong.Parse(user.Key), user => int.Parse(user.Value));
} }