How to know if user has more permissions than the bot?

Hi, how can i get to know if a discord user has more perms than the bot, I want the bot to change a specified user username when a command is run, but I am getting an missing permission error, i think it's because that the user whose name has to be changed is on higher rank than the bot, if it doesn't work like that let me know, also pls help me with my question. thanks in advance for the help.
5 Replies
d.js toolkit
d.js toolkit12mo ago
- 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! - Marked as resolved by OP
chewie
chewie12mo ago
the bot cant change nicknames of a user thats higher than the bot
Harsh
HarshOP12mo ago
oh, and how can i get to know if the user is on higher rank than the bot?
chewie
chewie12mo ago
compare guild.members.me.roles.highest.position vs member.roles.highest.position and you have to check if the target is the owner, that wouldn't work either
Harsh
HarshOP12mo ago
ohk, thanks
Want results from more Discord servers?
Add your server