mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-14 07:27:01 +03:00
Include default message on error from warning.
Also show userID
This commit is contained in:
@@ -284,11 +284,14 @@ async function checkUserActiveWarning(userID: string): Promise<{ pass: boolean;
|
|||||||
) as {reason: string}[];
|
) as {reason: string}[];
|
||||||
|
|
||||||
if (warnings?.length >= config.maxNumberOfActiveWarnings) {
|
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 {
|
return {
|
||||||
pass: false,
|
pass: false,
|
||||||
errorMessage: warnings[0]?.reason?.length > 0 ? warnings[0].reason : defaultMessage
|
errorMessage: defaultMessage + (warnings[0]?.reason?.length > 0 ? ` Warning reason: ${warnings[0].reason}` : "")
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user