0.3 #146
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user