mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
Fix log_automatic_actions option not working for automod actions
This commit is contained in:
parent
53b64682ee
commit
cc795c9742
4 changed files with 12 additions and 4 deletions
|
@ -4,6 +4,7 @@ import { LogType } from "../../../data/LogType";
|
|||
import { asyncMap, nonNullish, resolveMember, tNullable, unique } from "../../../utils";
|
||||
import { resolveActionContactMethods } from "../functions/resolveActionContactMethods";
|
||||
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
|
||||
import { CaseArgs } from "../../Cases/types";
|
||||
|
||||
export const BanAction = automodAction({
|
||||
configType: t.type({
|
||||
|
@ -22,9 +23,10 @@ export const BanAction = automodAction({
|
|||
const contactMethods = actionConfig.notify ? resolveActionContactMethods(pluginData, actionConfig) : undefined;
|
||||
const deleteMessageDays = actionConfig.deleteMessageDays || undefined;
|
||||
|
||||
const caseArgs = {
|
||||
const caseArgs: Partial<CaseArgs> = {
|
||||
modId: pluginData.client.user.id,
|
||||
extraNotes: matchResult.fullSummary ? [matchResult.fullSummary] : [],
|
||||
automatic: true,
|
||||
};
|
||||
|
||||
const userIdsToBan = unique(contexts.map(c => c.user?.id).filter(nonNullish));
|
||||
|
|
|
@ -4,6 +4,7 @@ import { LogType } from "../../../data/LogType";
|
|||
import { asyncMap, nonNullish, resolveMember, tNullable, unique } from "../../../utils";
|
||||
import { resolveActionContactMethods } from "../functions/resolveActionContactMethods";
|
||||
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
|
||||
import { CaseArgs } from "../../Cases/types";
|
||||
|
||||
export const KickAction = automodAction({
|
||||
configType: t.type({
|
||||
|
@ -20,9 +21,10 @@ export const KickAction = automodAction({
|
|||
const reason = actionConfig.reason || "Kicked automatically";
|
||||
const contactMethods = actionConfig.notify ? resolveActionContactMethods(pluginData, actionConfig) : undefined;
|
||||
|
||||
const caseArgs = {
|
||||
const caseArgs: Partial<CaseArgs> = {
|
||||
modId: pluginData.client.user.id,
|
||||
extraNotes: matchResult.fullSummary ? [matchResult.fullSummary] : [],
|
||||
automatic: true,
|
||||
};
|
||||
|
||||
const userIdsToKick = unique(contexts.map(c => c.user?.id).filter(nonNullish));
|
||||
|
|
|
@ -15,6 +15,7 @@ import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
|
|||
import { MutesPlugin } from "../../Mutes/MutesPlugin";
|
||||
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { CaseArgs } from "../../Cases/types";
|
||||
|
||||
export const MuteAction = automodAction({
|
||||
configType: t.type({
|
||||
|
@ -37,9 +38,10 @@ export const MuteAction = automodAction({
|
|||
const rolesToRemove = actionConfig.remove_roles_on_mute;
|
||||
const rolesToRestore = actionConfig.restore_roles_on_mute;
|
||||
|
||||
const caseArgs = {
|
||||
const caseArgs: Partial<CaseArgs> = {
|
||||
modId: pluginData.client.user.id,
|
||||
extraNotes: matchResult.fullSummary ? [matchResult.fullSummary] : [],
|
||||
automatic: true,
|
||||
};
|
||||
|
||||
const userIdsToMute = unique(contexts.map(c => c.user?.id).filter(nonNullish));
|
||||
|
|
|
@ -4,6 +4,7 @@ import { LogType } from "../../../data/LogType";
|
|||
import { asyncMap, nonNullish, resolveMember, tNullable, unique } from "../../../utils";
|
||||
import { resolveActionContactMethods } from "../functions/resolveActionContactMethods";
|
||||
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
|
||||
import { CaseArgs } from "../../Cases/types";
|
||||
|
||||
export const WarnAction = automodAction({
|
||||
configType: t.type({
|
||||
|
@ -20,9 +21,10 @@ export const WarnAction = automodAction({
|
|||
const reason = actionConfig.reason || "Warned automatically";
|
||||
const contactMethods = actionConfig.notify ? resolveActionContactMethods(pluginData, actionConfig) : undefined;
|
||||
|
||||
const caseArgs = {
|
||||
const caseArgs: Partial<CaseArgs> = {
|
||||
modId: pluginData.client.user.id,
|
||||
extraNotes: matchResult.fullSummary ? [matchResult.fullSummary] : [],
|
||||
automatic: true,
|
||||
};
|
||||
|
||||
const userIdsToWarn = unique(contexts.map(c => c.user?.id).filter(nonNullish));
|
||||
|
|
Loading…
Add table
Reference in a new issue