From e700a560be21c7de70ea5443c676674d90dcb5af Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Thu, 1 Apr 2021 22:19:47 -0500 Subject: [PATCH] Test return if user already has role --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 6b9c1a1..4e4f3e9 100644 --- a/index.js +++ b/index.js @@ -128,6 +128,10 @@ async function roleRequest(message) { message.reply("not a valid role!"); return; } + if (role === "reader" && message.member.hasRole(readerRole)) { + message.reply("you already have that role!"); + return; + } const verificationMessage = message.channel.send(`<@&826508679636844574>, <@${message.author.id}> would like the **${role}** role. Are they worthy?`); message.react('👍'); message.react('👎');