master #475
@ -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