fix: request (untested)

This commit is contained in:
Elysia
2025-07-10 01:54:19 +07:00
parent d256edd5e5
commit 890240d930
3 changed files with 17 additions and 21 deletions

View File

@@ -60,23 +60,23 @@ class APIRequest {
let headers = { let headers = {
accept: '*/*', accept: '*/*',
'accept-language': 'en-US', 'accept-language': 'en-US',
'sec-ch-ua': '"Chromium";v="134", "Not:A-Brand";v="24", "Google Chrome";v="134"', priority: 'u=1, i',
referer: 'https://discord.com/channels/@me',
'sec-ch-ua': '"Not:A-Brand";v="24", "Chromium";v="134"',
'sec-ch-ua-mobile': '?0', 'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"', 'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty', 'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors', 'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin', 'sec-fetch-site': 'same-origin',
'x-debug-options': 'bugReporterEnabled',
'x-discord-locale': 'en-US', 'x-discord-locale': 'en-US',
'x-discord-timezone': Intl.DateTimeFormat().resolvedOptions().timeZone, 'x-discord-timezone': Intl.DateTimeFormat().resolvedOptions().timeZone,
'x-super-properties': `${Buffer.from(JSON.stringify(this.client.options.ws.properties), 'ascii').toString( 'x-super-properties': `${Buffer.from(JSON.stringify(this.client.options.ws.properties), 'ascii').toString(
'base64', 'base64',
)}`, )}`,
referer: 'https://discord.com/channels/@me',
origin: 'https://discord.com', origin: 'https://discord.com',
'x-debug-options': 'bugReporterEnabled',
...this.client.options.http.headers, ...this.client.options.http.headers,
'User-Agent': this.fullUserAgent, 'User-Agent': this.fullUserAgent,
priority: 'u=1, i',
}; };
if (this.options.auth !== false) headers.Authorization = this.rest.getAuth(); if (this.options.auth !== false) headers.Authorization = this.rest.getAuth();

View File

@@ -9,7 +9,7 @@ const { Error, RangeError, TypeError } = require('../errors');
exports.MaxBulkDeletableMessageAge = 1_209_600_000; exports.MaxBulkDeletableMessageAge = 1_209_600_000;
exports.UserAgent = exports.UserAgent =
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Electron/33.4.0 Safari/537.36'; 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) discord/1.0.9198 Chrome/134.0.6998.205 Electron/35.3.0 Safari/537.36';
/** /**
* Chrome TLS ciphers * Chrome TLS ciphers

View File

@@ -191,27 +191,23 @@ class Options extends null {
capabilities: 0, // https://discord-userdoccers.vercel.app/topics/gateway#gateway-capabilities capabilities: 0, // https://discord-userdoccers.vercel.app/topics/gateway#gateway-capabilities
properties: { properties: {
os: 'Windows', os: 'Windows',
browser: 'Chrome', browser: 'Discord Client',
device: '', release_channel: 'stable',
client_version: '1.0.9198',
os_version: '10.0.19044',
os_arch: 'x64',
app_arch: 'x64',
system_locale: 'en-US', system_locale: 'en-US',
has_client_mods: false, has_client_mods: false,
client_launch_id: randomUUID(),
browser_user_agent: UserAgent, browser_user_agent: UserAgent,
browser_version: '134.0.0.0', browser_version: '35.3.0',
os_version: '10', os_sdk_version: '19044',
referrer: '', client_build_number: 416613,
referring_domain: '', native_build_number: 65625,
referrer_current: 'https://discord.com/channels/@me',
referring_domain_current: 'discord.com',
release_channel: 'stable',
client_build_number: 416351,
client_event_source: null, client_event_source: null,
client_launch_id: randomUUID(), // ?
client_heartbeat_session_id: randomUUID(), // ?
client_app_state: 'focused', client_app_state: 'focused',
is_fast_connect: false, client_heartbeat_session_id: randomUUID(),
latest_headless_tasks: [],
latest_headless_task_run_seconds_before: null,
gateway_connect_reasons: 'AppSkeleton',
}, },
compress: false, compress: false,
client_state: { client_state: {