From ef7fda18d3e7a4da2d135ccc242100b9f8f035b8 Mon Sep 17 00:00:00 2001 From: ender <68495763+tookender@users.noreply.github.com> Date: Sun, 10 Nov 2024 21:59:34 +0100 Subject: [PATCH] pl --- extensions/utility/_base.py | 1 - extensions/utility/vocab.py | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/extensions/utility/_base.py b/extensions/utility/_base.py index 7cae00e..56af109 100644 --- a/extensions/utility/_base.py +++ b/extensions/utility/_base.py @@ -7,4 +7,3 @@ class UtilityBase(commands.Cog): def __init__(self, bot: Korii): self.bot = bot self.description = "😎 | Lots of useful utility commands." - self.active_games = {} diff --git a/extensions/utility/vocab.py b/extensions/utility/vocab.py index b0b145f..a99c46e 100644 --- a/extensions/utility/vocab.py +++ b/extensions/utility/vocab.py @@ -28,17 +28,19 @@ "Ich treibe Sport/ klettere / spiele Gitarre.": "Je fais du sport / de l'escalade / de la guitare." } +active_games = {} + class VocabularyCommand(UtilityBase): @commands.command(name="vocab") async def vocab(self, ctx): - if ctx.author.id in self.active_games: + if ctx.author.id in active_games: await ctx.send("You are already in a game. Type 'stop' to end it.") return - self.active_games[ctx.author.id] = True + active_games[ctx.author.id] = True await ctx.send("Starting the vocabulary game! Type 'stop' to end it.") - while self.active_games.get(ctx.author.id): + while active_games.get(ctx.author.id): german_phrase = random.choice(list(vocabulary.keys())) french_answer = vocabulary[german_phrase] @@ -51,7 +53,7 @@ def check(m): msg = await self.bot.wait_for("message", check=check) if msg.content.lower() == "stop": - del self.active_games[ctx.author.id] + del active_games[ctx.author.id] await ctx.send("Game stopped.") return