discord.js-commando类型错误:RichEmbed不是构造函数
我想用discord.js-commando发送embed,但当我发送命令时,它会告诉我: 运行命令时出错:TypeError:RichEmbed不是构造函数 你不应该收到这样的错误 这是我的密码discord.js-commando类型错误:RichEmbed不是构造函数,discord.js,Discord.js,我想用discord.js-commando发送embed,但当我发送命令时,它会告诉我: 运行命令时出错:TypeError:RichEmbed不是构造函数 你不应该收到这样的错误 这是我的密码 const { Command } = require('discord.js-commando'); const { RichEmbed } = require('discord.js'); module.exports = class EmbedCommand extends Command {
const { Command } = require('discord.js-commando');
const { RichEmbed } = require('discord.js');
module.exports = class EmbedCommand extends Command {
constructor(client) {
super(client, {
name: 'embed',
group: 'util',
memberName: 'embed',
description: 'Embeds the text you provide.',
examples: ['embed Embeds are cool.'],
args: [
{
key: 'text',
prompt: 'What text would you like the bot to embed?',
type: 'string'
}
]
});
}
run(msg, args) {
const { text } = args;
const embed = new RichEmbed()
.setDescription(text)
.setAuthor(msg.author.username, msg.author.displayAvatarURL)
.setColor(0x00AE86)
.setTimestamp();
return msg.embed(embed);
}
};
RichEmbed在最新版本中称为MessageEmbed。重命名它应该没问题。如果您使用的是discord.js v12+它是
discord.MessageEmbed()