Added streak leaderboard
This commit is contained in:
@@ -98,9 +98,9 @@ class QuizPlayersDB:
|
||||
cursor.execute(sql)
|
||||
self.discorddbconn.get_db().commit()
|
||||
|
||||
def get_top_players(self, limit = 20):
|
||||
def get_top_players(self, column, limit = 20):
|
||||
cursor = self.discorddbconn.get_cursor(dictionary=True)
|
||||
sql = f"SELECT discordid, wins as stat FROM {self.tablename} ORDER BY wins DESC LIMIT {str(limit)}"
|
||||
sql = f"SELECT discordid, {column} as stat FROM {self.tablename} ORDER BY {column} DESC LIMIT {str(limit)}"
|
||||
cursor.execute(sql)
|
||||
return list(cursor.fetchall())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user