forked from c0de/BaseballBot
Show table of points
This commit is contained in:
parent
bf8819fb46
commit
fbf588a85e
@ -234,15 +234,28 @@ class GameManager:
|
|||||||
Points command - returns a table ordered from highest to lowest
|
Points command - returns a table ordered from highest to lowest
|
||||||
of the players and their points
|
of the players and their points
|
||||||
"""
|
"""
|
||||||
# TODO
|
message = (
|
||||||
# value = self.message.content.split()
|
"Players, who played recently, with their points highest to lowest\n\n"
|
||||||
# try:
|
)
|
||||||
# if len(value) > 1:
|
message += "Player | Total Points | Last Played\n"
|
||||||
# timestamp = dateparser.parse(value[1])
|
|
||||||
# except:
|
|
||||||
# return await self.message.channel.send("Invalid timestamp. Try again")
|
|
||||||
|
|
||||||
return await self.message.channel.send("Sorry, not implemented yet")
|
players = Player.select(
|
||||||
|
Player.player_name, Player.total_points, Player.last_update
|
||||||
|
).order_by(Player.last_update.desc(), Player.total_points.desc())
|
||||||
|
|
||||||
|
for player in players:
|
||||||
|
message += (
|
||||||
|
" | ".join(
|
||||||
|
[
|
||||||
|
player.player_name,
|
||||||
|
str(player.total_points),
|
||||||
|
str(player.last_update)[:-10],
|
||||||
|
]
|
||||||
|
)
|
||||||
|
+ "\n"
|
||||||
|
)
|
||||||
|
|
||||||
|
return await self.message.channel.send(message)
|
||||||
|
|
||||||
async def help(self):
|
async def help(self):
|
||||||
"""help command"""
|
"""help command"""
|
||||||
|
Loading…
Reference in New Issue
Block a user