【发布时间】:2021-10-26 04:25:20
【问题描述】:
我不明白为什么会出现错误: TypeError:无法读取未定义的属性“MessageEmbed”
这是我的代码:
module.exports = {
name: 'help',
description: "this is the help command",
execute(message, args, Discord){
const newEmbed = new Discord.MessageEmbed()
.setColor('#304281')
.setTitle('Commands')
.setDescription('here are the commands'),
.addFields(
{name: '-help', value: 'The help command'},
{name: '-ping', value: 'Ping pong**'}
),
.setFooter('thanks for using the bot')
message.channel.send(newEmbed);
【问题讨论】:
-
可能是您没有正确地将 Discord 传递给您的命令?可能需要更多代码来回答这个问题
-
还需要什么代码?
-
这是我的 main.js 文件中的代码: if(command === 'help'){ client.commands.get('help').execute(message,args)
标签: node.js discord discord.js bots embed