Expected SlashCommandSubcommandBuilder

    data: new SlashCommandBuilder()
        .setName('user').setDefaultMemberPermissions(0)
        .setDescription('add user')
        .addSubcommand(subCommand => 
            subCommand.setName("add").setDescription("Add a user")
            .addStringOption(option => 
                option.setName("nickname").setDescription("nickname of the player").setRequired(true)
            )
        )
        .addSubcommand(subCommand =>
            subCommand.setName("remove").setDescription("Remove a user")
            .addUserOption(option =>
                option.setName("user").setDescription("User to remove")
            )
        )
        .addSubcommand(subCommand => {
            subCommand.setName("list").setDescription("Get list of users saved")
        }),
    async execute(interaction) {


The introduction of the list subcommand has given this error
ExpectedValidationError: Expected
    at _InstanceValidator.handle (C:\dev\discordBotRust\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:1531:75)
    at _InstanceValidator.parse (C:\dev\discordBotRust\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:972:90)
    at assertReturnOfBuilder (C:\dev\discordBotRust\node_modules\@discordjs\builders\dist\index.js:1638:53)
    at MixedClass.addSubcommand (C:\dev\discordBotRust\node_modules\@discordjs\builders\dist\index.js:2563:5)
    at Object.<anonymous> (C:\dev\discordBotRust\commands\user\user.js:32:10)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19) {
  validator: 's.instance(V)',
  given: undefined,
  expected: [Function: SlashCommandSubcommandBuilder]

Anyone know why?
Was this page helpful?