From 7ba6b0ddb2d79181b5331b3d8c8ca2dd6829e9e3 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Wed, 31 Mar 2021 21:10:24 -0500 Subject: [PATCH] Try role request fix --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 0ba6237..829a101 100644 --- a/index.js +++ b/index.js @@ -32,12 +32,12 @@ async function roleRequest(message) { return; } const verificationMessage = message.channel.send(`<@&826508679636844574>, <@${message.author.id}> would like the **${role}** role. Are they worthy?`); - verificationMessage.react('👍'); - verificationMessage.react('👎'); - const filter = (reaction, user) => { - return ['👍', '👎'].includes(reaction.emoji.name) && user.hasPermission('ADMINISTRATOR'); + message.react('👍'); + message.react('👎'); + const filter = (reaction, member) => { + return ['👍', '👎'].includes(reaction.emoji.name) && message.guild.cache.members.get(user.id).hasPermission('ADMINISTRATOR'); }; - verificationMessage.awaitReactions(filter, { max: 1, time: 600000000, errors: ['time'] }) + message.awaitReactions(filter, { max: 1, time: 600000000, errors: ['time'] }) .then(userReaction => { const reaction = userReaction.first(); if (reaction.emoji === '👍') {