How do I check if the mentioned user has Administrator permission?

Viewed 66

The code that I provided below still mutes the mentioned user even though he/she has the ADMINISTRATOR permission. Also, how can I check if the moderator is trying to mute the server's owner.

const mutee = message.mentions.members.first() || message.guild.members.cache.get(args[0])

if(mutee.member.hasPermission("ADMINISTRATOR")) return message.channel.send("Cannot mute this user.");
1 Answers

I think that you should replace : mutee.member.hasPermission with simply : mutee.hasPermission, since mutee is already your GuildMember :)

Related