From 1960b180584bd1e06f964dc1d41558b8857a9a0b Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 30 Mar 2023 14:23:29 +0200 Subject: [PATCH] Improved level service --- kdb-bot/src/modules/level/service/level_service.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kdb-bot/src/modules/level/service/level_service.py b/kdb-bot/src/modules/level/service/level_service.py index 2acfd6fc..412139ba 100644 --- a/kdb-bot/src/modules/level/service/level_service.py +++ b/kdb-bot/src/modules/level/service/level_service.py @@ -58,10 +58,7 @@ class LevelService: return notification_needed = False - for role in member.roles: - if role.name not in level_names.to_list(): - continue - + for role in member.roles.where(lambda r: r.name in level_names.to_list()): try: self._logger.debug(__name__, f"Try to remove role {role.name} from {member.name}") await member.remove_roles(role)