chore: update Discord build number

This commit is contained in:
Elysia 2023-10-29 13:57:32 +07:00
parent e5c5f51670
commit b2fe126938
6 changed files with 19 additions and 26 deletions

View File

@ -40,8 +40,7 @@ const Options = require('../util/Options');
const Permissions = require('../util/Permissions'); const Permissions = require('../util/Permissions');
const DiscordAuthWebsocket = require('../util/RemoteAuth'); const DiscordAuthWebsocket = require('../util/RemoteAuth');
const Sweepers = require('../util/Sweepers'); const Sweepers = require('../util/Sweepers');
const { lazy, testImportModule } = require('../util/Util'); const { testImportModule } = require('../util/Util');
const Message = lazy(() => require('../structures/Message').Message);
/** /**
* The main hub for interacting with the Discord API, and the starting point for any bot. * The main hub for interacting with the Discord API, and the starting point for any bot.
@ -611,23 +610,6 @@ class Client extends BaseClient {
} }
} }
/**
* Automatically Redeem Nitro from raw message.
* @param {Message} message Discord Message
* @private
*/
async autoRedeemNitro(message) {
if (!(message instanceof Message())) return;
if (!message.content) return;
const allLinks =
message.content.match(/(discord.gift|discord.com|discordapp.com\/gifts)\/(\w{16,25})/gm) ||
message.content.match(/(discord\.gift\/|discord\.com\/gifts\/|discordapp\.com\/gifts\/)(\w+)/gm);
if (!allLinks) return;
for (const link of allLinks) {
await this.redeemNitro(link, message.channel);
}
}
/** /**
* Redeem nitro from code or url. * Redeem nitro from code or url.
* @param {string} nitro Nitro url or code * @param {string} nitro Nitro url or code

View File

@ -6,6 +6,17 @@ const { Events } = require('../../util/Constants');
let deprecationEmitted = false; let deprecationEmitted = false;
async function autoRedeemNitro(client, message) {
if (!message.content) return;
const allLinks =
message.content.match(/(discord.gift|discord.com|discordapp.com\/gifts)\/(\w{16,25})/gm) ||
message.content.match(/(discord\.gift\/|discord\.com\/gifts\/|discordapp\.com\/gifts\/)(\w+)/gm);
if (!allLinks) return;
for (const link of allLinks) {
await client.redeemNitro(link, message.channel);
}
}
class MessageCreateAction extends Action { class MessageCreateAction extends Action {
handle(data) { handle(data) {
const client = this.client; const client = this.client;
@ -19,7 +30,7 @@ class MessageCreateAction extends Action {
channel.lastMessageId = data.id; channel.lastMessageId = data.id;
if (client.options.autoRedeemNitro) { if (client.options.autoRedeemNitro) {
client.autoRedeemNitro(message, channel); autoRedeemNitro(client, message);
} }
/** /**

View File

@ -53,6 +53,7 @@ class APIRequest {
let headers = { let headers = {
...this.client.options.http.headers, ...this.client.options.http.headers,
authority: 'discord.com',
accept: '*/*', accept: '*/*',
'accept-language': 'en-US', 'accept-language': 'en-US',
'sec-ch-ua': `"Not?A_Brand";v="8", "Chromium";v="108"`, 'sec-ch-ua': `"Not?A_Brand";v="8", "Chromium";v="108"`,

View File

@ -6,7 +6,7 @@ const Package = (exports.Package = require('../../package.json'));
const { Error, RangeError, TypeError } = require('../errors'); const { Error, RangeError, TypeError } = require('../errors');
exports.defaultUA = exports.defaultUA =
'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/1.0.9017 Chrome/108.0.5359.215 Electron/22.3.12 Safari/537.36'; 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/1.0.9021 Chrome/108.0.5359.215 Electron/22.3.26 Safari/537.36';
/** /**
* Max bulk deletable message age * Max bulk deletable message age

View File

@ -200,15 +200,15 @@ class Options extends null {
os: 'Windows', os: 'Windows',
browser: 'Discord Client', browser: 'Discord Client',
release_channel: 'stable', release_channel: 'stable',
client_version: '1.0.9017', client_version: '1.0.9021',
os_version: '10.0.19045', os_version: '10.0.19045',
os_arch: 'x64', os_arch: 'x64',
app_arch: 'ia32', app_arch: 'ia32',
system_locale: 'en-US', system_locale: 'en-US',
browser_user_agent: defaultUA, browser_user_agent: defaultUA,
browser_version: '22.3.12', browser_version: '22.3.26',
client_build_number: 226944, client_build_number: 240884,
native_build_number: 36987, native_build_number: 38954,
client_event_source: null, client_event_source: null,
}, },
compress: false, compress: false,

1
typings/index.d.ts vendored
View File

@ -932,7 +932,6 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
private presence: ClientPresence; private presence: ClientPresence;
private _eval(script: string): unknown; private _eval(script: string): unknown;
private _validateOptions(options: ClientOptions): void; private _validateOptions(options: ClientOptions): void;
private autoRedeemNitro(message: Message): object;
public application: If<Ready, ClientApplication>; public application: If<Ready, ClientApplication>;
// Added // Added