【发布时间】:2021-02-09 06:07:51
【问题描述】:
我收到了这个错误
.addField("Among Us related commands",
^
SyntaxError: Unexpected token '.'
当使用帮助命令时,我正在查看有关命令的信息,我试图检查我的代码有什么问题,但没有发现任何问题,请帮助
const data = [];
const { commands } = message.client;
const embed = new Discord.MessageEmbed()
.setAuthor(`My prefix here is ${prefix}\nuse ${prefix}help <command name> to get info about a command`);
.addField("Among Us related commands",
"tips");
.addField("Among Us Mini Game",
"soon");
.addField("Utility commands",
"ping");
.setColor('GREEN');
.setTimestamp();
.setFooter(message.member.user.tag, message.author.avatarURL());
const name = args[0]
const command = commands.get(name) || commands.find(c => c.aliases && c.aliases.includes(name))
if(!args.length) {
return message.channel.send(embed)
}
const helpembed = new Discord.MessageEmbed()
.setTitle(`${command.name} command`)
.addField("Description", command.desciption)
.addField("Aliases", command.aliases || "none")
.addField("Usage", command.usage || "none")
.addFIeld("Example", command.example || "none")
.setTimestamp()
.setFooter(message.member.user.tag, member.author.avatarURL())
message.channel.send(helpembed)
【问题讨论】:
标签: node.js discord.js