Add postInCaseLog option for mod action Automod actions; allow forcing case log even when log_automatic_actions is disabled

This commit is contained in:
Dragory 2021-04-28 22:39:49 +03:00
parent aa43f05173
commit 45e81848a7
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
7 changed files with 18 additions and 13 deletions

View file

@ -188,8 +188,6 @@ export async function muteUser(
if (theCase) {
// Update old case
// Since mutes can often have multiple notes (extraNotes), we won't post each case note individually,
// but instead we'll post the entire case afterwards
const noteDetails = [`Mute updated to ${muteTime ? timeUntilUnmute : "indefinite"}`];
const reasons = reason ? [reason] : [];
if (muteOptions.caseArgs?.extraNotes) {
@ -201,13 +199,9 @@ export async function muteUser(
modId: muteOptions.caseArgs?.modId,
body: noteReason,
noteDetails,
postInCaseLogOverride: false,
postInCaseLogOverride: muteOptions.caseArgs?.postInCaseLogOverride,
});
}
if (muteOptions.caseArgs?.postInCaseLogOverride !== false) {
casesPlugin.postCaseToCaseLogChannel(existingMute!.case_id);
}
} else {
// Create new case
const noteDetails = [`Muted ${muteTime ? `for ${timeUntilUnmute}` : "indefinitely"}`];