Created quiz leaderboard
This commit is contained in:
@@ -77,6 +77,12 @@ class QuizPlayersDB:
|
||||
cursor.execute(sql)
|
||||
self.discorddbconn.get_db().commit()
|
||||
|
||||
def get_top_players(self, 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)}"
|
||||
cursor.execute(sql)
|
||||
return list(cursor.fetchall())
|
||||
|
||||
def close(self):
|
||||
self.discorddbconn.close()
|
||||
|
||||
@@ -209,7 +215,6 @@ class PlayerDBLinker:
|
||||
serverdb_cursor.execute(sql)
|
||||
return list(serverdb_cursor.fetchall())
|
||||
|
||||
|
||||
def close(self):
|
||||
self.discorddbconn.close()
|
||||
self.serverdbconn.close()
|
||||
|
||||
Reference in New Issue
Block a user