JackyG

boost tracker

May 18th, 2021
717
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bot.on("guildMemberUpdate", async (oldMember, newMember) => {
  2.   const hadRole = oldMember.roles.cache.find(role => role.name === "Nitro Booster")
  3.   const hasRole = newMember.roles.cache.find(role => role.name === "Nitro Booster")
  4.  
  5.   if (!hadRole && hasRole) {
  6.     const channelBoost = newMember.guild.channels.cache.get("824723167934152715")
  7.     const newBoost = new Discord.MessageEmbed()
  8.     .setTitle("Nouveau Boost")
  9.     .setDescription("Merci <@" + member.id + "> du boost sur notre serveur!")
  10.     .setColor("f47fff")
  11.     .setFooter("JSE - Made with heart", bot.user.displayAvatarURL())
  12.     channelBoost.send(newBoost)
  13.  
  14.     const boostedUsers = newMember.guild.guild.members.array().filter(member => member.roles.cache.find(role => role.name === "Nitro Booster"))
  15.     console.log(boostedUsers.length)
  16.   }
  17. })
RAW Paste Data