discord.js args未在单独的文件中嵌入消息定义

时间:2019-09-19 21:36:54

标签: javascript node.js discord discord.js

Idk我在做什么错,在主文件中看起来像这样:

    if (message.content.startsWith(config.prefix + "help")) {
    client.commands.get('help').execute(message, args);
}

在help.js中,它的定义如下:

const Discord = require("D:/Discord Bot/Unfinity/lib/node_modules/discord.js");
const client = new Discord.Client();

module.exports = {
name: "help",
description: "Shows standard help menu",
async execute(message, args) {
    const helpui = new Discord.RichEmbed()
    .setColor('#994DF7')
    .setTitle("*Unfinity's Help Menu*")
    .addField("8BALL", "Ask the magical ball.")
    .addField("AVATAR", "Previews the avatar of user.")
    .addField("HELP", "Shows this menu.")
    .addField("INFO", "Shows information about the bot.")
    .addField("PING", "Tests Unfinity's response time.")
    .addField("PREFIX", "Displays bot's prefix.")
    .addField("USER", "Shows information about the user.")
    .addBlankField()
    .addField("To view moderation commands use", "**" + config.modprefix + "help**")
    .setFooter("Requested by " + message.author.tag, message.author.avatarURL)

    message.channel.send(helpui);
  } 
}

我真的也需要帮助 the console error here

1 个答案:

答案 0 :(得分:0)

您应该使用这样的结构:

helm-find-1

如果您想从社区从discord.js编写的指南中学习如何正确创建Discord.js Bot,请使用:https://discordjs.guide