From 5f27f7f2c61a28fdf3306636432c7a2e655a8056 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Thu, 1 Apr 2021 22:23:06 -0500 Subject: [PATCH] Use ID for role check --- index.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index af8121a..af5ddb8 100644 --- a/index.js +++ b/index.js @@ -128,7 +128,22 @@ async function roleRequest(message) { message.reply("not a valid role!"); return; } - if (role === "reader" && message.member.roles.cache.has(readerRole)) { + if (role === "reader" && message.member.roles.cache.has(readerRole.id)) { + message.reply("you already have that role!"); + return; + } + + if (role === "spectator" && message.member.roles.cache.has(specRole.id)) { + message.reply("you already have that role!"); + return; + } + + if (role === "spec" && message.member.roles.cache.has(specRole.id)) { + message.reply("you already have that role!"); + return; + } + + if (role === "writer" && message.member.roles.cache.has(writerRole.id)) { message.reply("you already have that role!"); return; }