Keep getting "DiscordAPIError[50035]: Invalid Form Body tried a couple of changes but same stuff.

const { SlashCommandBuilder } = require('@discordjs/builders');
const { PermissionsBitField, ButtonStyle, ActionRowBuilder, ButtonBuilder, EmbedBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('verify')
.setDescription("Creëer een verificatie panel"),
async execute (interaction, client) {

if (!interaction.member.permissions.has(PermissionsBitField.Flags.Administrator)) return await interaction.reply({ content: "Je moet een Administrator zijn om dit paneel te creëeren", ephemeral: true})
const button = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('button')
.setEmoji('✅')
.setLabel('Verifieer jezelf')
.setStyle(ButtonStyle.Success),
)

const embed = new EmbedBuilder()
.setColor("Blue")
.setTitle("Server verificatie")
.setDescription('Klik op de onderstaande knop om jezelf te verifiëren binnen de server.')

await interaction.reply({ embeds: [embed], components: [button] });

const collector = await interaction.channel.createMessageComponentCollector();

collector.on('collect', async i => {

await i.update({ embeds: [embed], components: [button] });

const role = interaction.guild.roles.cache.find(r => r.name === 'beldians');

const member = i.member;

member.roles.add(role);

i.user.send('Je bent nu geverifieerd in **${i.guild.name}**').catch(err => {
return;
})
})
}}
const { SlashCommandBuilder } = require('@discordjs/builders');
const { PermissionsBitField, ButtonStyle, ActionRowBuilder, ButtonBuilder, EmbedBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('verify')
.setDescription("Creëer een verificatie panel"),
async execute (interaction, client) {

if (!interaction.member.permissions.has(PermissionsBitField.Flags.Administrator)) return await interaction.reply({ content: "Je moet een Administrator zijn om dit paneel te creëeren", ephemeral: true})
const button = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('button')
.setEmoji('✅')
.setLabel('Verifieer jezelf')
.setStyle(ButtonStyle.Success),
)

const embed = new EmbedBuilder()
.setColor("Blue")
.setTitle("Server verificatie")
.setDescription('Klik op de onderstaande knop om jezelf te verifiëren binnen de server.')

await interaction.reply({ embeds: [embed], components: [button] });

const collector = await interaction.channel.createMessageComponentCollector();

collector.on('collect', async i => {

await i.update({ embeds: [embed], components: [button] });

const role = interaction.guild.roles.cache.find(r => r.name === 'beldians');

const member = i.member;

member.roles.add(role);

i.user.send('Je bent nu geverifieerd in **${i.guild.name}**').catch(err => {
return;
})
})
}}
The error I keep receiving,
DiscordAPIError[50035]: Invalid Form Body
55.name[BASE_TYPE_REQUIRED]: This field is required
at handleErrors (/home/container/node_modules/@discordjs/rest/dist/index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:1120:23)
at async SequentialHandler.queueRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:953:14)
at async _REST.request (/home/container/node_modules/@discordjs/rest/dist/index.js:1266:22)
at async /home/container/src/handlers/slashCommand.js:49:5 {
requestBody: {
files: undefined,
json: [
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object]
},
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: { '55': [Object] }
},
code: 50035,
status: 400,
method: 'PUT',
DiscordAPIError[50035]: Invalid Form Body
55.name[BASE_TYPE_REQUIRED]: This field is required
at handleErrors (/home/container/node_modules/@discordjs/rest/dist/index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:1120:23)
at async SequentialHandler.queueRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:953:14)
at async _REST.request (/home/container/node_modules/@discordjs/rest/dist/index.js:1266:22)
at async /home/container/src/handlers/slashCommand.js:49:5 {
requestBody: {
files: undefined,
json: [
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object], [Object], [Object], [Object],
[Object], [Object]
},
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: { '55': [Object] }
},
code: 50035,
status: 400,
method: 'PUT',
3 Replies
d.js toolkit
d.js toolkit8mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs8mo ago
discord.js includes multiple sub-packages, installing these separately can mess with internal code:
npm uninstall discord-api-types @discordjs/rest @discordjs/builders
yarn remove discord-api-types @discordjs/rest @discordjs/builders
pnpm remove discord-api-types @discordjs/rest @discordjs/builders
npm uninstall discord-api-types @discordjs/rest @discordjs/builders
yarn remove discord-api-types @discordjs/rest @discordjs/builders
pnpm remove discord-api-types @discordjs/rest @discordjs/builders
Want results from more Discord servers?
Add your server