Explorar o código

Improve GBP leaderboard

- Add header
- User server nicknames
Frans Bergman %!s(int64=3) %!d(string=hai) anos
pai
achega
7d0c0dba0a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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|