I want the discord bot to allow the command to be run only if the person has one of the roles in the array.
const validroles = ['owner', 'Co-Owner']
if(!message.member.roles.includes(validroles)) {
return message.channel.send(`**${message.author}, You do not have permission to use this command**`)
}
It gives me the error TypeError: message.member.roles.includes is not a function
How do I fix this?
question from:https://stackoverflow.com/questions/66056066/message-member-roles-includes-is-not-a-function