#Issue with deploying commands

1 messages · Page 1 of 1 (latest)

old gull
#

I'm using the latest version of Discord JS. My deploy commands.js file won't run. The terminal says the issue is with the line .map(command => command.toJSON()); I can't see any issue with the array before it.

neat tusk
#

what's the error

sullen patioBOT
#

To help you we need more information:
• What are you trying to do?
• What is your code?
• What errors and debug logs do you have?

neat tusk
#

and what is the array

heavy island
#

Was going to aask the same thing.

old gull
#
    at StringValidator.handle (/Volumes/JOEL'S DISK/Discord Bots/Blazing Wheels Discord Bot/node_modules/@sapphire/shapeshift/dist/index.js:1654:70)
    at StringValidator.parse (/Volumes/JOEL'S DISK/Discord Bots/Blazing Wheels Discord Bot/node_modules/@sapphire/shapeshift/dist/index.js:113:88)
    at validateDescription (/Volumes/JOEL'S DISK/Discord Bots/Blazing Wheels Discord Bot/node_modules/@discordjs/builders/dist/interactions/slashCommands/Assertions.cjs:16:24)
    at Object.validateRequiredParameters (/Volumes/JOEL'S DISK/Discord Bots/Blazing Wheels Discord Bot/node_modules/@discordjs/builders/dist/interactions/slashCommands/Assertions.cjs:27:3)
    at MixedClass.toJSON (/Volumes/JOEL'S DISK/Discord Bots/Blazing Wheels Discord Bot/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandBuilder.cjs:32:16)
    at /Volumes/JOEL'S DISK/Discord Bots/Blazing Wheels Discord Bot/deploy-commands.js:133:26
    at Array.map (<anonymous>)
    at Object.<anonymous> (/Volumes/JOEL'S DISK/Discord Bots/Blazing Wheels Discord Bot/deploy-commands.js:133:3)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) {
  validator: 's.string',
  given: undefined
}```
old gull
heavy island
#

Show code

neat tusk
#

the problem is with the commands not the toJSON()

old gull
#

@neat tusk

heavy island
#

// .setDefaultMemberPermissions(PermissionFlagsBits.ManageRoles)

#

There is the issue

#

Remove it

#

You can't use notes in array. Same counts for JSON files.

old gull
#

The issue was there before I added //

heavy island
#

0_0

old gull
#

Let me try again

heavy island
#

Is SlashCommandBuilder defined?

old gull
#

Yep

old gull
heavy island
#

deploy-commands.js:133:26

Can you check that file and that line of code.

old gull
#

.map(command => command.toJSON());

heavy island
#

And this:

deploy-commands.js:133:3

#

object.anonymous it says.

old gull
#

After I removed the line, the error is now 132:26

neat tusk
heavy island
#

Discord.js removed those.

neat tusk
old gull
heavy island
old gull
heavy island
#

Nvm. They do.

heavy island
neat tusk
heavy island
#

Can you give me like 133 of deploy-commands.js

neat tusk
heavy island
neat tusk
#

didn't see it

old gull
heavy island
#

Can you give us more than just .map()

#

We want to see what you're actually doing before it.

heavy island
#

I don't seem to find an issue in your command array.

old gull
heavy island
neat tusk
#

@old gull one of your commands (or maybe options) are missing description

heavy island
#

What are you trying to map.

heavy island
#
new SlashCommandBuilder()
        .setName('sysmsg')
        .addSubcommand(subcommand => subcommand
            .setName('rolesmsg')
            .setDescription('Send the role giving messages.'),
        )
        .addSubcommand(subcommand => subcommand
            .setName('welcome')
            .setDescription('Send the welcome and rules messages.'),
        ),
neat tusk
#

bruh

heavy island
#

At the end

#

It only has a name.

#

But descriptions aren't required, are they?

old gull
#

Ok it worked

neat tusk
heavy island
old gull
#

Didn't know descriptions were required

#

Thanks