From 8e568e092ec6aad44577918e0cb951dcaa195157 Mon Sep 17 00:00:00 2001 From: Shoaib Sajid Date: Thu, 27 May 2021 16:46:10 +0500 Subject: [PATCH 1/8] Update mute.ts --- backend/src/plugins/Automod/actions/mute.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/plugins/Automod/actions/mute.ts b/backend/src/plugins/Automod/actions/mute.ts index 798b8b10..ec8f0048 100644 --- a/backend/src/plugins/Automod/actions/mute.ts +++ b/backend/src/plugins/Automod/actions/mute.ts @@ -24,7 +24,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), }), @@ -39,7 +39,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, From f3b8320ef05a0d777b44c5a0d5039660e13e344c Mon Sep 17 00:00:00 2001 From: Shoaib Sajid Date: Thu, 27 May 2021 16:48:08 +0500 Subject: [PATCH 2/8] Update types.ts --- backend/src/plugins/Mutes/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/plugins/Mutes/types.ts b/backend/src/plugins/Mutes/types.ts index cb0a6820..bf5331a4 100644 --- a/backend/src/plugins/Mutes/types.ts +++ b/backend/src/plugins/Mutes/types.ts @@ -26,7 +26,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, From ee0007fa6ccdf43e6c38f167134c2fa929989d62 Mon Sep 17 00:00:00 2001 From: Shoaib Sajid Date: Thu, 27 May 2021 16:48:49 +0500 Subject: [PATCH 3/8] Update types.ts --- backend/src/plugins/Spam/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/plugins/Spam/types.ts b/backend/src/plugins/Spam/types.ts index 9d4e0567..f939d529 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; From 02b8856126329df001c47a3dbae66cffa161be6c Mon Sep 17 00:00:00 2001 From: Shoaib Sajid Date: Thu, 27 May 2021 16:49:34 +0500 Subject: [PATCH 4/8] Update logAndDetectOtherSpam.ts --- backend/src/plugins/Spam/util/logAndDetectOtherSpam.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/plugins/Spam/util/logAndDetectOtherSpam.ts b/backend/src/plugins/Spam/util/logAndDetectOtherSpam.ts index b2fcb236..44892a37 100644 --- a/backend/src/plugins/Spam/util/logAndDetectOtherSpam.ts +++ b/backend/src/plugins/Spam/util/logAndDetectOtherSpam.ts @@ -52,7 +52,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) { From 32cf27884a16ef37b24d61d2047dd06544bc614f Mon Sep 17 00:00:00 2001 From: Shoaib Sajid Date: Thu, 27 May 2021 16:50:10 +0500 Subject: [PATCH 5/8] Update MutesPlugin.ts --- backend/src/plugins/Mutes/MutesPlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/plugins/Mutes/MutesPlugin.ts b/backend/src/plugins/Mutes/MutesPlugin.ts index 05671350..aac901f0 100644 --- a/backend/src/plugins/Mutes/MutesPlugin.ts +++ b/backend/src/plugins/Mutes/MutesPlugin.ts @@ -36,7 +36,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, From c75312329b9a1e135d4693d17458e542103076c4 Mon Sep 17 00:00:00 2001 From: Shoaib Sajid Date: Thu, 27 May 2021 16:51:28 +0500 Subject: [PATCH 6/8] Update logAndDetectMessageSpam.ts --- backend/src/plugins/Spam/util/logAndDetectMessageSpam.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/plugins/Spam/util/logAndDetectMessageSpam.ts b/backend/src/plugins/Spam/util/logAndDetectMessageSpam.ts index d5cc946e..45a7598f 100644 --- a/backend/src/plugins/Spam/util/logAndDetectMessageSpam.ts +++ b/backend/src/plugins/Spam/util/logAndDetectMessageSpam.ts @@ -93,7 +93,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) { From 7be1b5e9fdc6f023b5b04c9e37dbbd728a7a9e35 Mon Sep 17 00:00:00 2001 From: Shoaib Sajid Date: Thu, 27 May 2021 16:52:19 +0500 Subject: [PATCH 7/8] Update muteUser.ts --- backend/src/plugins/Mutes/functions/muteUser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/plugins/Mutes/functions/muteUser.ts b/backend/src/plugins/Mutes/functions/muteUser.ts index 046568b2..bb0e7f4f 100644 --- a/backend/src/plugins/Mutes/functions/muteUser.ts +++ b/backend/src/plugins/Mutes/functions/muteUser.ts @@ -61,7 +61,7 @@ export async function muteUser( const currentUserRoles = member.roles; const memberOptions: MemberOptions = {}; 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)) { From 53444e1f615be56291b3d512f3fca259997bc42e Mon Sep 17 00:00:00 2001 From: Shoaib Sajid Date: Thu, 27 May 2021 16:53:02 +0500 Subject: [PATCH 8/8] Update Counters.vue --- dashboard/src/components/docs/Counters.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/src/components/docs/Counters.vue b/dashboard/src/components/docs/Counters.vue index 0a874b46..100f005d 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