#Creating SlashCommands
1 messages · Page 1 of 1 (latest)
Code:
const { SlashCommandBuilder } = require('discord.js')
const SlashCommand = new SlashCommandBuilder()
//other unimportant, irrelevant code below```
Error:
```js
const SlashCommand = new SlashCommandBuilder()
^
TypeError: SlashCommandBuilder is not a constructor```
I changed it from builders to discord.js, did I miss something here?
Can you run npm ls discord.js please
okay well apparently im still on v13?
that'd be why
it said it updated to v14
npm be tripping, thanks
client.api.applications(client.user.id).commands.post({ data: SlashCommand})
client.api.applications(client.user.id).commands.post({ data: SlashCommand})
^
TypeError: Cannot read properties of undefined (reading 'applications')```
That changed to client.rest though we never supported doing it that way
I figured, I asked here because i knew the docs weren't v14 yet
Creating Your Bot: Registering commands - Command deployment script