how do i check if a user is an admin
i want to have a discord command which deletes everything in a server. but i don't know how to check if the user who sent it is an admin how do i check?
7 Replies
- 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 OPi did this interaction.member.permissions.has(PermissionFlagsBits.Administrator) but it didn't work

documentation suggestion for @bringupyourpost:
:property: BaseInteraction#memberPermissions
[email protected]
The permissions of the member, if one exists, in the channel this interaction was executed inIt's better. But i can't understand if your case not working
Do you import
PermissionFlagsBits
?when you say it didn't work, how so?
oh ok i fixed it