Change guess update logic
This commit is contained in:
parent
f4bd33b4d5
commit
3dfbb247da
@ -152,8 +152,6 @@ class Game:
|
||||
"Invalid value. It must be between 1 and 1000 inclusive"
|
||||
)
|
||||
|
||||
# TODO: Check if the user tried to vote before, update their vote if so
|
||||
|
||||
player_guess, created = GuessModel.get_or_create(
|
||||
game_id=self.game.game_id,
|
||||
player_id=self.message.author.id,
|
||||
@ -161,13 +159,13 @@ class Game:
|
||||
)
|
||||
|
||||
player_guess.update(guess=value)
|
||||
if not created: # They updated their guess
|
||||
await self.message.channel.send(
|
||||
if created:
|
||||
return await self.message.add_reaction(emoji="\N{THUMBS UP SIGN}")
|
||||
|
||||
return await self.message.channel.send(
|
||||
f"<@{ str(self.message.author.id) }> your guess has been updated"
|
||||
)
|
||||
|
||||
return await self.message.add_reaction(emoji="\N{THUMBS UP SIGN}")
|
||||
|
||||
async def points(self):
|
||||
"""
|
||||
Points command - returns a table ordered from highest to lowest
|
||||
|
Loading…
Reference in New Issue
Block a user