Expecting a string primitive for SlashCommandBuilder
I tried making an embed command using Slash commands and a lot of paramaters(probably not a good idea from the start 😅) and after it gave me a ValidationError asking for a string primitive. It doesn't tell me what it was given or where it happened in my own code, but here is the line it hates and my river of parameters.
data: new SlashCommandBuilder()
.setName("embed")
.setDescription("Writes an embed")
.addStringOption(s=>s.setName("title").setRequired(false))
.addStringOption(s=>s.setName("color").setRequired(false))
.addStringOption(s=>s.setName("description").setRequired(false))
.addStringOption(s=>s.setName("footer").setRequired(false))
.addStringOption(s=>s.setName("image").setRequired(false))
.addStringOption(s=>s.setName("thumbnail").setRequired(false))
.addStringOption(s=>s.setName("timestamp").setRequired(false))
.addStringOption(s=>s.setName("author").setRequired(false))
.addStringOption(s=>s.setName("url").setRequired(false))
.addStringOption(s=>s.setName("video").setRequired(false))
.addStringOption(s=>s.setName("provider").setRequired(false)),
(yes ik its a lot)
commands.push(command.data.toJSON()) <-- index.js line that errored. (command is the object returned from module.exports in my embed script.)
6 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
You are missing descriptions for your options...
Codeblocks:
```js
const Discord = require("discord.js");
// further code
```
becomes
Inline Code:
`console.log('inline!');` becomes
console.log('inline!');
you need descriptions??
yes
i didnt know that ;-;