From f1484b9d6a16c320e449a9bcb33f69ef26782603 Mon Sep 17 00:00:00 2001 From: Shubham Date: Sun, 20 Oct 2019 19:27:01 +0530 Subject: [PATCH] Remove MemberRole on addding. --- commands/non-htb-verify.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/non-htb-verify.js b/commands/non-htb-verify.js index 264d9fa..123c9cf 100644 --- a/commands/non-htb-verify.js +++ b/commands/non-htb-verify.js @@ -19,7 +19,11 @@ const getUserData = (token) => { const giveRole = function(member, author, channel, hasRole, defaultRole) { if (!hasRole) { - let deadRole = member.roles.find(r => r.name === "DeadAccount") + let memberRole = member.roles.find(r => r.name === "Member"); + if (memberRole) { + await (member.removeRole(memberRole.id)) + } + let deadRole = member.roles.find(r => r.name === "DeadAccount"); if (deadRole) { await (member.removeRole(deadRole.id)) }