📜  欢迎 discord.js - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:44.482000             🧑  作者: Mango

代码示例2
client.on('guildMemberAdd', guildMember =>{
  let welcomeRole = guildMember.guild.roles.cache.find(role => role.name === 'YOUR ROLE MEMBERS EXACT NAME');
  
  guildMember.roles.add(welcomeRole);
  guildMember.guild.channels.cache.get('WELCOME CHANNEL ID').send(`Welcome <@${guildMember.user.id}> to our server!`)

});