From 48cb0bf8e2fe95e43f8da6885120b26f7e72f2c0 Mon Sep 17 00:00:00 2001 From: fzorb Date: Tue, 22 Oct 2024 11:11:42 +0300 Subject: [PATCH] modify ;quotecategories command to order by the ammount of quotes a category has --- systems/quote.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systems/quote.rb b/systems/quote.rb index b417735..de1f09b 100644 --- a/systems/quote.rb +++ b/systems/quote.rb @@ -43,7 +43,7 @@ module QuoteSystem end command(:quotecategories, aliases: [:qc]) do |event, *message| - categories = db.execute("SELECT DISTINCT category FROM quotes") + categories = db.execute("SELECT category FROM quotes GROUP BY category ORDER BY COUNT(*) DESC;") event.channel.send_message("**Categories**: #{categories[0..].join(' ')}") nil end