Q: Discord.js - Command to Remove All Users Containing Role I know that you can remove certain roles from users, and remove all roles from a user, but I was thinking of doing the reverse. I looked at this guide, which provides a way to retrieve all of the people who have a specific role. It seems like you could manipulate the collection/map to go through each member and remove the role. However, I cannot seem to achieve this.
I've hard-coded the one specific role that I am targeting as well as the message that should trigger the command.
Current code that I've been trying out (only seems to be working if there's just one person assigned the role):
if (msg.startsWith('!new round')) {
    //check for everyone and remove the role
    //roleID is just the roleID number string; I've stated it outside the if loop, for other command use cases as well
    let membersWithRole = message.guild.roles.cache.get(roleID).members;
    console.log(membersWithRole);
    for (let member of membersWithRole) {
        let mem = member[1]
        mem.roles.remove(role).catch(console.error);
        message.reply("Everyone with the jail role is now back in the game!");    
    }
}


Bottom line: Given a collection of the list of "guild" members that have the specified role (provided in the guide), could I iterate through a list* in order to remove the role from each member?
*I haven't found said list containing the members, but it's probably the objects themselves, so the whole collection

A: you need to learn documentation of discord.js
and yes you can do it by looping through all members.
if(msg.startsWith('!new round')){
    console.log('command used by '+msg.author);
    let role =msg.guild.roles.cache.get(roleId);
    role.members.each(member=>{
        member.roles.remove(role);
    });
    console.log('removed role from all members');
}


and also if you want to remove role from all members, so why you are not just deleting the role?
delete role:
msg.guild.roles.cache.get(roleId).delete();

