Browse Source

Use .then() for role add confirmation

master
Abheek Dhawan 4 years ago
parent
commit
405b89324a
  1. 3
      index.js

3
index.js

@ -313,8 +313,7 @@ async function roleRequest(message) {
.then(userReaction => { .then(userReaction => {
const reaction = userReaction.first(); const reaction = userReaction.first();
if (reaction.emoji.name === '👍') { if (reaction.emoji.name === '👍') {
message.reply("wow I guess you ARE worthy! ||mods must be real mistaken||"); message.member.roles.add(role).then(message.reply("wow I guess you ARE worthy! ||mods must be real mistaken||")).catch(() => { message.reply("It seems I don't have permissions to give that role, as it's likely above me :(") });
message.member.roles.add(role).catch(() => { message.reply("It seems I don't have permissions to give that role, as it's likely above me :(") });
} else { } else {
message.reply("I guess you won't be getting that role!"); message.reply("I guess you won't be getting that role!");
} }

Loading…
Cancel
Save