From 5a2aee95cdb23a6bbfda18ca323ea98713c0c87b Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Fri, 2 Apr 2021 20:41:14 -0500 Subject: [PATCH] Try .then() and different ban method due to lack of permissions --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index 3ada35f..7d54da8 100644 --- a/index.js +++ b/index.js @@ -146,8 +146,7 @@ async function ban(message) { .then(userReaction => { const reaction = userReaction.first(); if (reaction.emoji.name === '👍') { - message.member.ban().catch(() => message.channel.send(`Nevermind, I don't have the ability to ban ${member.user.username}, likely because their role is higher than mine.`)); - message.reply(`${member} has been banned!`); + message.guild.members.cache.ban(member.user).then(user => message.reply(`<@${user.id}> has been banned!`);).catch(() => message.channel.send(`Unfortunately, I don't have the ability to ban ${member.user.username}, likely because their role is higher than mine.`)); } else { message.reply("phew! ${member}'s safe!"); }