diff --git a/backend/src/plugins/Automod/actions/mute.ts b/backend/src/plugins/Automod/actions/mute.ts index 3219c712..42d2391b 100644 --- a/backend/src/plugins/Automod/actions/mute.ts +++ b/backend/src/plugins/Automod/actions/mute.ts @@ -14,7 +14,7 @@ export const MuteAction = automodAction({ notify: tNullable(t.string), notifyChannel: tNullable(t.string), 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)])), + restore_roles_on_unmute: tNullable(t.union([t.boolean, t.array(t.string)])), postInCaseLog: tNullable(t.boolean), hide_case: tNullable(t.boolean), }), @@ -29,7 +29,7 @@ export const MuteAction = automodAction({ const reason = actionConfig.reason || "Muted automatically"; const contactMethods = actionConfig.notify ? resolveActionContactMethods(pluginData, actionConfig) : undefined; const rolesToRemove = actionConfig.remove_roles_on_mute; - const rolesToRestore = actionConfig.restore_roles_on_mute; + const rolesToRestore = actionConfig.restore_roles_on_unmute; const caseArgs: Partial = { modId: pluginData.client.user!.id, diff --git a/backend/src/plugins/Mutes/MutesPlugin.ts b/backend/src/plugins/Mutes/MutesPlugin.ts index ddc347ec..a978c7cc 100644 --- a/backend/src/plugins/Mutes/MutesPlugin.ts +++ b/backend/src/plugins/Mutes/MutesPlugin.ts @@ -40,7 +40,7 @@ const defaultOptions = { timed_mute_message: "You have been muted on the {guildName} server for {time}. Reason given: {reason}", update_mute_message: "Your mute on the {guildName} server has been updated to {time}.", remove_roles_on_mute: false, - restore_roles_on_mute: false, + restore_roles_on_unmute: false, can_view_list: false, can_cleanup: false, diff --git a/backend/src/plugins/Mutes/functions/muteUser.ts b/backend/src/plugins/Mutes/functions/muteUser.ts index 575f96fb..1e055378 100644 --- a/backend/src/plugins/Mutes/functions/muteUser.ts +++ b/backend/src/plugins/Mutes/functions/muteUser.ts @@ -68,7 +68,7 @@ export async function muteUser( const currentUserRoles = [...member.roles.cache.keys()]; let newRoles: string[] = currentUserRoles; const removeRoles = removeRolesOnMuteOverride ?? config.remove_roles_on_mute; - const restoreRoles = restoreRolesOnMuteOverride ?? config.restore_roles_on_mute; + const restoreRoles = restoreRolesOnMuteOverride ?? config.restore_roles_on_unmute; // Remove roles if (!Array.isArray(removeRoles)) { diff --git a/backend/src/plugins/Mutes/types.ts b/backend/src/plugins/Mutes/types.ts index 0c69c657..50e739a5 100644 --- a/backend/src/plugins/Mutes/types.ts +++ b/backend/src/plugins/Mutes/types.ts @@ -25,7 +25,7 @@ export const ConfigSchema = t.type({ timed_mute_message: tNullable(t.string), update_mute_message: tNullable(t.string), remove_roles_on_mute: t.union([t.boolean, t.array(t.string)]), - restore_roles_on_mute: t.union([t.boolean, t.array(t.string)]), + restore_roles_on_unmute: t.union([t.boolean, t.array(t.string)]), can_view_list: t.boolean, can_cleanup: t.boolean, diff --git a/backend/src/plugins/Spam/types.ts b/backend/src/plugins/Spam/types.ts index 1e561477..48fb9b1a 100644 --- a/backend/src/plugins/Spam/types.ts +++ b/backend/src/plugins/Spam/types.ts @@ -12,7 +12,7 @@ const BaseSingleSpamConfig = t.type({ mute: tNullable(t.boolean), mute_time: tNullable(t.number), 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)])), + restore_roles_on_unmute: tNullable(t.union([t.boolean, t.array(t.string)])), clean: tNullable(t.boolean), }); export type TBaseSingleSpamConfig = t.TypeOf; diff --git a/backend/src/plugins/Spam/util/logAndDetectMessageSpam.ts b/backend/src/plugins/Spam/util/logAndDetectMessageSpam.ts index b2a46432..390b66ec 100644 --- a/backend/src/plugins/Spam/util/logAndDetectMessageSpam.ts +++ b/backend/src/plugins/Spam/util/logAndDetectMessageSpam.ts @@ -87,7 +87,7 @@ export async function logAndDetectMessageSpam( }, }, spamConfig.remove_roles_on_mute, - spamConfig.restore_roles_on_mute, + spamConfig.restore_roles_on_unmute, ); } catch (e) { if (e instanceof RecoverablePluginError && e.code === ERRORS.NO_MUTE_ROLE_IN_CONFIG) { diff --git a/backend/src/plugins/Spam/util/logAndDetectOtherSpam.ts b/backend/src/plugins/Spam/util/logAndDetectOtherSpam.ts index 3a339b5f..511b247b 100644 --- a/backend/src/plugins/Spam/util/logAndDetectOtherSpam.ts +++ b/backend/src/plugins/Spam/util/logAndDetectOtherSpam.ts @@ -51,7 +51,7 @@ export async function logAndDetectOtherSpam( }, }, spamConfig.remove_roles_on_mute, - spamConfig.restore_roles_on_mute, + spamConfig.restore_roles_on_unmute, ); } catch (e) { if (e instanceof RecoverablePluginError && e.code === ERRORS.NO_MUTE_ROLE_IN_CONFIG) { diff --git a/dashboard/src/components/docs/Counters.vue b/dashboard/src/components/docs/Counters.vue index 663a3968..bb2d2668 100644 --- a/dashboard/src/components/docs/Counters.vue +++ b/dashboard/src/components/docs/Counters.vue @@ -136,7 +136,7 @@ mute: reason: "You have been muted for tripping too many automod filters" remove_roles_on_mute: true - restore_roles_on_mute: true + restore_roles_on_unmute: true