I made a script to remove and add a specific role to all members of a server, but my concern and with the rate limit, can someone give me an idea of how I can "limit" the removal of roles so that I don't have problems?
msg.guild.members.cache.forEach(member => {
member.roles.add(msg.mentions.roles.first().id).catch(e =>console.log(`Não foi possivel dar cargo para ${member.user.tag}`));
console.log(`adicionei o carpo pra um cara`)
})
channel = client.channels.cache.get(tempVars("ChannelID"));
channel.send('Terminei de adicionar o cargo aos membros do servidor');