From ca30dd204e40d0a47a156d320f0974ac2d5a2174 Mon Sep 17 00:00:00 2001 From: almeidx Date: Wed, 28 Jul 2021 23:50:25 +0100 Subject: [PATCH] removed unnecessary encodeURIComponent on reasons --- backend/src/plugins/ModActions/commands/MassBanCmd.ts | 2 +- backend/src/plugins/ModActions/commands/MassUnbanCmd.ts | 5 +---- .../src/plugins/ModActions/functions/actualKickMemberCmd.ts | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/backend/src/plugins/ModActions/commands/MassBanCmd.ts b/backend/src/plugins/ModActions/commands/MassBanCmd.ts index 899d8ca3..7e61bb48 100644 --- a/backend/src/plugins/ModActions/commands/MassBanCmd.ts +++ b/backend/src/plugins/ModActions/commands/MassBanCmd.ts @@ -95,7 +95,7 @@ export const MassbanCmd = modActionsCmd({ await pluginData.guild.bans.create(userId as Snowflake, { days: deleteDays, - reason: banReason != null ? encodeURIComponent(banReason) : undefined, + reason: banReason ?? undefined, }); await casesPlugin.createCase({ diff --git a/backend/src/plugins/ModActions/commands/MassUnbanCmd.ts b/backend/src/plugins/ModActions/commands/MassUnbanCmd.ts index 059f85a7..1141c26c 100644 --- a/backend/src/plugins/ModActions/commands/MassUnbanCmd.ts +++ b/backend/src/plugins/ModActions/commands/MassUnbanCmd.ts @@ -60,10 +60,7 @@ export const MassunbanCmd = modActionsCmd({ } try { - await pluginData.guild.bans.remove( - userId as Snowflake, - unbanReason != null ? encodeURIComponent(unbanReason) : undefined, - ); + await pluginData.guild.bans.remove(userId as Snowflake, unbanReason ?? undefined); await casesPlugin.createCase({ userId, diff --git a/backend/src/plugins/ModActions/functions/actualKickMemberCmd.ts b/backend/src/plugins/ModActions/functions/actualKickMemberCmd.ts index a957696c..0ed86ded 100644 --- a/backend/src/plugins/ModActions/functions/actualKickMemberCmd.ts +++ b/backend/src/plugins/ModActions/functions/actualKickMemberCmd.ts @@ -82,7 +82,7 @@ export async function actualKickMemberCmd( ignoreEvent(pluginData, IgnoredEventType.Ban, memberToKick.id); try { - await memberToKick.ban({ days: 1, reason: encodeURIComponent("kick -clean") }); + await memberToKick.ban({ days: 1, reason: "kick -clean" }); } catch { sendErrorMessage(pluginData, msg.channel, "Failed to ban the user to clean messages (-clean)"); } @@ -91,7 +91,7 @@ export async function actualKickMemberCmd( ignoreEvent(pluginData, IgnoredEventType.Unban, memberToKick.id); try { - await pluginData.guild.bans.remove(memberToKick.id, encodeURIComponent("kick -clean")); + await pluginData.guild.bans.remove(memberToKick.id, "kick -clean"); } catch { sendErrorMessage(pluginData, msg.channel, "Failed to unban the user after banning them (-clean)"); }