maybe minor update ?
This commit is contained in:
@@ -608,13 +608,20 @@ class WebSocketShard extends EventEmitter {
|
||||
this.status = Status.IDENTIFYING;
|
||||
|
||||
// Clone the identify payload and assign the token and shard info
|
||||
client.options.ws.properties = Object.assign(client.options.ws.properties, {
|
||||
$browser_user_agent:
|
||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36',
|
||||
$browser_version: '101.0.4951.54',
|
||||
});
|
||||
const d = {
|
||||
...client.options.ws,
|
||||
// Intents: Intents.resolve(client.options.intents), // Remove, Req by dolfies_person [Reddit]
|
||||
// Remove, Req by dolfies_person [Reddit]: intents: Intents.resolve(client.options.intents),
|
||||
token: client.token,
|
||||
shard: [this.id, Number(client.options.shardCount)],
|
||||
// Remove: shard: [this.id, Number(client.options.shardCount)],
|
||||
};
|
||||
|
||||
delete d.large_threshold;
|
||||
|
||||
this.debug(`[IDENTIFY] Shard ${this.id}/${client.options.shardCount} with intents: ${32767} :)`);
|
||||
this.send({ op: Opcodes.IDENTIFY, d }, true);
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
const { Events } = require('../../../util/Constants');
|
||||
|
||||
module.exports = (client, { d: data }) => {
|
||||
if (!data.application_commands[0]) return;
|
||||
@@ -7,4 +8,8 @@ module.exports = (client, { d: data }) => {
|
||||
if (!user) continue;
|
||||
user.applications._add(command, true);
|
||||
}
|
||||
client.emit(
|
||||
Events.GUILD_APPLICATION_COMMANDS_UPDATE,
|
||||
client.users.cache.get(data.application_commands[0].application_id).applications.cache,
|
||||
);
|
||||
};
|
||||
|
@@ -4,7 +4,7 @@ let ClientUser;
|
||||
const axios = require('axios');
|
||||
const chalk = require('chalk');
|
||||
const Discord = require('../../../index');
|
||||
const { Events } = require('../../../util/Constants');
|
||||
const { Events, Opcodes } = require('../../../util/Constants');
|
||||
|
||||
async function checkUpdate() {
|
||||
const res_ = await axios.get(`https://registry.npmjs.com/${encodeURIComponent('discord.js-selfbot-v13')}`);
|
||||
@@ -47,7 +47,7 @@ module.exports = (client, { d: data }, shard) => {
|
||||
|
||||
client.user.connectedAccounts = data.connected_accounts ?? [];
|
||||
|
||||
for (const [userid, note] of Object.entries(data.notes)) {
|
||||
for (const [userid, note] of Object.entries(data.notes ?? {})) {
|
||||
client.user.notes.set(userid, note);
|
||||
}
|
||||
|
||||
@@ -83,6 +83,25 @@ module.exports = (client, { d: data }, shard) => {
|
||||
client.guilds._add(guild);
|
||||
}
|
||||
|
||||
// Receive messages in large guilds [Test]
|
||||
client.guilds.cache.map(guild => {
|
||||
client.ws.broadcast({
|
||||
op: Opcodes.LAZY_REQUEST,
|
||||
d: {
|
||||
guild_id: guild.id,
|
||||
typing: true,
|
||||
threads: false,
|
||||
activities: true,
|
||||
thread_member_lists: [],
|
||||
members: [],
|
||||
channels: {
|
||||
// [guild.channels.cache.first().id]: [[0, 99]],
|
||||
},
|
||||
},
|
||||
});
|
||||
return true;
|
||||
});
|
||||
|
||||
client.relationships._setup(data.relationships);
|
||||
|
||||
shard.checkReady();
|
||||
|
Reference in New Issue
Block a user