欢迎消息-TypeError:无法读取未定义的属性“用户”

时间:2020-07-11 14:43:35

标签: javascript node.js discord discord.js quick.db

我正在尝试用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}`);
});

1 个答案:

答案 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}`);
});