diff options
-rw-r--r-- | bot/seasons/evergreen/game.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/seasons/evergreen/game.py b/bot/seasons/evergreen/game.py index 957e1195..65598c17 100644 --- a/bot/seasons/evergreen/game.py +++ b/bot/seasons/evergreen/game.py @@ -145,6 +145,8 @@ class Games(Cog): self.bot = bot self.http_session: ClientSession = bot.http_session + self.genres: Dict[str, int] = {} + self.refresh_genres_task.start() @tasks.loop(hours=1.0) @@ -170,8 +172,6 @@ class Games(Cog): genres = {genre["name"].capitalize(): genre["id"] for genre in result} - self.genres = {} - # Replace complex names with names from ALIASES for genre_name, genre in genres.items(): if genre_name in ALIASES: @@ -208,7 +208,7 @@ class Games(Cog): try: games = await self.get_games_list(amount, self.genres[genre], offset=random.randint(0, 150)) except KeyError: - possibilities = "`, `".join(difflib.get_close_matches(genre, self.genres)) + possibilities = "`, `".join(difflib.get_close_matches(genre, self.genres, cutoff=0.4)) await ctx.send(f"Invalid genre `{genre}`. {f'Maybe you meant `{possibilities}`?' if possibilities else ''}") return |