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