const { MessageActionRow, MessageButtons } = require('discord.js')
const row = new MessageActionRow()
.addComponents(
new MessageButton()
.setCustomId('accept')
.setLabel('Aceitar')
.setStyle('SUCESS')
)
.addComponents(
new MessageButton()
.setCustomId('deny')
.setLabel('Recusar')
.setStyle('DANGER')
)
interaction.reply({ content: `a`, components: [row] })
I wan’t to make the bot reply with two buttons to people accept and it’s getting this error
throw new DiscordAPIError(data, res.status, request);
^
DiscordAPIError: Invalid Form Body
data.components[0].components[0].style: This field is required
>Solution :
The proper success style is SUCCESS, not SUCESS. Changing that should result in a valid message component:
const row = new MessageActionRow()
.addComponents(
new MessageButton()
.setCustomId('accept')
.setLabel('Aceitar')
.setStyle('SUCCESS')
)
...