fix: speedup start

This commit is contained in:
March 7th 2022-12-25 18:54:45 +07:00
parent 8898a91ed0
commit d491e77913
2 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,7 @@ const { Events, Opcodes, Status } = require('../../../util/Constants');
// Receive messages in large guilds
const run = (client, guild) => {
if (!guild.large) return;
client.ws.broadcast({
op: Opcodes.LAZY_REQUEST,
d: {

View File

@ -141,8 +141,12 @@ module.exports = async (client, { d: data }, shard) => {
client.guilds._add(guild);
}
const largeGuilds = data.guilds.filter(g => g.large);
client.emit('debug', `Received ${data.guilds.length} guilds, ${largeGuilds.length} large guilds`);
// Receive messages in large guilds
for (const guild of data.guilds) {
for (const guild of largeGuilds) {
await client.sleep(client.options.messageCreateEventGuildTimeout);
client.ws.broadcast({
op: Opcodes.LAZY_REQUEST,