From 6c6025d94aec7a16ec528f3362c980a16bdb58b7 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sat, 3 Apr 2021 23:51:28 -0500 Subject: [PATCH] Fix checking if roles changed --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 51bf217..5a64875 100644 --- a/index.js +++ b/index.js @@ -955,10 +955,10 @@ client.on('guildMemberUpdate', (oldMember, newMember) => { .setThumbnail(newMember.user.avatarURL()) .setTimestamp() .setColor('e7778b'); - if (removedRoles) { + if (removedRoles.array().length > 0) { memberUpdateEmbed.addField("Roles Removed", removedRoles.map(r => `${r}`).join(' • ')); } - if (addedRoles) { + if (addedRoles.array().length > 0) { memberUpdateEmbed.addField("Roles Added", addedRoles.map(r => `${r}`).join(' • ')); } if (newMember.nickname !== oldMember.nickname) {