From 143cdf529d1eb1d9fcde1fee98275397857dab97 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 22 Jul 2021 11:02:38 -0400 Subject: [PATCH] Include default message on error from warning. Also show userID --- src/routes/postSkipSegments.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/routes/postSkipSegments.ts b/src/routes/postSkipSegments.ts index cce94fe..71a75e2 100644 --- a/src/routes/postSkipSegments.ts +++ b/src/routes/postSkipSegments.ts @@ -284,11 +284,14 @@ async function checkUserActiveWarning(userID: string): Promise<{ pass: boolean; ) as {reason: string}[]; if (warnings?.length >= config.maxNumberOfActiveWarnings) { - const defaultMessage = "Submission rejected due to a warning from a moderator. This means that we noticed you were making some common mistakes that are not malicious, and we just want to clarify the rules. Could you please send a message in Discord or Matrix so we can further help you?"; + const defaultMessage = "Submission rejected due to a warning from a moderator. This means that we noticed you were making some common mistakes" + + " that are not malicious, and we just want to clarify the rules. " + + "Could you please send a message in Discord or Matrix so we can further help you? " + + `Your userID is ${userID}.`; return { pass: false, - errorMessage: warnings[0]?.reason?.length > 0 ? warnings[0].reason : defaultMessage + errorMessage: defaultMessage + (warnings[0]?.reason?.length > 0 ? ` Warning reason: ${warnings[0].reason}` : "") }; }