无法发送嵌入和组件 discord.js v13

Cannot send embed and components discord.js v13

我无法在 discord.js v13 上发送带有嵌入的按钮,机器人只发送嵌入而不发送按钮。我收到错误消息“Invalid from body”,但我不知道该怎么办?

这是我的代码:

        const embedopen = new Discord.MessageEmbed()
            .setDescription(`Bonjour ${button.user.tag}, bienvenue dans votre ticket. Un <@&799060000122994698> ou l'<@&799049340538191892> va s'occuper de vous.`)
            .setTimestamp()
        const row = new Discord.MessageActionRow()
            .addComponents(
                new Discord.MessageButton()
                    .setLabel("Fermer le ticket")
                    .setCustomId("close_ticket")
                    .setEmoji('❌')
                    .setStyle("red")
            )

        channel.send({embeds: [embedopen], components: [row]})

这里是错误:

 04:55:06 -> [ERR] -> DiscordAPIError: Invalid Form Body
components[0].components[0].style: This field is required
    at RequestHandler.execute (h:\Users\Zarcross\Desktop\SiteComplet\node_modules\discord.js\src\rest\RequestHandler.js:298:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (h:\Users\Zarcross\Desktop\SiteComplet\node_modules\discord.js\src\rest\RequestHandler.js:50:14)
    at async TextChannel.send (h:\Users\Zarcross\Desktop\SiteComplet\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:172:15) {
  method: 'post',
  path: '/channels/902752250697515048/messages',
  code: 50035,
  httpStatus: 400,
  requestData: {
    json: {
      content: undefined,
      tts: false,
      nonce: undefined,
      embeds: [Array],
      components: [Array],
      username: undefined,
      avatar_url: undefined,
      allowed_mentions: undefined,
      flags: undefined,
      message_reference: undefined,
      attachments: undefined,
      sticker_ids: undefined
    },
    files: []
  }
}

如果您想要红色按钮,请将 .setStyle("red") 更改为 .setStyle("DANGER")

您收到错误消息是因为“红色”不是有效的按钮样式。

目前有五种不同的按钮样式:

PRIMARY - 模糊按钮

SECONDARY - 灰色按钮

SUCCESS - 绿色按钮

DANGER - 红色按钮

LINK - 导航到 URL.

的按钮