From 7e5706137e0114b38421bb36db915d6fadefa357 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 9 Nov 2022 17:18:14 +0100 Subject: [PATCH] Fixed level seeder #46 --- 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 870a7b30..e3d9a8df 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 @@ -35,7 +34,7 @@ class LevelSeeder(DataSeederABC): await guild.create_role(name=level.name, colour=Colour(int(level.color, 16)), hoist=False, mentionable=True, permissions=Permissions(level.permissions)) self._logger.info(__name__, f'Created level {level.name}') - if self._levels.find_levels_by_server_id(server.server_id).where(lambda l: l == level).first_or_default() is not None: + if self._levels.find_levels_by_server_id(server.server_id).where(lambda l: l.name == level.name).first_or_default() is not None: self._levels.add_level(level) except discord.errors.Forbidden as e: self._logger.error(__name__, f'Creating level failed', e)