Add support for !rank quote

This commit is contained in:
Daan Boerlage 2020-12-30 23:31:15 +01:00
parent 17f62d7607
commit 8bdf2e9681
Signed by: daan
GPG key ID: FCE070E1E4956606
3 changed files with 16 additions and 3 deletions

View file

@ -147,8 +147,8 @@ namespace Geekbot.Bot.Commands.Utils.Quote
.Where(row => row.GuildId == Context.Guild.Id.AsLong())
.GroupBy(row => row.UserId)
.Select(row => new { userId = row.Key, amount = row.Count()})
.OrderBy(row => row.amount)
.Last();
.OrderByDescending(row => row.amount)
.First();
var mostQuotedPersonUser = Context.Client.GetUserAsync(mostQuotedPerson.userId.AsUlong()).Result ?? new UserPolyfillDto {Username = "Unknown User"};
var quotesByYear = _database.Quotes