Trying to send buttons with embed

DiscordAPIError[50035]: Invalid Form Body components[0][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1,). components[1][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1,).
const embed = new D.EmbedBuilder()
.setTitle(`Note from: ${CTX.author.username}`)
.setDescription(CTX.content)
.setTimestamp()
.setColor(D.Colors.DarkGold)

const ThumbsUp = new D.ButtonBuilder()
.setLabel("1")
.setStyle(D.ButtonStyle.Success)
.setCustomId(`test123`)
.setEmoji("👍")


const ThumbsDown = new D.ButtonBuilder()
.setLabel("1")
.setCustomId(`test1231`)
.setStyle(D.ButtonStyle.Danger)
.setEmoji("👎")


await CTX.channel.send({ephemeral: true, embeds: [embed], components: [ThumbsUp, ThumbsDown]})
const embed = new D.EmbedBuilder()
.setTitle(`Note from: ${CTX.author.username}`)
.setDescription(CTX.content)
.setTimestamp()
.setColor(D.Colors.DarkGold)

const ThumbsUp = new D.ButtonBuilder()
.setLabel("1")
.setStyle(D.ButtonStyle.Success)
.setCustomId(`test123`)
.setEmoji("👍")


const ThumbsDown = new D.ButtonBuilder()
.setLabel("1")
.setCustomId(`test1231`)
.setStyle(D.ButtonStyle.Danger)
.setEmoji("👎")


await CTX.channel.send({ephemeral: true, embeds: [embed], components: [ThumbsUp, ThumbsDown]})
3 Replies
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
edocsil
edocsil17mo ago
components must be an array of action rows
U
U17mo ago
Ahh my bad i didnt read the docs fully. Thanks for the help it works now