From 348ae34dd35c2fcf96e39aa0943fc60e7a3c9f9e Mon Sep 17 00:00:00 2001 From: c0de Date: Mon, 3 Oct 2022 19:41:02 -0500 Subject: [PATCH] Add !points command Trying to parse this "PointsService"... wtf is even going on there --- GhostBallBot/game.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/GhostBallBot/game.py b/GhostBallBot/game.py index eb90c49..c6ace88 100644 --- a/GhostBallBot/game.py +++ b/GhostBallBot/game.py @@ -4,6 +4,8 @@ import uuid +import dateparser + from .database.models import database, GameModel, GuessModel class Game: @@ -85,6 +87,8 @@ class Game: # TODO: Determine differences + await self.message.channel.send("Difference calculation is not currently available") + # stop and discard game self.is_running = False self.game = None @@ -112,9 +116,18 @@ class Game: return await self.message.add_reaction(emoji="\N{THUMBS UP SIGN}") async def points(self): - database.connect() + # database.connect() - database.close() + value = self.message.content.split() + try: + if len(value) > 1: + timestamp = dateparser.parse(value[1]) + except: + return await self.message.channel.send("Invalid timestamp. Try again") + + # database.close() + + return await self.message.channel.send("Sorry, not implemented yet") async def help(self): # TODO: Add help message