From e5eb50a3cbff82f8bfda6c94c96ce09cefdac663 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Tue, 8 Nov 2022 18:49:10 +0100 Subject: [PATCH] Fixed level seeder #26 --- kdb-bot/src/modules/level/level_seeder.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kdb-bot/src/modules/level/level_seeder.py b/kdb-bot/src/modules/level/level_seeder.py index 2b4fc643..8e6eb9e7 100644 --- a/kdb-bot/src/modules/level/level_seeder.py +++ b/kdb-bot/src/modules/level/level_seeder.py @@ -1,7 +1,6 @@ import discord -from cpl_discord.container import Guild, Role +from cpl_discord.container import Guild from cpl_discord.service import DiscordBotServiceABC -from cpl_query.extension import List from discord import Permissions, Colour from bot_core.logging.database_logger import DatabaseLogger @@ -34,7 +33,7 @@ class LevelSeeder(DataSeederABC): self._logger.debug(__name__, f'Created role {level.name}') levels = self._levels.find_levels_by_server_id(server.server_id) - if levels is None or levels.where(lambda l: l == level).first_or_default() is None: + if levels is None or levels.where(lambda l: l.name == level.name).first_or_default() is None: self._levels.add_level(level) self._logger.debug(__name__, f'Saved level {level.name}') except discord.errors.Forbidden as e: