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’m trying to build a ban command that allows you to ban multiple users at once. Unfortunately, an error occurs when I execute it.
I work with discord v13
Why does this error occur?
Cannot read properties of undefined (reading 'bannable')