async function units( ids, language ) {
	
	try {
    	
    	let allycodes = ids.filter(id => id.toString().match(/^\d{9}$/));
		let discordIds = ids.filter(id => id.toString().match(/^\d{17,18}$/));
		
		if( (!allycodes || allycodes.length === 0) && (!discordIds || discordIds.length === 0) ) { 
			throw new Error('Please provide a list of valid allycodes'); 
		}
	
	    let payload = {
	        language:language,
	        enums:false,
	        mods:true
	    };
	    
	    if( allycodes && allycodes.length > 0 ) { payload.allycodes = allycodes; }
	    if( discordIds && discordIds.length > 0 ) { payload.discordIds = discordIds; }
	     
		/** If not found or expired, fetch new from API and save to cache */
		return await swgoh.fetchUnits(payload);
		
	} catch(e) { 
		throw e; 
	}    		

}
/**
 *  Fetch units from api with arrays of allycodes or discord id's
 *  ! This will fetch direct from api and will not cache 
 * 
 *  Params
 *  @ids - array of allycodes or discordIds to request (! discord Id requires patreon-tier api user)
 *  @language - language code for reply
 */
Fetch units from api with arrays of allycodes or discord id's
! This will fetch direct from api and will not cache

Params
@ids - array of allycodes or discordIds to request (. discord Id requires patreon-tier api user)
@language - language code for reply
Fetch units from api with arrays of allycodes or discord id ' s ! This will fetch direct from api and will not cache Params @ids - array of allycodes or discordIds to request ( . discord Id requires patreon - tier api user ) @language - language code for reply
async function units( ids, language ) {
	try {
    	let allycodes = ids.filter(id => id.toString().match(/^\d{9}$/));
		let discordIds = ids.filter(id => id.toString().match(/^\d{17,18}$/));
		if( (!allycodes || allycodes.length === 0) && (!discordIds || discordIds.length === 0) ) { 
			throw new Error('Please provide a list of valid allycodes'); 
		}
	    let payload = {
	        language:language,
	        enums:false,
	        mods:true
	    };
	    if( allycodes && allycodes.length > 0 ) { payload.allycodes = allycodes; }
	    if( discordIds && discordIds.length > 0 ) { payload.discordIds = discordIds; }
		return await swgoh.fetchUnits(payload);
	} catch(e) { 
		throw e; 
	}    		
}
async function units ( ids , language ) { try { let allycodes = ids . filter ( id => id . toString ( ) . match ( / ^\d{9}$ / ) ) ; let discordIds = ids . filter ( id => id . toString ( ) . match ( / ^\d{17,18}$ / ) ) ; if ( ( ! allycodes || allycodes . length === 0 ) && ( ! discordIds || discordIds . length === 0 ) ) { throw new Error ( 'Please provide a list of valid allycodes' ) ; } let payload = { language : language , enums : false , mods : true } ; if ( allycodes && allycodes . length > 0 ) { payload . allycodes = allycodes ; } if ( discordIds && discordIds . length > 0 ) { payload . discordIds = discordIds ; } return await swgoh . fetchUnits ( payload ) ; } catch ( e ) { throw e ; } }
Fetch units from api with arrays of allycodes or discord id's
  !
Fetch units from api with arrays of allycodes or discord id ' s !
/** If not found or expired, fetch new from API and save to cache */