mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
Actually add GUILD_SYNC
This commit is contained in:
14
src/client/websocket/packets/handlers/GuildSync.js
Normal file
14
src/client/websocket/packets/handlers/GuildSync.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const AbstractHandler = require('./AbstractHandler');
|
||||
|
||||
class GuildSyncHandler extends AbstractHandler {
|
||||
|
||||
handle(packet) {
|
||||
const data = packet.d;
|
||||
const client = this.packetManager.client;
|
||||
|
||||
client.actions.GuildSync.handle(data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = GuildSyncHandler;
|
||||
@@ -21,6 +21,12 @@ class ReadyHandler extends AbstractHandler {
|
||||
client.dataManager.newChannel(privateDM);
|
||||
}
|
||||
|
||||
if (!client.user.bot) {
|
||||
client.setInterval(client.syncGuilds.bind(client), 30000);
|
||||
}
|
||||
|
||||
client.once('ready', client.syncGuilds.bind(client));
|
||||
|
||||
this.packetManager.ws.sessionID = data.session_id;
|
||||
|
||||
this.packetManager.ws.checkIfReady('abc');
|
||||
|
||||
Reference in New Issue
Block a user