Check if user a role id from array
Hey there, so what I am trying to do is have an array:
And I am trying to check if a user has at least one of these roles on their profile. I have
if(!allowed.includes())
, but I don't know where to go from there. If anyone can help, that would be great, thanks!3 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.Could it be something like this?
if(!message.member.roles.hasAny(allowedRoles)) return;
hasAny is the right way to go, but it takes rest params instead of an array, so you have to do
.hasAny(...allowedRoles)