diff --git a/src/client/websocket/handlers/GUILD_CREATE.js b/src/client/websocket/handlers/GUILD_CREATE.js index 4d10884..58f704c 100644 --- a/src/client/websocket/handlers/GUILD_CREATE.js +++ b/src/client/websocket/handlers/GUILD_CREATE.js @@ -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: { diff --git a/src/client/websocket/handlers/READY.js b/src/client/websocket/handlers/READY.js index bc34ad4..0af353f 100644 --- a/src/client/websocket/handlers/READY.js +++ b/src/client/websocket/handlers/READY.js @@ -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,