diff --git a/packages/moderation/src/data/messages/misc-metadata/excessive_languages-server.md b/packages/moderation/src/data/messages/misc-metadata/excessive_languages-server.md new file mode 100644 index 000000000..2a67e51b1 --- /dev/null +++ b/packages/moderation/src/data/messages/misc-metadata/excessive_languages-server.md @@ -0,0 +1,5 @@ +## Supported Languages + +Currently, you've selected %PROJECT_LANGUAGE_COUNT% [Languages](%PROJECT_LANGUAGE_SETTINGS%), per section 5.1 of %RULES% we ask that you confirm all selected languages are accurate. + +Selected languages should represent what players can expect to see on your server, and all players should be able to get the full experience out of your server even if they only understand one of the selected languages. diff --git a/packages/moderation/src/data/stages/description.ts b/packages/moderation/src/data/stages/description.ts index 1573b9c7f..0608d4661 100644 --- a/packages/moderation/src/data/stages/description.ts +++ b/packages/moderation/src/data/stages/description.ts @@ -10,11 +10,46 @@ const description: Stage = { guidance_url: 'https://modrinth.com/legal/rules#general-expectations', navigate: '/', actions: [ + { + id: 'description_insufficient_packs', + type: 'button', + label: 'Insufficient', + weight: 400, + suggestedStatus: 'flagged', + severity: 'medium', + shouldShow: (project, projectV3) => + project.project_type === 'modpack' && !projectV3?.minecraft_server, + message: async () => + (await import('../messages/description/insufficient/insufficient-packs.md?raw')).default, + } as ButtonAction, + { + id: 'description_insufficient_projects', + type: 'button', + label: 'Insufficient', + weight: 400, + suggestedStatus: 'flagged', + severity: 'medium', + shouldShow: (project, projectV3) => + project.project_type !== 'modpack' && !projectV3?.minecraft_server, + message: async () => + (await import('../messages/description/insufficient/insufficient-projects.md?raw')).default, + } as ButtonAction, + { + id: 'description_insufficient_servers', + type: 'button', + label: 'Insufficient', + weight: 400, + suggestedStatus: 'flagged', + severity: 'medium', + shouldShow: (project, projectV3) => !!projectV3?.minecraft_java_server, + message: async () => + (await import('../messages/description/insufficient/insufficient-servers.md?raw')).default, + } as ButtonAction, { id: 'description_insufficient', type: 'button', label: 'Insufficient (custom)', - weight: 400, + weight: 401, suggestedStatus: 'flagged', severity: 'medium', message: async () => @@ -27,49 +62,6 @@ const description: Stage = { required: true, }, ], - disablesActions: [ - 'description_insufficient_packs', - 'description_insufficient_projects', - 'description_insufficient_servers', - ], - } as ButtonAction, - { - id: 'description_insufficient_packs', - type: 'button', - label: 'Insufficient', - weight: 401, - suggestedStatus: 'flagged', - severity: 'medium', - shouldShow: (project, projectV3) => - project.project_type === 'modpack' && !projectV3?.minecraft_server, - message: async () => - (await import('../messages/description/insufficient/insufficient-packs.md?raw')).default, - disablesActions: ['description_insufficient'], - } as ButtonAction, - { - id: 'description_insufficient_projects', - type: 'button', - label: 'Insufficient', - weight: 401, - suggestedStatus: 'flagged', - severity: 'medium', - shouldShow: (project, projectV3) => - project.project_type !== 'modpack' && !projectV3?.minecraft_server, - message: async () => - (await import('../messages/description/insufficient/insufficient-projects.md?raw')).default, - disablesActions: ['description_insufficient'], - } as ButtonAction, - { - id: 'description_insufficient_servers', - type: 'button', - label: 'Insufficient', - weight: 401, - suggestedStatus: 'flagged', - severity: 'medium', - shouldShow: (project, projectV3) => !!projectV3?.minecraft_java_server, - message: async () => - (await import('../messages/description/insufficient/insufficient-servers.md?raw')).default, - disablesActions: ['description_insufficient'], } as ButtonAction, { id: 'description_non_english', diff --git a/packages/moderation/src/data/stages/rule-following.ts b/packages/moderation/src/data/stages/rule-following.ts index 821b8f78c..9e221388e 100644 --- a/packages/moderation/src/data/stages/rule-following.ts +++ b/packages/moderation/src/data/stages/rule-following.ts @@ -35,8 +35,28 @@ const ruleFollowing: Stage = { weight: 0, suggestedStatus: 'rejected', severity: 'critical', + shouldShow(project, projectV3) { + return !!projectV3?.minecraft_server + }, message: async () => (await import('../messages/paid-access-server.md?raw')).default, }, + { + id: 'excessive_languages', + type: 'button', + label: 'Excessive languages', + weight: 0, + suggestedStatus: 'flagged', + severity: 'low', + shouldShow(project, projectV3) { + return ( + !!projectV3?.minecraft_server && + !!projectV3?.minecraft_server?.languages?.length && + projectV3?.minecraft_server?.languages?.length > 4 + ) + }, + message: async () => + (await import('../messages/misc-metadata/excessive_languages-server.md?raw')).default, + }, ], } diff --git a/packages/moderation/src/utils.ts b/packages/moderation/src/utils.ts index 6ac13d61c..0a076dd54 100644 --- a/packages/moderation/src/utils.ts +++ b/packages/moderation/src/utils.ts @@ -412,5 +412,8 @@ export function flattenProjectV3Variables( vars['PROJECT_SITE_URL'] = projectV3.link_urls?.site?.url || 'None' vars['PROJECT_STORE_URL'] = projectV3.link_urls?.store?.url || 'None' + vars['PROJECT_LANGUAGES'] = projectV3.minecraft_server?.languages?.toString() || 'None' + vars['PROJECT_LANGUAGE_COUNT'] = (projectV3.minecraft_server?.languages?.length || 0).toString() + return vars }