To prevent that members can execute commands which they shouldn't, you can check if the member has certain permissions. Discord makes use of a bitfield, which basically is a large number from which you can extract whether the member has the required permissions or not. As these numbers are hard to remind, you can import the permissionsBitfield object, which has as the key an easy to understand name for the permission and as the value the number which defines the permission. Here is an overview from the permissions:

Last updated