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

@ -12,6 +12,7 @@ export const BanAction = automodAction({
notify: tNullable(t.string),
notifyChannel: tNullable(t.string),
deleteMessageDays: tNullable(t.number),
postInCaseLog: tNullable(t.boolean),
}),
defaultConfig: {
@ -27,6 +28,7 @@ export const BanAction = automodAction({
modId: pluginData.client.user.id,
extraNotes: matchResult.fullSummary ? [matchResult.fullSummary] : [],
automatic: true,
postInCaseLogOverride: actionConfig.postInCaseLog ?? undefined,
};
const userIdsToBan = unique(contexts.map(c => c.user?.id).filter(nonNullish));