From e8cf61468e3ea20ac61a78bc1606f653c44d50fb Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Fri, 2 Apr 2021 21:20:43 -0500 Subject: [PATCH] Attempt to fix adding role to bot instead of requester --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index c062261..74a95c7 100644 --- a/index.js +++ b/index.js @@ -303,13 +303,13 @@ async function roleRequest(message) { } const verificationMessage = message.channel.send(`<@${message.author.id}> would like the **${role}** role. Are they worthy?`) - .then(message => { - message.react('👍'); - message.react('👎'); + .then(verificationMessage => { + verificationMessage.react('👍'); + verificationMessage.react('👎'); const filter = (reaction, user) => { return ['👍', '👎'].includes(reaction.emoji.name) && message.guild.members.cache.get(user.id).hasPermission('ADMINISTRATOR') && !user.bot; }; - message.awaitReactions(filter, { max: 1, time: 600000000, errors: ['time'] }) + verificationMessage.awaitReactions(filter, { max: 1, time: 600000000, errors: ['time'] }) .then(userReaction => { const reaction = userReaction.first(); if (reaction.emoji.name === '👍') {