From 0a8fffd63ce69aac659f8c4864c66cddfec07cb8 Mon Sep 17 00:00:00 2001 From: metal Date: Wed, 8 Sep 2021 12:16:36 +0000 Subject: [PATCH] lines --- backend/src/plugins/Automod/AutomodPlugin.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/src/plugins/Automod/AutomodPlugin.ts b/backend/src/plugins/Automod/AutomodPlugin.ts index d49ee7b8..2a22c72b 100644 --- a/backend/src/plugins/Automod/AutomodPlugin.ts +++ b/backend/src/plugins/Automod/AutomodPlugin.ts @@ -139,11 +139,13 @@ const configPreprocessor: ConfigPreprocessorFn = options => { `Can't use both 'change_roles' and 'add_roles'/'remove_roles' at rule '${rule.name}'`, ]); } + if (rule["actions"].add_roles && rule["actions"].remove_roles) { throw new StrictValidationError([ `Can't use both 'add_roles' and 'remove_roles' at rule '${rule.name}', use 'change_roles' instead`, ]); } + for (const actionName in rule["actions"]) { if (!availableActions[actionName]) { throw new StrictValidationError([`Unknown action '${actionName}' in rule '${rule.name}'`]);