From b88eb0d6a468f6ec89302b579fe3269ad6e6ffd7 Mon Sep 17 00:00:00 2001 From: NekoCyan Date: Wed, 9 Nov 2022 04:17:57 +0700 Subject: [PATCH] fix: WS identify data. --- src/util/RemoteAuth.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/RemoteAuth.js b/src/util/RemoteAuth.js index ed076b6..a60892d 100644 --- a/src/util/RemoteAuth.js +++ b/src/util/RemoteAuth.js @@ -381,6 +381,7 @@ class DiscordAuthWebsocket extends EventEmitter { async _findRealToken() { if (!this.token) this._throwError(new Error('Token is not created.')); + const chromeVersion = defaultClientOptions.ws.properties.browser_version.split('.')[0]; const res = await axios.post( `https://discord.com/api/v${this.options.apiVersion}/users/@me/remote-auth/login`, { @@ -393,6 +394,9 @@ class DiscordAuthWebsocket extends EventEmitter { 'Accept-Language': 'en-US,en;q=0.9', 'Cache-Control': 'no-cache', Pragma: 'no-cache', + 'Sec-Ch-Ua': `"Google Chrome";v="${chromeVersion}", "Chromium";v="${chromeVersion}", "Not=A?Brand";v="24"`, + 'Sec-Ch-Ua-Mobile': '?0', + 'Sec-Ch-Ua-Platform': '"Windows"', 'Sec-Fetch-Dest': 'empty', 'Sec-Fetch-Mode': 'cors', 'Sec-Fetch-Site': 'same-origin',