Improved steam offer #188

This commit is contained in:
2023-10-11 20:03:54 +02:00
parent 4747f23202
commit 3a42b42dbf
34 changed files with 573 additions and 118 deletions

View File

@@ -16,6 +16,7 @@ type ServerConfig implements TableWithHistoryQuery {
loginMessageChannelId: String
defaultRoleId: String
shortRoleNameOnlySetHighestRole: Boolean
gameOfferNotificationChatId: String
featureFlagCount: Int
featureFlags: [FeatureFlag]
@@ -49,6 +50,7 @@ type ServerConfigHistory implements HistoryTableQuery {
loginMessageChannelId: String
defaultRoleId: String
shortRoleNameOnlySetHighestRole: Boolean
gameOfferNotificationChatId: String
featureFlagCount: Int
featureFlags: [FeatureFlag]
@@ -100,6 +102,7 @@ input ServerConfigInput {
loginMessageChannelId: String
defaultRoleId: String
shortRoleNameOnlySetHighestRole: Boolean
gameOfferNotificationChatId: String
featureFlags: [FeatureFlagInput]
afkChannelIds: [String]

View File

@@ -94,6 +94,11 @@ class ServerConfigMutation(QueryABC):
if "shortRoleNameOnlySetHighestRole" in input
else server_config.short_role_name_only_set_highest_role
)
server_config.game_offer_notification_chat_id = (
input["gameOfferNotificationChatId"]
if "gameOfferNotificationChatId" in input
else server_config.game_offer_notification_chat_id
)
server_config.feature_flags = (
dict(zip([x["key"] for x in input["featureFlags"]], [x["value"] for x in input["featureFlags"]]))
if "featureFlags" in input

View File

@@ -29,6 +29,7 @@ class ServerConfigQuery(DataQueryWithHistoryABC):
self.set_field(
"shortRoleNameOnlySetHighestRole", lambda config, *_: config.short_role_name_only_set_highest_role
)
self.set_field("gameOfferNotificationChatId", lambda config, *_: config.game_offer_notification_chat_id)
self.add_collection(
"featureFlag",
lambda config, *_: List(any, [{"key": x, "value": config.feature_flags[x]} for x in config.feature_flags]),