我如何使返回的消息嵌入?DISCORD.JS



我如何使返回的消息嵌入?

return message.reply(`**Here is a list of commands:** n *Type y!catagory for the commands of the catagory!* n n **Economy** n *y!economy* `);
};
exports.help = {
name: "help",
aliases: ["h"],
usage: "help"
}

您可以查看v12 embeds guide或v13 embeds guide

还有一些代码示例:

const embed = new Discord.MessageEmbed()
.setDescription(your_text)
.setTitle("Test Embed")
.setColor("RANDOM");
message.channel.send(embed)

请注意这段代码是为discord.js v12.x编写的

对于v13,您需要使用embeds属性

const embed = new Discord.MessageEmbed()
.setDescription(your_text)
.setTitle("Test Embed")
.setColor("RANDOM");
message.channel.send({ embeds: [embed] })

最新更新