Added GameServer handling & commands #238

This commit is contained in:
2023-03-04 20:24:49 +01:00
parent a8dad6b223
commit 91b2cf7546
12 changed files with 339 additions and 36 deletions

View File

@@ -82,7 +82,7 @@ class QueryABC(ObjectType):
break
elif type(element) == AutoRoleRule:
element: AutoRole = element.auto_role
element: AutoRole = element.game_server
for u in user.users:
u: User = u
guild = bot.get_guild(u.server.discord_id)

View File

@@ -57,7 +57,7 @@ class AutoRoleRuleFilter(FilterABC):
query = query.where(get_role_name)
if self._auto_role is not None:
auto_roles = self._auto_role.filter(query.select(lambda x: x.auto_role)).select(lambda x: x.id)
query = query.where(lambda x: x.auto_role.id in auto_roles)
auto_roles = self._auto_role.filter(query.select(lambda x: x.game_server)).select(lambda x: x.id)
query = query.where(lambda x: x.game_server.id in auto_roles)
return query

View File

@@ -22,7 +22,7 @@ class UserJoinedGameServerQuery(DataQueryABC):
@staticmethod
def resolve_game_server(x: UserJoinedGameServer, *_):
return x.game_server
return x.game_server.name
@staticmethod
def resolve_user(x: UserJoinedGameServer, *_):