If user has higher role than bot
Currently i have this code:
how can i check if the bot has a lower role than targetMember?
6 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!Latest discord.js
Compare
targetMember.roles.highest.position
to message.guild.members.me.roles.highest.position
so if(targetMember.roles.highest.position >= message.guild.members.me.roles.highest.position)
correct?
That would check if the mentioned member's highest role is above the bot member's highest role
oh so opposite
<=
Got it solved thanks a lot !