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);
}
}