Browse Source

Try role request fix

master
Abheek Dhawan 4 years ago
parent
commit
7ba6b0ddb2
  1. 10
      index.js

10
index.js

@ -32,12 +32,12 @@ async function roleRequest(message) {
return; return;
} }
const verificationMessage = message.channel.send(`<@&826508679636844574>, <@${message.author.id}> would like the **${role}** role. Are they worthy?`); const verificationMessage = message.channel.send(`<@&826508679636844574>, <@${message.author.id}> would like the **${role}** role. Are they worthy?`);
verificationMessage.react('👍'); message.react('👍');
verificationMessage.react('👎'); message.react('👎');
const filter = (reaction, user) => { const filter = (reaction, member) => {
return ['👍', '👎'].includes(reaction.emoji.name) && user.hasPermission('ADMINISTRATOR'); 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 => { .then(userReaction => {
const reaction = userReaction.first(); const reaction = userReaction.first();
if (reaction.emoji === '👍') { if (reaction.emoji === '👍') {

Loading…
Cancel
Save