mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-14 21:31:50 +00:00
Add hide_case option to automod mod actions
This commit is contained in:
parent
31d7748bf4
commit
25a3350196
6 changed files with 14 additions and 0 deletions
|
@ -22,10 +22,12 @@ export const BanAction = automodAction({
|
|||
notifyChannel: tNullable(t.string),
|
||||
deleteMessageDays: tNullable(t.number),
|
||||
postInCaseLog: tNullable(t.boolean),
|
||||
hide_case: t.boolean,
|
||||
}),
|
||||
|
||||
defaultConfig: {
|
||||
notify: null, // Use defaults from ModActions
|
||||
hide_case: false,
|
||||
},
|
||||
|
||||
async apply({ pluginData, contexts, actionConfig, matchResult }) {
|
||||
|
@ -39,6 +41,7 @@ export const BanAction = automodAction({
|
|||
extraNotes: matchResult.fullSummary ? [matchResult.fullSummary] : [],
|
||||
automatic: true,
|
||||
postInCaseLogOverride: actionConfig.postInCaseLog ?? undefined,
|
||||
hide: actionConfig.hide_case,
|
||||
};
|
||||
|
||||
const userIdsToBan = unique(contexts.map(c => c.user?.id).filter(nonNullish));
|
||||
|
|
|
@ -12,10 +12,12 @@ export const KickAction = automodAction({
|
|||
notify: tNullable(t.string),
|
||||
notifyChannel: tNullable(t.string),
|
||||
postInCaseLog: tNullable(t.boolean),
|
||||
hide_case: t.boolean,
|
||||
}),
|
||||
|
||||
defaultConfig: {
|
||||
notify: null, // Use defaults from ModActions
|
||||
hide_case: false,
|
||||
},
|
||||
|
||||
async apply({ pluginData, contexts, actionConfig, matchResult }) {
|
||||
|
@ -27,6 +29,7 @@ export const KickAction = automodAction({
|
|||
extraNotes: matchResult.fullSummary ? [matchResult.fullSummary] : [],
|
||||
automatic: true,
|
||||
postInCaseLogOverride: actionConfig.postInCaseLog ?? undefined,
|
||||
hide: actionConfig.hide_case,
|
||||
};
|
||||
|
||||
const userIdsToKick = unique(contexts.map(c => c.user?.id).filter(nonNullish));
|
||||
|
|
|
@ -26,10 +26,12 @@ export const MuteAction = automodAction({
|
|||
remove_roles_on_mute: tNullable(t.union([t.boolean, t.array(t.string)])),
|
||||
restore_roles_on_mute: tNullable(t.union([t.boolean, t.array(t.string)])),
|
||||
postInCaseLog: tNullable(t.boolean),
|
||||
hide_case: t.boolean,
|
||||
}),
|
||||
|
||||
defaultConfig: {
|
||||
notify: null, // Use defaults from ModActions
|
||||
hide_case: false,
|
||||
},
|
||||
|
||||
async apply({ pluginData, contexts, actionConfig, ruleName, matchResult }) {
|
||||
|
@ -44,6 +46,7 @@ export const MuteAction = automodAction({
|
|||
extraNotes: matchResult.fullSummary ? [matchResult.fullSummary] : [],
|
||||
automatic: true,
|
||||
postInCaseLogOverride: actionConfig.postInCaseLog ?? undefined,
|
||||
hide: actionConfig.hide_case,
|
||||
};
|
||||
|
||||
const userIdsToMute = unique(contexts.map(c => c.user?.id).filter(nonNullish));
|
||||
|
|
|
@ -12,10 +12,12 @@ export const WarnAction = automodAction({
|
|||
notify: tNullable(t.string),
|
||||
notifyChannel: tNullable(t.string),
|
||||
postInCaseLog: tNullable(t.boolean),
|
||||
hide_case: t.boolean,
|
||||
}),
|
||||
|
||||
defaultConfig: {
|
||||
notify: null, // Use defaults from ModActions
|
||||
hide_case: false,
|
||||
},
|
||||
|
||||
async apply({ pluginData, contexts, actionConfig, matchResult }) {
|
||||
|
@ -27,6 +29,7 @@ export const WarnAction = automodAction({
|
|||
extraNotes: matchResult.fullSummary ? [matchResult.fullSummary] : [],
|
||||
automatic: true,
|
||||
postInCaseLogOverride: actionConfig.postInCaseLog ?? undefined,
|
||||
hide: actionConfig.hide_case,
|
||||
};
|
||||
|
||||
const userIdsToWarn = unique(contexts.map(c => c.user?.id).filter(nonNullish));
|
||||
|
|
|
@ -35,6 +35,7 @@ export async function createCase(pluginData: GuildPluginData<CasesPluginType>, a
|
|||
audit_log_id: args.auditLogId,
|
||||
pp_id: args.ppId,
|
||||
pp_name: ppName,
|
||||
is_hidden: Boolean(args.hide),
|
||||
});
|
||||
|
||||
if (args.reason || (args.noteDetails && args.noteDetails.length)) {
|
||||
|
|
|
@ -40,6 +40,7 @@ export type CaseArgs = {
|
|||
postInCaseLogOverride?: boolean;
|
||||
noteDetails?: string[];
|
||||
extraNotes?: string[];
|
||||
hide?: boolean;
|
||||
};
|
||||
|
||||
export type CaseNoteArgs = {
|
||||
|
|
Loading…
Add table
Reference in a new issue