feat: Switch User

test #477
This commit is contained in:
March 7th
2023-01-26 13:40:51 +07:00
parent e8c3bcb0a0
commit 4c838a5e26
14 changed files with 79 additions and 60 deletions

View File

@@ -6,10 +6,12 @@ const Package = (exports.Package = require('../../package.json'));
const { Error, RangeError, TypeError } = require('../errors');
// #88: https://jnrbsn.github.io/user-agents/user-agents.json
const listUserAgent = [
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/107.0.1418.68',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 Edg/109.0.1518.69',
];
/**

View File

@@ -37,7 +37,7 @@ const { randomUA } = require('../util/Constants');
* @property {number} [closeTimeout=5000] The amount of time in milliseconds to wait for the close frame to be received
* from the WebSocket. Don't have this too high/low. Its best to have it between 2_000-6_000 ms.
* @property {boolean} [checkUpdate=true] Display module update information on the screen
* @property {boolean} [readyStatus=true] Sync state with Discord Client
* @property {boolean} [syncStatus=true] Sync state with Discord Client
* @property {boolean} [patchVoice=false] Automatically patch @discordjs/voice module (support for call)
* @property {string} [captchaService=null] Captcha service to use for solving captcha {@link captchaServices}
* @property {string} [captchaKey=null] Captcha service key
@@ -160,7 +160,7 @@ class Options extends null {
captchaSolver: captcha => Promise.reject(new Error('CAPTCHA_SOLVER_NOT_IMPLEMENTED', captcha)),
closeTimeout: 5_000,
checkUpdate: true,
readyStatus: true,
syncStatus: true,
autoRedeemNitro: false,
captchaService: '',
captchaKey: null,
@@ -197,14 +197,14 @@ class Options extends null {
browser: 'Chrome',
device: '',
system_locale: 'en-US',
browser_version: '108.0.0.0',
browser_version: '109.0.0.0',
os_version: '10',
referrer: '',
referring_domain: '',
referrer_current: '',
referring_domain_current: '',
release_channel: 'stable',
client_build_number: 165485,
client_build_number: 169617,
client_event_source: null,
},
// ! capabilities: 4093,

View File

@@ -647,7 +647,7 @@ class Util extends null {
}
/**
* Resolves the maximum time a guild's thread channels should automatcally archive in case of no recent activity.
* Resolves the maximum time a guild's thread channels should automatically archive in case of no recent activity.
* @deprecated
* @returns {number}
*/
@@ -753,6 +753,15 @@ class Util extends null {
static uploadFile(data, url) {
return axios.put(url, data);
}
static testImportModule(name) {
try {
require.resolve(name);
return true;
} catch {
return false;
}
}
}
module.exports = Util;