发送时嵌入显示为空 discord.js

Embeds appearing as empty when sent discord.js

每当我尝试发送嵌入时都会收到错误消息。这才刚刚开始发生,我还没有进行任何形式的更新(据我所知)这是我的代码:

const ping = new Discord.MessageEmbed()
      .setTitle('Pong!')
      .setDescription(` \`${Date.now() - message.createdTimestamp} ms\``)
      .setColor(0x39f79e);

message.channel.send('test')
console.log(ping)
message.channel.send(ping)

这是我收到的错误以及记录到控制台的内容:

MessageEmbed {
  type: 'rich',
  title: 'Pong!',
  description: ' `50 ms`',
  url: null,
  color: 3798942,
  timestamp: null,
  fields: [],
  thumbnail: null,
  image: null,
  video: null,
  author: null,
  provider: null,
  footer: null
}

/home/runner/Jungle-Bot/node_modules/discord.js/src/rest/RequestHandler.js:350
      throw new DiscordAPIError(data, res.status, request);
            ^

DiscordAPIError: Cannot send an empty message
    at RequestHandler.execute (/home/runner/Jungle-Bot/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/home/runner/Jungle-Bot/node_modules/discord.js/src/rest/RequestHandler.js:51:14) {
  method: 'post',
  path: '/channels/938846693884047410/messages',
  code: 50006,
  httpStatus: 400,
  requestData: {
    json: {
      content: undefined,
      tts: false,
      nonce: undefined,
      embeds: undefined,
      components: undefined,
      username: undefined,
      avatar_url: undefined,
      allowed_mentions: undefined,
      flags: undefined,
      message_reference: undefined,
      attachments: undefined,
      sticker_ids: undefined
    },
    files: []
  }
}

任何帮助将不胜感激,我对此比较陌生

随着 Discords 的最新更新 API 你的最后一行应该改为:

message.channel.send({
    embeds: [ping]
})