Create multiple database contexts instead of one

This commit is contained in:
runebaas 2018-08-29 21:16:01 +02:00
parent d1e9992a8c
commit b0758eb119
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
5 changed files with 47 additions and 24 deletions

View file

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