Discord.js模块事件

最后发布: 2018-10-18 15:26:30


问题
const Discord = require("discord.js")


module.exports.run = async (bot, member) => {

    member.guild.channels.get('427243207697367041').send(`Welcome to the Isles of Cyphernia ${member.user}!`);

    if(command === "testjoin") {
        member.guild.channels.get('427243207697367041').send("Welcome");    
    }

}

我该如何正确运行? 这是一个模块,我正在尝试向其运行事件guildMemberAdd 下面是运行index.js的模块的位

const joinCommands = ["testjoin"];

if (joinCommands.some(word => message.content.startsWith(config.prefix + word))) {
    try {
        let joinModule = require(`./modules/joinleave.js`);
        joinModule.run(bot, client, member);
    } catch(err) {
        console.error(err);
    }
}
node.js discord.js