So I was upading a unban command and I get a error TypeError: bot.fetchUser is not a function
Here is the code
run: async (bot, message, args) => {
if(!message.member.hasPermission(["BAN_MEMBERS", "ADMINISTRATOR"])) return message.channel.send(":x: You dont have permission to perform this command!")
if(isNaN(args[0])) return message.channel.send(":x: You need to provide an ID.")
let bannedMember = await bot.fetchUser(args[0])
if(!bannedMember) return message.channel.send(":x: Please provide a user id to unban someone!")
let reason = args.slice(1).join(" ")
if(!reason) reason = "No reason given!"
if(!message.guild.me.hasPermission(["BAN_MEMBERS", "ADMINISTRATOR"])) return message.channel.send(":x: I dont have permission to perform this command!")|
message.delete()
try {
message.guild.members.unban(bannedMember, reason)
message.channel.send(`:white_check_mark: ${bannedMember.tag} has been unbanned from the guild!`)
} catch(e) {
console.log(e.message)
}
}
}
I dont know what to change bot.fetchUser to since the discord.js V12 update.