Stop comparing for equality on update events and just emit for performance

This commit is contained in:
Amish Shah
2016-09-25 11:23:47 +01:00
parent c8636fd277
commit 0e8f1bef97
6 changed files with 21 additions and 7 deletions

View File

@@ -22,8 +22,22 @@ client.on('guildMemberAdd', (g, m) => {
console.log(`${m.user.username} joined ${g.name}`);
})
client.on('guildMemberUpdate', (g, o, n) => {
console.log(o.nickname, n.nickname);
let c = 0;
client.on('channelUpdate', () => {
c++; console.log(c);
});
client.on('guildMemberUpdate', () => {
c++; console.log(c);
});
client.on('channelPinsUpdate', () => {
c++; console.log(c);
});
client.on('presenceUpdate', () => {
c++; console.log(c);
});
client.on('debug', console.log);