#Subcommands

1 messages · Page 1 of 1 (latest)

harsh vault
#
new SlashCommandBuilder()
        .setName('ignoredchannels')
        .setDescription('Adds a channel that is ignored from gaining levels')
        .addSubcommandGroup(subCommandGroup =>
            subCommandGroup
                .setName('commands')
                .addSubcommand(subCommand =>
                    subCommand
                        .setName('add')
                        .setDescription('Adds an ignored channel')
                        .addChannelOption(channel =>
                            channel
                                .setName('channel')
                                .setDescription('The channel to ignore'),
                        ),
                )
                .addSubcommand(subCommand =>
                    subCommand
                        .setName('remove')
                        .setDescription('Removes an ignored channel')
                        .addChannelOption(channel =>
                            channel
                                .setName('channel')
                                .setDescription('The channel to remove from the ignored list'),
                        ),
                ),
        ),
#

Getting this error when I try to register the command:

ZodError: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [],
    "message": "Required"
  }
]
    at new ZodError (/mnt/d/code/aequum/node_modules/zod/lib/ZodError.js:80:28)
    at handleResult (/mnt/d/code/aequum/node_modules/zod/lib/types.js:115:21)
    at ZodString.ZodType.safeParse (/mnt/d/code/aequum/node_modules/zod/lib/types.js:191:16)
    at ZodString.ZodType.parse (/mnt/d/code/aequum/node_modules/zod/lib/types.js:172:27)
    at D (/mnt/d/code/aequum/node_modules/@discordjs/builders/dist/index.js:3:1447)
    at h (/mnt/d/code/aequum/node_modules/@discordjs/builders/dist/index.js:3:1294)
    at MixedClass.toJSON (/mnt/d/code/aequum/node_modules/@discordjs/builders/dist/index.js:3:8075)
    at /mnt/d/code/aequum/node_modules/@discordjs/builders/dist/index.js:3:8832
    at Array.map (<anonymous>)
    at MixedClass.toJSON (/mnt/d/code/aequum/node_modules/@discordjs/builders/dist/index.js:3:8823) {
  issues: [
    {
      code: 'invalid_type',
      expected: 'string',
      received: 'undefined',
      path: [],
      message: 'Required'
    }
  ],
  format: [Function (anonymous)],
  addIssue: [Function (anonymous)],
  addIssues: [Function (anonymous)],
  flatten: [Function (anonymous)]
}