.liqu can be ordered by keywords (default) or id now, closes #1857

This commit is contained in:
Master Kwoth
2017-11-20 02:48:09 +01:00
parent 8fb21d1a3e
commit a0c5b469b8
5 changed files with 23 additions and 9 deletions

View File

@ -26,17 +26,16 @@ namespace NadekoBot.Modules.Utility
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
public async Task ListQuotes(int page = 1)
public async Task ListQuotes(int page = 1, OrderType order = OrderType.Keyword)
{
page -= 1;
if (page < 0)
return;
IEnumerable<Quote> quotes;
using (var uow = _db.UnitOfWork)
{
quotes = uow.Quotes.GetGroup(Context.Guild.Id, page * 16, 16);
quotes = uow.Quotes.GetGroup(Context.Guild.Id, page, order);
}
if (quotes.Any())