How do I check if someone if a user is an admin?

How do I check if someone if a user is an admin?
15 Replies
d.js toolkit
d.js toolkit11mo 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
d.js docs
d.js docs11mo ago
property GuildMember#permissions The overall set of permissions for this member, taking only roles and owner status into account
treble/luna
treble/luna11mo ago
the manager has a .has property, which takes a PermissionResolvable
adnvanv
adnvanvOP11mo ago
whenever I use .has it says the function doesn't exist. Do I need to import something?
treble/luna
treble/luna11mo ago
show how you defined member
adnvanv
adnvanvOP11mo ago
let member = interaction.guild.members.cache.get(interaction.user.id);
treble/luna
treble/luna11mo ago
just use interaction.member
adnvanv
adnvanvOP11mo ago
it says interaction.member.has is not a function
treble/luna
treble/luna11mo ago
thats indeed not a function .
adnvanv
adnvanvOP11mo ago
?
treble/luna
treble/luna11mo ago
! a GuildMember has a permissions property where you need to call .has on
adnvanv
adnvanvOP11mo ago
where in the docs do I find this?
treble/luna
treble/luna11mo ago
...
adnvanv
adnvanvOP11mo ago
And I appreciate the help btw do I jus click that link or smthn
treble/luna
treble/luna11mo ago
yes
Want results from more Discord servers?
Add your server