© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
Check if user a role id from array - discord.js - Imagine an app
d-Iaa
discord.js - Imagine an app
•
4y ago
•
3 replies
istay
Check if user a role id from array
Hey there
, so what I am trying to do is have an array
:
const allowed = [
'role1',
'role2'
]
const allowed = [
'role1',
'role2'
]
And I am trying to check if a user has at least
one
of these roles on their profile
. I have
if(!allowed.includes())
if(!allowed.includes())
, but I don
't know where to go from there
. If anyone can help
, that would be great
, thanks
!
discord.js - Imagine an app
Join
Support server for discord.js, a Node.js module to interact with Discord's apps API.
57,693
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Check if user has a role
d-Iaa
discord.js - Imagine an app / djs-questions
4y ago
how to add a role from a user ID and a role ID
d-Iaa
discord.js - Imagine an app / djs-questions
4y ago
How to check if user has a role?
d-Iaa
discord.js - Imagine an app / djs-questions
4y ago