Skip to content

input your discord bitfield and it will return an array of the permission names

License

Notifications You must be signed in to change notification settings

404invalid-user/discord-bitfield-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

calculate discord bitfield

input your discord bitfield and it will return an array of the permission names.

install

npm install discord-bitfield-calculator

usage

your js file

const bitfieldCalculator = require('discord-bitfield-calculator');

//the bitfield you get from some discord endpoint
const myBitfield = 523016588865;

//get the array returned and make it a varible
const myPerms = bitfieldCalculator.permissions(myBitfield);

//do as you wish with the array or permissions
console.log(myPerms);

if(myPerms.includes('BAN_MEMBERS')) {
    console.log("this bitfield contains the permission to ban members.");
} else {
    console.log("this bitfield doesn't contains the permission to ban members.");
}

documentation

permissions(bitfield) - returns an array of permissions that can be found here.

bitfield('PERMISSION') - returns the bitfield value for that permission.

About

input your discord bitfield and it will return an array of the permission names

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published