diff --git a/src/rest/APIRequest.js b/src/rest/APIRequest.js index b879545..866bd9d 100644 --- a/src/rest/APIRequest.js +++ b/src/rest/APIRequest.js @@ -33,12 +33,18 @@ class APIRequest { make(captchaKey = undefined, captchaRqtoken = undefined) { // Ciphers - const defaultCiphers = tls.DEFAULT_CIPHERS.split(':'); - const temp = _.permutations(defaultCiphers.slice(0, 5), 5).filter( - x => JSON.stringify(x) !== JSON.stringify(defaultCiphers.slice(0, 5)), - ); - tls.DEFAULT_CIPHERS = [...temp[Math.floor(Math.random() * temp.length)], ...defaultCiphers.slice(5)].join(':'); - crypto.constants.defaultCipherList = tls.DEFAULT_CIPHERS; + try { + const defaultCiphers = tls.DEFAULT_CIPHERS.split(':'); + const temp = _.permutations(defaultCiphers.slice(0, 5), 5).filter( + x => JSON.stringify(x) !== JSON.stringify(defaultCiphers.slice(0, 5)), + ); + tls.DEFAULT_CIPHERS = [...temp[Math.floor(Math.random() * temp.length)], ...defaultCiphers.slice(5)].join(':'); + crypto.constants.defaultCipherList = tls.DEFAULT_CIPHERS; + // eslint-disable-next-line no-unused-vars + } catch (_) { + // Ignore + // I hate Electron Node.js + } if (agent === null) { if (typeof this.client.options.proxy === 'string' && this.client.options.proxy.length > 0) {