Give away the previous target word when resetting a wordle game, if it hadn't been found.

This commit is contained in:
2022-04-18 19:26:15 +02:00
parent 049a343bc3
commit dac2a5170f

View File

@@ -46,6 +46,9 @@ class Game:
self.tried = None
async def reset(self):
output = ""
if self.target and not self.winner:
output = f"Le mot précédent était : `{self.target}`\n\n"
self.target = random.choice(tuple(x for x in target_words if len(x) >= WORDLE_MINLENGTH))
self.winner = None
self.tries = 0
@@ -53,7 +56,8 @@ class Game:
self.scores = defaultdict(int)
self.tried = set()
await self.channel.edit(slowmode_delay=WORDLE_SLOWMODE)
await self.channel.send(f"Il y a un nouveau mot à deviner ! Il fait {len(self.target)} lettres.")
output += f"Il y a un nouveau mot à deviner ! Il fait {len(self.target)} lettres."
await self.channel.send(output)
async def parse(self, message):
guess = unidecode(message.content.strip()).upper()