Browse Source

Attempt to fix adding role to bot instead of requester

master
Abheek Dhawan 4 years ago
parent
commit
e8cf61468e
  1. 8
      index.js

8
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 === '👍') {

Loading…
Cancel
Save