modify ;quotecategories command to order by the ammount of quotes a category has

This commit is contained in:
fzorb 2024-10-22 11:11:42 +03:00
parent 19b4c97134
commit 48cb0bf8e2

View File

@ -43,7 +43,7 @@ module QuoteSystem
end end
command(:quotecategories, aliases: [:qc]) do |event, *message| 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(' ')}") event.channel.send_message("**Categories**: #{categories[0..].join(' ')}")
nil nil
end end