support in master #356
@ -10,6 +10,7 @@ from bot_api.exception.service_error_code_enum import ServiceErrorCode
|
||||
from bot_api.exception.service_exception import ServiceException
|
||||
from bot_api.route.route import Route
|
||||
from bot_core.configuration.feature_flags_enum import FeatureFlagsEnum
|
||||
from bot_data.model.achievement import Achievement
|
||||
from bot_data.model.auth_role_enum import AuthRoleEnum
|
||||
from bot_data.model.auth_user import AuthUser
|
||||
from bot_data.model.auto_role import AutoRole
|
||||
@ -78,7 +79,17 @@ class QueryABC(ObjectType):
|
||||
bot: DiscordBotServiceABC = services.get_service(DiscordBotServiceABC)
|
||||
|
||||
access = False
|
||||
if type(element) == AutoRole:
|
||||
if type(element) == Achievement:
|
||||
edraft marked this conversation as resolved
|
||||
element: Achievement = 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) == AutoRole:
|
||||
element: AutoRole = element
|
||||
for u in user.users:
|
||||
u: User = u
|
||||
|
Loading…
Reference in New Issue
Block a user
Ich sehe sehr oft doppelten Code. Wie wäre es, wenn wir dies in eine Methode auslagern?
Zu selten der gleiche Code
Die Fallunterscheidung ist sehr Individuell gestaltet :/