TypeError:Rich-Embed不是我的轮询命令的构造函数



所以我正在编写一个轮询机器人程序,如果用户只说"轮询",系统会用嵌入来响应,但是,当我执行命令时,我收到了一个错误:TypeError: RichEmbed is not a constructor。我的代码如下所示:

let args = message.content.substring(PREFIX.length).split(" ");
switch(args[0]){
case "poll":
const Embed = new RichEmbed()
.setColor(0xFFC300)
.setTitle("Initiate Poll")
.setDescription("p!poll to initiate a simple yes or no poll!");
if(!args[1]){
message.channel.send(Embed);
}
break;

这里说

RichEmbed构造函数已被删除,现在使用MessageEmbed构造函数。它的使用基本相同,唯一的区别是删除了richEmbed.attachFile(messageEmbed.attachFiles也接受单个文件作为参数(和richEmbed.addBlankField,并添加了messageEmbed.addFields

由于discord.js v12,您需要使用MessageEmbed而不是RichEmbed

最新更新