Prechádzať zdrojové kódy

Improve GBP leaderboard

- Add header
- User server nicknames
Frans Bergman 3 rokov pred
rodič
commit
7d0c0dba0a
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      main.rb

+ 1 - 1
main.rb

@@ -248,7 +248,7 @@ end
 
 bot.command(:leaderboard, description: "Show who's got the most Good Boy Points (GBP).") do |_event|
     results = db.query "SELECT user_id, received FROM gbp ORDER BY received DESC"
-    results.each_with_index.map{|row, i| "#{i + 1}. #{bot.users[row[0]].username} - #{row[1]}"}.join("\n")
+    "**Good Boy Points (GBP) Leaderboard**\n" + results.each_with_index.map{|row, i| "#{i + 1}. #{_event.server.member(row[0]).nick} - #{row[1]}"}.join("\n")
 end
 
 bot.voice_state_update() do |_event|