From 80769a1bf07c5019409cfe1646f7b9395be39b45 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 9 Mar 2023 19:27:56 +0100 Subject: [PATCH 1/2] Fixed permission service --- .../src/modules/permission/service/permission_service.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/kdb-bot/src/modules/permission/service/permission_service.py b/kdb-bot/src/modules/permission/service/permission_service.py index e793ebe1..c13f517c 100644 --- a/kdb-bot/src/modules/permission/service/permission_service.py +++ b/kdb-bot/src/modules/permission/service/permission_service.py @@ -1,6 +1,6 @@ import discord -from cpl_core.logging import LoggerABC from cpl_core.configuration import ConfigurationABC +from cpl_core.logging import LoggerABC from cpl_discord.service import DiscordBotServiceABC from bot_core.configuration.bot_settings import BotSettings @@ -126,14 +126,15 @@ class PermissionService(PermissionServiceABC): return self._technicians def is_member_admin(self, member: discord.Member) -> bool: - return member.guild.id in self._admins and member in self._admins[member.guild.id] + return member is not None and member.guild.id in self._admins and member in self._admins[member.guild.id] def is_member_moderator(self, member: discord.Member) -> bool: return ( - member.guild.id in self._moderators + member is not None + and member.guild.id in self._moderators and member in self._moderators[member.guild.id] or self.is_member_admin(member) ) def is_member_technician(self, member: discord.Member) -> bool: - return member in self._technicians + return member is not None and member in self._technicians From c0e5f0d4b0099e5a9ee7f22e7f3f152acb88381c Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 9 Mar 2023 19:41:10 +0100 Subject: [PATCH 2/2] Updated config --- kdb-bot/src/bot/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kdb-bot/src/bot/config b/kdb-bot/src/bot/config index 6e2ec8f2..781aa3f6 160000 --- a/kdb-bot/src/bot/config +++ b/kdb-bot/src/bot/config @@ -1 +1 @@ -Subproject commit 6e2ec8f2f88cca5355624da9c83c034949d12ae3 +Subproject commit 781aa3f6ab861343d1635005ec7dc1814065b3c7