#Got ExpectedValidationError s.instance(V) from builder.addStringOption

1 messages · Page 1 of 1 (latest)

livid pecan
#

discord.js: 14.1.2

Note: if I run my code without the addStringOption it works.
here is the code

> [22]    builder.addStringOption((option) => {
[23]        option.setName("gamertag");
[24]        option.setDescription("The username of the account.");
[25]        option.setRequired(true);
[26]    });

Here is my error:

ExpectedValidationError > s.instance(V)
  Expected

  Expected:
  | [Function (anonymous)]

  Received:
  | undefined

    at InstanceValidator.handle (C:\Users\kfeig\Documents\Development\Cosmetic-X\Backend\node_modules\@sapphire\shapeshift\dist\index.js:723:75)
    at InstanceValidator.parse (C:\Users\kfeig\Documents\Development\Cosmetic-X\Backend\node_modules\@sapphire\shapeshift\dist\index.js:142:88)
    at Object.assertReturnOfBuilder (C:\Users\kfeig\Documents\Development\Cosmetic-X\Backend\node_modules\@discordjs\builders\dist\interactions\slashCommands\Assertions.cjs:42:45)
    at MixedClass._sharedAddOptionMethod (C:\Users\kfeig\Documents\Development\Cosmetic-X\Backend\node_modules\@discordjs\builders\dist\interactions\slashCommands\mixins\SharedSlashCommandOptions.cjs:4

8:16)

at MixedClass.addStringOption (C:\Users\kfeig\Documents\Development\Cosmetic-X\Backend\node_modules\@discordjs\builders\dist\interactions\slashCommands\mixins\SharedSlashCommandOptions.cjs:36:17)
at C:\Users\kfeig\Documents\Development\Cosmetic-X\Backend\src\commands\registerSlashCommands.js:22:11
exotic chasm
livid pecan
#

return option?

exotic chasm
#

So probably in your case do return option;

livid pecan
#

ahh okay thanks