message.mentions.members.forEach(men => {
let member = message.mentions.members.get(men)
if (!member.bannable) return message.reply(not_bannable)
const reason = args.slice(1).join(" ");
member.ban({reason: reason || "no reason"}).then((member) => {
message.channel.send(member + " banned by " + message.author.id)
}).catch(err => console.log(err))
})
I have developed a ban command that can ban multiple users simultaneously, but when I try to run it, an error occurs.
I am using discord version 13
What could be causing this error?
Error Message: Cannot read properties of undefined (reading 'bannable')