#Sub command and sub command group

1 messages · Page 1 of 1 (latest)

grand warren
#

one sec

#

its big

#
module.exports = {
    data: new SlashCommandBuilder()
        .setName('mention')
        .setDescription('Ping for the following events in the server!')
        .addSubcommand(subcommand =>
            subcommand
                .setName('dank')
                .setDescription('Ping for a dank giveaway!')
                .addUserOption(option => option.setName('donor').setDescription('The user who donated for the giveaway.').setRequired(true))
                .addStringOption(option => option.setName('message').setDescription('The message which the donor wants to say.').setRequired(false)))
        .addSubcommand(subcommand =>
            subcommand
                .setName('owo')
                .setDescription('Ping for an owo giveaway!'))
                .addUserOption(option => option.setName('donor').setDescription('The user who donated for the giveaway.').setRequired(true))
                .addStringOption(option => option.setName('message').setDescription('The message which the donor wants to say.').setRequired(false))
        .addSubcommand(subcommand =>
            subcommand
                .setName('poke')
                .setDescription('Ping for a pokemon giveaway!'))
                .addUserOption(option => option.setName('donor').setDescription('The user who donated for the giveaway.').setRequired(true))
                .addStringOption(option => option.setName('message').setDescription('The message which the donor wants to say.').setRequired(false))
        .addSubcommand(subcommand =>
            subcommand
                .setName('anigame')
                .setDescription('Ping for an anigame giveaway!'))
                .addUserOption(option => option.setName('donor').setDescription('The user who donated for the giveaway.').setRequired(true))
                .addStringOption(option => option.setName('message').setDescription('The message which the donor wants to say.').setRequired(false))
        .addSubcommand(subcommand =>
            subcommand
                .setName('heist')
                .setDescription('Ping for a heist!'))
                .addUserOption(option => option.setName('donor').setDescription('The user who donated for the giveaway.').setRequired(true))
                .addStringOption(option => option.setName('message').setDescription('The message which the donor wants to say.').setRequired(false))
}```
brave yew
#

Interesting, that looks fine, just SubCommands should be a-ok

grand warren
#

mhm

#

there is no group i suppose

brave yew
#

Yea, can't be this command then 🤔

grand warren
#

?

#

how

brave yew
#
DiscordAPIError[50035]: Invalid Form Body
options[2][APPLICATION_COMMAND_OPTIONS_TYPE_INVALID]: Sub-command and sub-command group option types are mutually exclusive to all other types
options[3][APPLICATION_COMMAND_OPTIONS_TYPE_INVALID]: Sub-command and sub-command group option types are mutually exclusive to all other types
options[5][APPLICATION_COMMAND_OPTIONS_NAME_INVALID]: Option name donor is already used in these options
options[6][APPLICATION_COMMAND_OPTIONS_NAME_INVALID]: Option name message is already used in these options
options[8][APPLICATION_COMMAND_OPTIONS_NAME_INVALID]: Option name donor is already used in these options
options[9][APPLICATION_COMMAND_OPTIONS_NAME_INVALID]: Option name message is already used in these options
options[11][APPLICATION_COMMAND_OPTIONS_NAME_INVALID]: Option name donor is already used in these options
options[12][APPLICATION_COMMAND_OPTIONS_NAME_INVALID]: Option name message is already used in these options
#

You seem to have a command with 13 or more options, find that

grand warren
#

13??

brave yew
#

One with donor as a name I reckon?

#

Which the one you shared doesn't have 🤔

grand warren
#

no the message

#

i used that in other cmd also

#

5 times in that cmd

brave yew
#

Well this isn't a lot to go on:

options[2][APPLICATION_COMMAND_OPTIONS_TYPE_INVALID]: Sub-command and sub-command group option types are mutually exclusive to all other types
options[3][APPLICATION_COMMAND_OPTIONS_TYPE_INVALID]: Sub-command and sub-command group option types are mutually exclusive to all other types
#

Find what commands you have that have both sub, and sub-command groups

grand warren
#

there are no sub cmd groups

#

what do i do now

brave yew
#

Sub-command and sub-command group option types are mutually exclusive to all other types
There has to be

#

Because that's what the error says you have

grand warren
#

mhm

#

does having dank in one cmd
and also having it as an option in different cmd count as this error?

brave yew
#

All I know is what the error says

grand warren
#

hmm

#
    code: 50035,
    errors: {
      options: {
        '2': { _errors: [ [Object] ] },
        '3': { _errors: [ [Object] ] },
        '5': { _errors: [ [Object] ] },
        '6': { _errors: [ [Object] ] },
        '8': { _errors: [ [Object] ] },
        '9': { _errors: [ [Object] ] },
        '11': { _errors: [ [Object] ] },
        '12': { _errors: [ [Object] ] }
      }
    },
    message: 'Invalid Form Body'
  },
  code: 50035,
  status: 400,
  method: 'PUT',
  url: 'https://discord.com/api/v10/applications/1056541924556816494/commands'
}```
#

what do those numbers mean

brave yew
#

Perhaps "second" command, but they do match the options[x]
You're gonna want to console.log what you send to that API call when it errors, so you can debug it

grand warren
#

what do i log?

brave yew
#

"what you send to that API call"

grand warren
#

??

#

btw a big error shows up

#

i sent a part of it