From 767b740c05f8a5a283018c73c049e12a84409f3b Mon Sep 17 00:00:00 2001 From: Elysia <71698422+aiko-chan-ai@users.noreply.github.com> Date: Thu, 18 May 2023 15:52:16 +0700 Subject: [PATCH] chore: update client version & fetch headers --- src/rest/APIRequest.js | 34 +++++++++++++++++----------------- src/util/Options.js | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/rest/APIRequest.js b/src/rest/APIRequest.js index eca6bc5..fccc2b6 100644 --- a/src/rest/APIRequest.js +++ b/src/rest/APIRequest.js @@ -48,26 +48,26 @@ class APIRequest { let headers = { ...this.client.options.http.headers, - Accept: '*/*', - origin: 'https://discord.com', - 'Accept-Language': 'en-US', - 'Sec-Fetch-Dest': 'empty', - 'Sec-Fetch-Mode': 'cors', - 'Sec-Fetch-Site': 'same-origin', - 'X-Debug-Options': 'bugReporterEnabled', - 'X-Super-Properties': `${Buffer.from( - this.client.options.jsonTransformer(this.client.options.ws.properties), - 'ascii', - ).toString('base64')}`, - 'X-Discord-Locale': 'en-US', - 'User-Agent': this.client.options.http.headers['User-Agent'], - Referer: 'https://discord.com/channels/@me', - Connection: 'keep-alive', - 'sec-ch-ua-mobile': '?0', - 'sec-ch-ua-platform': 'Windows', + accept: '*/*', + 'accept-language': 'en-US', 'sec-ch-ua': `"Not?A_Brand";v="8", "Chromium";v="${ /Chrome\/(\d+)/.exec(this.client.options.http.headers['User-Agent'])[1] }"`, + 'sec-ch-ua-mobile': '?0', + 'sec-ch-ua-platform': '"Windows"', + 'sec-fetch-dest': 'empty', + 'sec-fetch-mode': 'cors', + 'sec-fetch-site': 'same-origin', + 'x-debug-options': 'bugReporterEnabled', + 'x-discord-locale': 'en-US', + 'x-discord-timezone': 'Asia/Saigon', + 'x-super-properties': `${Buffer.from( + this.client.options.jsonTransformer(this.client.options.ws.properties), + 'ascii', + ).toString('base64')}`, + Referer: 'https://discord.com/channels/@me', + origin: 'https://discord.com', + 'Referrer-Policy': 'strict-origin-when-cross-origin', }; if (this.options.auth !== false) headers.Authorization = this.rest.getAuth(); diff --git a/src/util/Options.js b/src/util/Options.js index e872ad4..897ed88 100644 --- a/src/util/Options.js +++ b/src/util/Options.js @@ -201,7 +201,7 @@ class Options extends null { os_version: '10.0.22621', os_arch: 'x64', system_locale: 'en-US', - client_build_number: 197575, + client_build_number: 198920, native_build_number: 32266, client_event_source: null, design_id: 0,