Managing roles with name/id
Hi, my server have a role predefined called "officer", how could I dynamicaly get this role id ?
7 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.
- Issue solved? Press the button!you can use guild.roles.cache.find(...)
I must be missing something do you have a link to the doc of it ?
To add more context :
I am getting my role through the interaction of user, I would like to compare it to the roles "Off..."
But I find an id only from this console log, which is what I want, but I cannot get the id of my role to compare
_roles is a private property, don't use it
Can you please explain why its not necessary to use private properties?
See what Qjuh said
Yeah, I see that. But, if I need to get array of roles ids without everyone role, can I use private property?
I just havent heard yet that its not worth using the private properties, and want to get explanation or source when I can read about that
Okay, thanks!