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