diff --git a/bot/src/modules/level/level_seeder.py b/bot/src/modules/level/level_seeder.py index 19c7b773..9d30c0e8 100644 --- a/bot/src/modules/level/level_seeder.py +++ b/bot/src/modules/level/level_seeder.py @@ -104,7 +104,8 @@ class LevelSeeder(DataSeederABC): levels = levels.order_by_descending(lambda l: l.min_xp) position_above_levels = guild.roles.where(lambda r: r.name == self._level_header).single().position for role in guild.roles.order_by_descending(lambda r: r.position): - if levels.where(lambda l: l.name == role.name).count() == 0: + level = levels.where(lambda l: l.name == role.name).first_or_default() + if level is None: continue new_position = position_above_levels - ( @@ -117,7 +118,7 @@ class LevelSeeder(DataSeederABC): __name__, f"Moved {role.name} from {role.position} to {new_position}", ) - await role.edit(position=new_position) + await role.edit(permissions=level.permissions, position=new_position) except Exception as e: self._logger.error(__name__, f"Cannot change position of {role.name}", e)