diff --git a/backend/src/plugins/ModActions.ts b/backend/src/plugins/ModActions.ts index 5518c396..6079c383 100644 --- a/backend/src/plugins/ModActions.ts +++ b/backend/src/plugins/ModActions.ts @@ -46,6 +46,7 @@ const ConfigSchema = t.type({ ban_message: tNullable(t.string), alert_on_rejoin: t.boolean, alert_channel: tNullable(t.string), + warn_notify_enabled: t.boolean, warn_notify_threshold: t.number, warn_notify_message: t.string, ban_delete_message_days: t.number, @@ -166,6 +167,7 @@ export class ModActionsPlugin extends ZeppelinPlugin { ban_message: "You have been banned from the {guildName} server. Reason given: {reason}", alert_on_rejoin: false, alert_channel: null, + warn_notify_enabled: false, warn_notify_threshold: 5, warn_notify_message: "The user already has **{priorWarnings}** warnings!\n Please check their prior cases and assess whether or not to warn anyways.\n Proceed with the warning?", @@ -690,7 +692,7 @@ export class ModActionsPlugin extends ZeppelinPlugin { const casesPlugin = this.getPlugin("cases"); const priorWarnAmount = await casesPlugin.getCaseTypeAmountForUserId(memberToWarn.id, CaseTypes.Warn); - if (priorWarnAmount >= config.warn_notify_threshold) { + if (config.warn_notify_enabled && priorWarnAmount >= config.warn_notify_threshold) { const tooManyWarningsMsg = await msg.channel.createMessage( config.warn_notify_message.replace("{priorWarnings}", `${priorWarnAmount}`), );