mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-06 10:37:19 +00:00
Fix: Filter numeric enum keys from case type slash command options
This commit is contained in:
parent
3ef89246ba
commit
1439b40b23
1 changed files with 3 additions and 3 deletions
|
@ -28,10 +28,11 @@ export const AddCaseSlashCmd = modActionsSlashCmd({
|
||||||
name: "type",
|
name: "type",
|
||||||
description: "The type of case to add",
|
description: "The type of case to add",
|
||||||
required: true,
|
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 }),
|
slashOptions.user({ name: "user", description: "The user to add a case to", required: true }),
|
||||||
|
|
||||||
...opts,
|
...opts,
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -39,7 +40,6 @@ export const AddCaseSlashCmd = modActionsSlashCmd({
|
||||||
await interaction.deferReply({ ephemeral: true });
|
await interaction.deferReply({ ephemeral: true });
|
||||||
const attachments = retrieveMultipleOptions(NUMBER_ATTACHMENTS_CASE_CREATION, options, "attachment");
|
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;
|
let mod = interaction.member as GuildMember;
|
||||||
const canActAsOther = await hasPermission(pluginData, "can_act_as_other", {
|
const canActAsOther = await hasPermission(pluginData, "can_act_as_other", {
|
||||||
channel: interaction.channel,
|
channel: interaction.channel,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue