nl_tokens: Get a token of a device by its name
pl_tokens: function getTokenByName ( account , device_id , names = null ) { return co ( function * ( ) { const tokens = yield account . devices . tokenList ( device_id ) ; if ( ! tokens || ! tokens [ 0 ] ) return ; let token ; if ( names ) { names = Array . isArray ( names ) ? names : [ <mask> ] ; for ( const name of names ) { token = tokens . find ( ( token ) => token . name . indexOf ( name ) >= 0 ) ; if ( token ) break ; } } else { token = tokens [ 0 ] ; } if ( ! token ) throw ` ${ device_id } ${ names } ` ; return token . token ; } ) . catch ( ( error ) => { throw error ; } ) ; }