Error registering slash commands discord.js v13

Hey, I am registering my slash commands and I am getting an error several times! and I don't even know what file it is for!
Error: 3.options[1].name[STRING_TYPE_REGEX]: String value did not match validation regex.
Error: 3.options[1].name[STRING_TYPE_REGEX]: String value did not match validation regex.
10 Replies
d.js docs
d.js docs3y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Pooyan
PooyanOP3y ago
er let me check no number? example: autorole1 can I make a subcommand include an space? example: auto role mhm So and another thing there is a problem if the option name and value be the same? example: name: 'Role1', value: 'role1' yeah mb uh how can I find my fourth command
Pooyan
PooyanOP3y ago
Pooyan
PooyanOP3y ago
this is what my directory looks like and, Is this description allowed: You can include $user/$guild/$membercount? and one more thing... ;-; Is this subcommand name not allowed? welcome-message it is actually more than 100 lines and my terminal doesn't show the fourth any other way? no I mean 100 lines aww sheesh
data: new SlashCommandBuilder()
.setName('set')
.setDescription('Set a MuteRole for your guild\'s mute command')
.addSubcommand(subcommand => subcommand
.setName('muterole')
.setDescription('Set a MuteRole for your guild\'s mute command!')
.addRoleOption(option => option
.setName('muterole')
.setDescription('Target Role')
.setRequired(true)))
.addSubcommand(subcommand => subcommand
.setName('welcome-message')
.setDescription('Set a welcome message for your guild\'s welcomer system!')
.addStringOption(option => option
.setName('message')
.setDescription('You can include $user/$guild/$membercount')
.setRequired(true))),
data: new SlashCommandBuilder()
.setName('set')
.setDescription('Set a MuteRole for your guild\'s mute command')
.addSubcommand(subcommand => subcommand
.setName('muterole')
.setDescription('Set a MuteRole for your guild\'s mute command!')
.addRoleOption(option => option
.setName('muterole')
.setDescription('Target Role')
.setRequired(true)))
.addSubcommand(subcommand => subcommand
.setName('welcome-message')
.setDescription('Set a welcome message for your guild\'s welcomer system!')
.addStringOption(option => option
.setName('message')
.setDescription('You can include $user/$guild/$membercount')
.setRequired(true))),
is there something wrong with this command? what do I call it aw come on!
<rejected> DiscordAPIError[50035]: Invalid Form Body
options[1][APPLICATION_COMMAND_OPTIONS_TYPE_INVALID]: Sub-command and sub-command group option types are mutually exclusive to all other types
options[2][APPLICATION_COMMAND_OPTIONS_TYPE_INVALID]: Sub-command and sub-command group option types are mutually exclusive to all other types
at SequentialHandler.runRequest (C:\Users\Pooyan\Desktop\PDM Bot\node_modules\@discordjs\rest\dist\index.js:708:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\Pooyan\Desktop\PDM Bot\node_modules\@discordjs\rest\dist\index.js:511:14) {
rawError: { code: 50035, errors: [Object], message: 'Invalid Form Body' },
code: 50035,
status: 400,
method: 'put',
url: 'https://discord.com/api/v9/applications/966666309909770260/guilds/944616601678917632/commands',
requestBody: { files: undefined, json: [Array] }
}
}
<rejected> DiscordAPIError[50035]: Invalid Form Body
options[1][APPLICATION_COMMAND_OPTIONS_TYPE_INVALID]: Sub-command and sub-command group option types are mutually exclusive to all other types
options[2][APPLICATION_COMMAND_OPTIONS_TYPE_INVALID]: Sub-command and sub-command group option types are mutually exclusive to all other types
at SequentialHandler.runRequest (C:\Users\Pooyan\Desktop\PDM Bot\node_modules\@discordjs\rest\dist\index.js:708:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\Pooyan\Desktop\PDM Bot\node_modules\@discordjs\rest\dist\index.js:511:14) {
rawError: { code: 50035, errors: [Object], message: 'Invalid Form Body' },
code: 50035,
status: 400,
method: 'put',
url: 'https://discord.com/api/v9/applications/966666309909770260/guilds/944616601678917632/commands',
requestBody: { files: undefined, json: [Array] }
}
}
idk It's not specified It says that the options are duplicated?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Pooyan
PooyanOP3y ago
all of the options I have are in the sub commands
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Pooyan
PooyanOP3y ago
.addSubcommand(subcommand =>
subcommand
.setName('autorole')
.setDescription('Gives the specified roles to members who join the guild!')
.addRoleOption(option => option
.setName("autorole1")
.setDescription('Role 1')
.setRequired(true)))
.addSubcommand(subcommand =>
subcommand
.setName('autorole')
.setDescription('Gives the specified roles to members who join the guild!')
.addRoleOption(option => option
.setName("autorole1")
.setDescription('Role 1')
.setRequired(true)))
discord is lying example oh h\oh another error
options[3][APPLICATION_COMMAND_OPTIONS_NAME_INVALID]: Option name target is already used in these options
options[3][APPLICATION_COMMAND_OPTIONS_NAME_INVALID]: Option name target is already used in these options
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Pooyan
PooyanOP3y ago
<rejected> DiscordAPIError[30034]: Max number of daily application command creates has been reached (200) I hate this life Can a slash command just have one sub command?
.setName('change')
.setDescription('Change yours or your target\'s nickname!')
.addSubcommand(subcommand => subcommand
.setName('nickname')
.setDescription('Change yours or your target\'s nickname!')
.addStringOption(option => option
.setName('nickname')
.setDescription('Enter a cool nickname')
.setRequired(true)
)
.addUserOption(option => option
.setName('target')
.setDescription('Target Member'))
),
.setName('change')
.setDescription('Change yours or your target\'s nickname!')
.addSubcommand(subcommand => subcommand
.setName('nickname')
.setDescription('Change yours or your target\'s nickname!')
.addStringOption(option => option
.setName('nickname')
.setDescription('Enter a cool nickname')
.setRequired(true)
)
.addUserOption(option => option
.setName('target')
.setDescription('Target Member'))
),
options[1][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[1][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
I'm getting this error again
Want results from more Discord servers?
Add your server