From 1439b40b23c2fd9206c50384afaa8b5fb6ccab8c Mon Sep 17 00:00:00 2001 From: seeyebe <85168740+seeyebe@users.noreply.github.com> Date: Fri, 6 Jun 2025 15:28:17 +0300 Subject: [PATCH] Fix: Filter numeric enum keys from case type slash command options --- .../plugins/ModActions/commands/addcase/AddCaseSlashCmd.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/plugins/ModActions/commands/addcase/AddCaseSlashCmd.ts b/backend/src/plugins/ModActions/commands/addcase/AddCaseSlashCmd.ts index e84f609b..16322a22 100644 --- a/backend/src/plugins/ModActions/commands/addcase/AddCaseSlashCmd.ts +++ b/backend/src/plugins/ModActions/commands/addcase/AddCaseSlashCmd.ts @@ -28,10 +28,11 @@ export const AddCaseSlashCmd = modActionsSlashCmd({ name: "type", description: "The type of case to add", required: true, - choices: Object.keys(CaseTypes).map((type) => ({ name: type, value: type })), + choices: Object.keys(CaseTypes) + .filter((key) => isNaN(Number(key))) + .map((key) => ({ name: key, value: key })), }), slashOptions.user({ name: "user", description: "The user to add a case to", required: true }), - ...opts, ], @@ -39,7 +40,6 @@ export const AddCaseSlashCmd = modActionsSlashCmd({ await interaction.deferReply({ ephemeral: true }); const attachments = retrieveMultipleOptions(NUMBER_ATTACHMENTS_CASE_CREATION, options, "attachment"); - // The moderator who did the action is the message author or, if used, the specified -mod let mod = interaction.member as GuildMember; const canActAsOther = await hasPermission(pluginData, "can_act_as_other", { channel: interaction.channel,