我正在尝试用Discord.js Bot发出欢迎消息
在尝试让漫游器提及新用户的同时,我一直在获取user is not defined
client.on('guildMemberAdd', async (message, member) => {
const welcomechannel = db.fetch(`welcomechannel_${message.guild.id}`)
// When new user joins, wait a few minutes, and if they haven't managed to get a role yet, DM them
client.channels.cache.get(welcomechannel).send(`New member joined: ${member.user.tag}`);
});
答案 0 :(得分:2)
guildMemberAdd
事件没有消息参数
client.on('guildMemberAdd', async (member) => {
const welcomechannel = db.fetch(`welcomechannel_${member.guild.id}`)
client.channels.cache.get(welcomechannel).send(`New member joined: ${member.user.tag}`);
});