我希望进入服务器的人将从邮件中接收。我试图做类似的事情,但是没用:
bot.on('guildMemberAdd', member => {
var joiner = member.user.username;
const embeddd = new Discord.RichEmbed()
.setColor('#ff0000')
.setTitle(`Hi, ${joiner}.`)
message.author.send(embeddd);
})
答案 0 :(得分:0)
message.author.send(embeddd);
客户端的guildMemberAdd
事件中没有消息参数。如果要将嵌入内容发送给加入的成员,请使用已有的member
参数。
bot.on('guildMemberAdd', member => {
var embed = new Discord.RichEmbed()
.setColor('#ffffff')
.setTitle('**Hello!**')
.setDescription(`Welcome to ${member.guild}.`)
.setFooter(member.guild.name, member.guild.iconURL);
member.send(embed)
.catch(console.error);
});