mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Stop the EventEmitter debug warnings when fetching lots of guilds before ready
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -17,22 +17,8 @@ client.on('ready', () => {
|
||||
console.timeEnd('magic');
|
||||
});
|
||||
|
||||
client.on('userUpdate', (o, n) => {
|
||||
console.log(o.username, n.username);
|
||||
});
|
||||
|
||||
client.on('debug', console.log);
|
||||
|
||||
client.on('emojiCreate', e => console.log('create!!', e.name));
|
||||
client.on('emojiDelete', e => console.log('delete!!', e.name));
|
||||
client.on('emojiUpdate', (o, n) => console.log('update!!', o.name, n.name));
|
||||
|
||||
client.on('guildMemberAdd', m => console.log(`${m.user.username} joined ${m.guild.name}`));
|
||||
|
||||
client.on('channelCreate', channel => {
|
||||
console.log(`made ${channel.name}`);
|
||||
});
|
||||
|
||||
client.on('error', m => console.log('debug', m));
|
||||
client.on('reconnecting', m => console.log('debug', m));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user