#help```jsError Invalid Array lengthat Object.run (workspacenode_modulessapphireshapeshiftd

1 messages · Page 1 of 1 (latest)

late fern
#

help

Error: Invalid Array length
at Object.run (/workspace/node_modules/@sapphire/shapeshift/dist/index.js:217:79)
at /workspace/node_modules/@sapphire/shapeshift/dist/index.js:113:66
at Array.reduce (<anonymous>)
at ArrayValidator.parse (/workspace/node_modules/@sapphire/shapeshift/dist/index.js:113:29)
at validateMaxOptionsLength (/workspace/node_modules/@discordjs/builders/dist/index.js:900:27)
at MixedClass.addSubcommand (/workspace/node_modules/@discordjs/builders/dist/index.js:1428:5)
at /workspace/handlers/slashCommands.js:22:9
at Array.forEach (<anonymous>)
at module.exports (/workspace/handlers/slashCommands.js:8:41)
at /workspace/main.js:54:35
at Array.forEach (<anonymous>)
at Object.<anonymous> (/workspace/main.js:53:6)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
2022-05-23 13:13:00.756911: I tensorflow/core/

handler:

addSubcommand((subcommand) => {
								subcommand.setName(String(pull.name).toLowerCase()).setDescription(pull.description)
								if(pull.options){
options.opp(subcommand)
…

example cmd exports code:

module.exports = {
  name: "3000years", 
  description: "Its been 3000 years…",
  cooldown: 10,
  memberpermissions: [], 
  requiredroles: [], 
  alloweduserids: [], 
  opp : function(subcommand) {
      subcommand.addUserOption((op)=> {
          op.setName("user")
          op.setDescription("The user's avatar that wanted to manipulate")
          op.setRequired(false)
      })
  },
  run: async (client, interaction) => {
…
graceful marten
#

Do you mean pull.opp instead of options.opp?

#

And there is no options in your exports anyway

late fern
#

thanks

late fern
graceful marten
late fern
#

ok one sec

late fern
#

im using tomato handler

#

(i made a lot changes on it)

graceful marten
#

There’s still not a options property in the referenced file of yours. But I feel the reason for your error is that one of your subcommands has more than 25 options or you add more than 25 subcommands to a command

late fern
#

i want to moved everything to slash

#

so can be verified

#

each category like 120 to 150

late fern
graceful marten
#

Easy: remove any subcommands that exceed the limit of 25 and move them into another command or use subcommandgroups

late fern
#

does bots really need to changed to slash

#

?

#

how to register to have normal cmds

#

i have like 1200 cmds

#

graceful marten
#

/command subcommandgroup subcommand option1: option2: ...

graceful marten
late fern
graceful marten
#

Subcommandgroups are basically another layer of subcommand, call it subsubcommand if you want

late fern
#

and how?

#

uwu please help

zenith questBOT