Fixed technician check when not on the server /2
This commit is contained in:
parent
dc5ae365bb
commit
521a063fca
@ -36,6 +36,8 @@ class AuthUserTransformer(TransformerABC):
|
||||
def _is_technician(user: User, bot: DiscordBotServiceABC, permissions: PermissionServiceABC):
|
||||
guild = bot.get_guild(user.server.discord_id)
|
||||
member = guild.get_member(user.discord_id)
|
||||
if member is None:
|
||||
return permissions.is_member_technician_by_id(user.discord_id)
|
||||
return permissions.is_member_technician(member)
|
||||
|
||||
@staticmethod
|
||||
|
@ -19,3 +19,7 @@ class PermissionServiceABC(ABC):
|
||||
@abstractmethod
|
||||
def is_member_technician(self, member: discord.Member) -> bool:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def is_member_technician_by_id(self, member_id: int) -> bool:
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user