我正在使用 discord.js 制作一个不和谐的机器人,但在使用该命令时出现错误“TypeError: Discord.MessageEmbed.setDescription is not a constructor”
const Discord = require('discord.js');
module.exports = {
name: 'stats',
description: 'Views the bot\'s stats',
execute(message, args, client) {
const embed = new Discord.MessageEmbed
.setDescription(`In ${client.guilds.cache.size} servers`)
.setTimestamp()
.setFooter(message.member.user.tag, message.author.avatarURL());
message.channel.send(embed)
}
}
答案 0 :(得分:1)
尝试将
const embed = new Discord.MessageEmbed
更改为
const embed = new Discord.MessageEmbed()