I can't understand what is wrong in this code. Error: Cannot read property 'users' of undefined
module.exports = {
name: "ban",
execute(client, message, args) {
const author = message.member
const target = message.mentions.users.first()
const reason = args.slice(1).join(' ')
It is actually message.mentions.members.first()
which will then take the first member mentioned in the message
This means that message is not a real Message object. Make sure in your command handler, the arguments are passed like this:
(client, message, args)
In that order. I suspect it might be something like this right now
(message, client, args)