Fix !rank
This commit is contained in:
parent
adb1614177
commit
cbe88a1721
1 changed files with 6 additions and 4 deletions
|
@ -84,10 +84,11 @@ namespace Geekbot.net.Commands.User.Ranking
|
||||||
int guildMessages = 0;
|
int guildMessages = 0;
|
||||||
if (type == RankType.messages)
|
if (type == RankType.messages)
|
||||||
{
|
{
|
||||||
guildMessages = _database.Messages
|
// guildMessages = _database.Messages
|
||||||
.Where(e => e.GuildId.Equals(Context.Guild.Id.AsLong()))
|
// .Where(e => e.GuildId.Equals(Context.Guild.Id.AsLong()))
|
||||||
.Select(e => e.MessageCount)
|
// .Select(e => e.MessageCount)
|
||||||
.Sum();
|
// .Sum();
|
||||||
|
guildMessages = (int) _redis.Db.HashGet($"{Context.Guild.Id}:Messages", 0.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
var highscoreUsers = new Dictionary<RankUserDto, int>();
|
var highscoreUsers = new Dictionary<RankUserDto, int>();
|
||||||
|
@ -158,6 +159,7 @@ namespace Geekbot.net.Commands.User.Ranking
|
||||||
return _redis.Db
|
return _redis.Db
|
||||||
.HashGetAll($"{Context.Guild.Id}:Messages").ToDictionary().Take(amount + 1)
|
.HashGetAll($"{Context.Guild.Id}:Messages").ToDictionary().Take(amount + 1)
|
||||||
.Where(user => !user.Key.Equals(0))
|
.Where(user => !user.Key.Equals(0))
|
||||||
|
.OrderByDescending(s => s.Value)
|
||||||
.ToDictionary(user => ulong.Parse(user.Key), user => int.Parse(user.Value));
|
.ToDictionary(user => ulong.Parse(user.Key), user => int.Parse(user.Value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue