functions/FUNC_userRoleRequest.js
// check if role is unique and return what role needs to be removed
check if role is unique and return what role needs to be removed
check if role is unique and return what role needs to be removed
function checkUniqueRole(wantsRole, uniqueRoles, userRoles) {
  let roleFound;
  const unique = uniqueRoles.find((roleID) => roleID === wantsRole);
  if (!unique) return roleFound;
  uniqueRoles.forEach((uniqueRole) => {
    const result = userRoles.cache.find(({ id }) => id === uniqueRole);
    if (result) roleFound = result;
  });
  return roleFound;
}
function checkUniqueRole ( wantsRole , uniqueRoles , userRoles ) { let roleFound ; const unique = uniqueRoles . find ( ( roleID ) => roleID === wantsRole ) ; if ( ! unique ) return roleFound ; uniqueRoles . forEach ( ( uniqueRole ) => { const result = userRoles . cache . find ( ( { id } ) => id === uniqueRole ) ; if ( result ) roleFound = result ; } ) ; return roleFound ; }
check if role is unique and return what role needs to be removed
check if role is unique and return what role needs to be removed