Stop the EventEmitter debug warnings when fetching lots of guilds before ready

This commit is contained in:
Amish Shah
2017-04-29 17:46:36 +01:00
parent 584961b04b
commit dd8f77fcf0
2 changed files with 6 additions and 15 deletions

View File

@@ -63,7 +63,12 @@ class ReadyHandler extends AbstractHandler {
client.ws.connection.triggerReady();
}, 1200 * data.guilds.length);
client.once('ready', () => client.clearTimeout(t));
client.setMaxListeners(data.guilds.length + 1);
client.once('ready', () => {
client.setMaxListeners(10);
client.clearTimeout(t);
});
const ws = this.packetManager.ws;