function calculatePermissions(
  permissionBits,
) {
  return Object.keys(DiscordBitwisePermissionFlags).filter((permission) => {
    // Since Object.keys() not only returns the permission names but also the bit values we need to return false if it is a Number
    if (Number(permission)) return false;
    // Check if permissionBits has this permission
    return BigInt(permissionBits) &
      BigInt(DiscordBitwisePermissionFlags[permission]);
  });
}
/** This function converts a bitwise string to permission strings */
This function converts a bitwise string to permission strings
This function converts a bitwise string to permission strings
function calculatePermissions(
  permissionBits,
) {
  return Object.keys(DiscordBitwisePermissionFlags).filter((permission) => {
    if (Number(permission)) return false;
    return BigInt(permissionBits) &
      BigInt(DiscordBitwisePermissionFlags[permission]);
  });
}
function calculatePermissions ( permissionBits , ) { return Object . keys ( DiscordBitwisePermissionFlags ) . filter ( ( permission ) => { if ( Number ( permission ) ) return false ; return BigInt ( permissionBits ) & BigInt ( DiscordBitwisePermissionFlags [ permission ] ) ; } ) ; }
This function converts a bitwise string to permission strings
This function converts a bitwise string to permission strings
// Since Object.keys() not only returns the permission names but also the bit values we need to return false if it is a Number // Check if permissionBits has this permission