From 86c5a5441760444e72714d58d436a2c542b33c5a Mon Sep 17 00:00:00 2001 From: Lamp Date: Fri, 10 Aug 2018 20:35:39 -0700 Subject: [PATCH] wtf --- src/colorroles.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/colorroles.js b/src/colorroles.js index 86c9748..0117045 100755 --- a/src/colorroles.js +++ b/src/colorroles.js @@ -80,13 +80,14 @@ colorRoles.pruneOrphanRoles = async function() { // delete all color roles that // event listeners -dClient.on('presenceUpdate', (oldMember, newMember) => { // update color role on presence update // emitted also on member join +dClient.on('presenceUpdate', async (oldMember, newMember) => { // update color role on presence update // emitted also on member join + if (!oldMember.presence || !newMember.presence) return; if (oldMember.presence.status != newMember.presence.status) { - colorRoles.update(newMember); + await colorRoles.update(newMember); } }); -dClient.on('guildMemberRemove', member => { // update (delete) color role on member leave - colorRoles.update(member); +dClient.on('guildMemberRemove', async member => { // update (delete) color role on member leave + await colorRoles.update(member); });