support #381
@ -20,6 +20,7 @@ from bot_data.model.known_user import KnownUser
|
||||
from bot_data.model.level import Level
|
||||
from bot_data.model.server import Server
|
||||
from bot_data.model.server_config import ServerConfig
|
||||
from bot_data.model.short_role_name import ShortRoleName
|
||||
from bot_data.model.user import User
|
||||
from bot_data.model.user_joined_game_server import UserJoinedGameServer
|
||||
from bot_data.model.user_joined_server import UserJoinedServer
|
||||
@ -184,6 +185,16 @@ class QueryABC(ObjectType):
|
||||
access = True
|
||||
break
|
||||
|
||||
elif type(element) == ShortRoleName:
|
||||
element: ShortRoleName = element
|
||||
for u in user.users:
|
||||
u: User = u
|
||||
guild = bot.get_guild(u.server.discord_id)
|
||||
member = guild.get_member(u.discord_id)
|
||||
if permissions.is_member_moderator(member) and u.server.id == element.server.id:
|
||||
access = True
|
||||
break
|
||||
|
||||
elif type(element) == dict and "key" in element and element["key"] in [e.value for e in FeatureFlagsEnum]:
|
||||
for u in user.users:
|
||||
u: User = u
|
||||
|
Loading…
Reference in New Issue
Block a user