From 602d7e927e1bf2bc80530c986fa254d179cfad09 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Mon, 2 Oct 2023 17:22:59 +0200 Subject: [PATCH] Fixed permission check --- .../src/modules/permission/service/permission_service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kdb-bot/src/modules/permission/service/permission_service.py b/kdb-bot/src/modules/permission/service/permission_service.py index f62243b3..d27c45e3 100644 --- a/kdb-bot/src/modules/permission/service/permission_service.py +++ b/kdb-bot/src/modules/permission/service/permission_service.py @@ -47,11 +47,11 @@ class PermissionService(PermissionServiceABC): return self._team_role_members(g_id, TeamMemberTypeEnum.moderator) def is_member_admin(self, member: discord.Member) -> bool: - return member in self.get_admins(member.guild.id) + return member is not None and member in self.get_admins(member.guild.id) def is_member_moderator(self, member: discord.Member) -> bool: - return member in self.get_admins(member.guild.id) or member in self.get_moderators(member.guild.id) + return member is not None and member in self.get_admins(member.guild.id) or member in self.get_moderators(member.guild.id) def is_member_technician(self, member: discord.Member) -> bool: config = self._technician_configs.get_technician_config() - return str(member.id) in config.technician_ids.select(lambda x: str(x)) + return member is not None and str(member.id) in config.technician_ids.select(lambda x: str(x))