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 0000000000..2a67e51b1d --- /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 1573b9c7f0..0608d4661e 100644 --- a/packages/moderation/src/data/stages/description.ts +++ b/packages/moderation/src/data/stages/description.ts @@ -10,66 +10,58 @@ const description: Stage = { guidance_url: 'https://modrinth.com/legal/rules#general-expectations', navigate: '/', actions: [ - { - id: 'description_insufficient', - type: 'button', - label: 'Insufficient (custom)', - weight: 400, - suggestedStatus: 'flagged', - severity: 'medium', - message: async () => - (await import('../messages/description/insufficient/insufficient.md?raw')).default, - relevantExtraInput: [ - { - label: 'Please elaborate on how the author can improve their description.', - variable: 'EXPLAINER', - large: true, - required: true, - }, - ], - disablesActions: [ - 'description_insufficient_packs', - 'description_insufficient_projects', - 'description_insufficient_servers', - ], - } as ButtonAction, { id: 'description_insufficient_packs', type: 'button', label: 'Insufficient', - weight: 401, + 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, - disablesActions: ['description_insufficient'], } as ButtonAction, { id: 'description_insufficient_projects', type: 'button', label: 'Insufficient', - weight: 401, + 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, - disablesActions: ['description_insufficient'], } as ButtonAction, { id: 'description_insufficient_servers', type: 'button', label: 'Insufficient', - weight: 401, + 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, - disablesActions: ['description_insufficient'], + } as ButtonAction, + { + id: 'description_insufficient', + type: 'button', + label: 'Insufficient (custom)', + weight: 401, + suggestedStatus: 'flagged', + severity: 'medium', + message: async () => + (await import('../messages/description/insufficient/insufficient.md?raw')).default, + relevantExtraInput: [ + { + label: 'Please elaborate on how the author can improve their description.', + variable: 'EXPLAINER', + large: true, + required: true, + }, + ], } 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 821b8f78c2..9e221388e1 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 6ac13d61c0..0a076dd54a 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 }