From 5ce0def9d087464a367ba3bb0d0a6b33c88124d5 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Thu, 17 Aug 2017 09:28:01 -0700 Subject: [PATCH] fix sync (#1792) * Update Ready.js * Update ClientDataManager.js --- src/client/ClientDataManager.js | 1 + src/client/websocket/packets/handlers/Ready.js | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/client/ClientDataManager.js b/src/client/ClientDataManager.js index d6cc3be20..714fc30d4 100644 --- a/src/client/ClientDataManager.js +++ b/src/client/ClientDataManager.js @@ -19,6 +19,7 @@ class ClientDataManager { const already = this.client.guilds.has(data.id); const guild = new Guild(this.client, data); this.client.guilds.set(guild.id, guild); + if (!this.client.user.bot && this.client.options.sync) this.client.syncGuilds([guild]); if (this.pastReady && !already) { /** * Emitted whenever the client joins a guild. diff --git a/src/client/websocket/packets/handlers/Ready.js b/src/client/websocket/packets/handlers/Ready.js index 8c2492abf..29745c42c 100644 --- a/src/client/websocket/packets/handlers/Ready.js +++ b/src/client/websocket/packets/handlers/Ready.js @@ -44,8 +44,6 @@ class ReadyHandler extends AbstractHandler { } } - if (!client.user.bot && client.options.sync) client.setInterval(client.syncGuilds.bind(client), 30000); - if (!client.users.has('1')) { client.dataManager.newUser({ id: '1',