puntentelling: sort + format
This commit is contained in:
@@ -70,12 +70,12 @@ class Points(object):
|
||||
"""Hoeveel punten heeft iedereen?
|
||||
"""
|
||||
|
||||
#TODO format
|
||||
#TODO sort
|
||||
message = "De puntentelling: \n"
|
||||
message = "**De puntentelling:** \n```"
|
||||
pointsCount = np.load('pointscount.npy').item()
|
||||
for user in pointsCount:
|
||||
message += str(pointsCount[user]["points"]) + " " + pointsCount[user]["name"] + "\n"
|
||||
pointsCountSorted = sorted(pointsCount.items(), key=lambda i: i[1]['points'], reverse=True)
|
||||
for user in pointsCountSorted:
|
||||
message += str(user[1]["points"]).rjust(4) + " " + user[1]["name"] + "\n"
|
||||
message += "```"
|
||||
yield from ctx.channel.send(message)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user