diff --git a/Points.py b/Points.py index df9c779..e180215 100644 --- a/Points.py +++ b/Points.py @@ -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)