fix: ClientUser.notes return empty Collection
fix: Recieve messages from large servers #72
feat: checkUpdate return Debug event (not console.log)
feat: RelationshipAdd event, param type return RelationshipTypes
feat: online status when login
feat: fix documents
This commit is contained in:
March 7th
2022-06-06 00:42:08 +07:00
parent 04251a8b87
commit c165824419
10 changed files with 78 additions and 51 deletions
+21 -1
View File
@@ -1,6 +1,24 @@
'use strict';
const { Events, Status } = require('../../../util/Constants');
const { Events, Opcodes, Status } = require('../../../util/Constants');
// Receive messages in large guilds
const run = (client, 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]],
},
},
});
};
module.exports = (client, { d: data }, shard) => {
let guild = client.guilds.cache.get(data.id);
@@ -8,6 +26,7 @@ module.exports = (client, { d: data }, shard) => {
if (!guild.available && !data.unavailable) {
// A newly available guild
guild._patch(data);
run(client, guild);
}
} else {
// A new guild
@@ -20,6 +39,7 @@ module.exports = (client, { d: data }, shard) => {
* @param {Guild} guild The created guild
*/
client.emit(Events.GUILD_CREATE, guild);
run(client, guild);
}
}
};