mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +01:00
Fixed getBit
will now resolve all permissions to true if it has manage role
This commit is contained in:
@@ -53,6 +53,9 @@ var ChannelPermissions = (function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ChannelPermissions.prototype.getBit = function getBit(x) {
|
ChannelPermissions.prototype.getBit = function getBit(x) {
|
||||||
|
if ((this.packed >>> 3 & 1) === 1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return (this.packed >>> x & 1) === 1;
|
return (this.packed >>> x & 1) === 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ var EvaluatedPermissions = (function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
EvaluatedPermissions.prototype.getBit = function getBit(x) {
|
EvaluatedPermissions.prototype.getBit = function getBit(x) {
|
||||||
|
if ((this.packed >>> 3 & 1) === 1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return (this.packed >>> x & 1) === 1;
|
return (this.packed >>> x & 1) === 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -42,11 +42,20 @@ var ServerPermissions = (function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ServerPermissions.prototype.getBit = function getBit(x) {
|
ServerPermissions.prototype.getBit = function getBit(x) {
|
||||||
|
if ((this.packed >>> 3 & 1) === 1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return (this.packed >>> x & 1) === 1;
|
return (this.packed >>> x & 1) === 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
ServerPermissions.prototype.setBit = function setBit() {
|
ServerPermissions.prototype.setBit = function setBit(location, value) {
|
||||||
//dummy function for now
|
|
||||||
|
if (value) {
|
||||||
|
// allow that permission
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// not allowed
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ServerPermissions.prototype.toString = function toString() {
|
ServerPermissions.prototype.toString = function toString() {
|
||||||
|
|||||||
@@ -98,6 +98,9 @@ class ChannelPermissions{
|
|||||||
set voiceUseVoiceActivation(val){this.setBit(25, val);}
|
set voiceUseVoiceActivation(val){this.setBit(25, val);}
|
||||||
|
|
||||||
getBit(x) {
|
getBit(x) {
|
||||||
|
if( ((this.packed >>> 3) & 1) === 1 ){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return ((this.packed >>> x) & 1) === 1;
|
return ((this.packed >>> x) & 1) === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,9 @@ class EvaluatedPermissions {
|
|||||||
set voiceUseVoiceActivation(val) { this.setBit(25, val); }
|
set voiceUseVoiceActivation(val) { this.setBit(25, val); }
|
||||||
|
|
||||||
getBit(x) {
|
getBit(x) {
|
||||||
|
if( ((this.packed >>> 3) & 1) === 1 ){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return ((this.packed >>> x) & 1) === 1;
|
return ((this.packed >>> x) & 1) === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -97,11 +97,21 @@ class ServerPermissions {
|
|||||||
set voiceUseVoiceActivation(val){this.setBit(25, val);}
|
set voiceUseVoiceActivation(val){this.setBit(25, val);}
|
||||||
|
|
||||||
getBit(x) {
|
getBit(x) {
|
||||||
|
if( ((this.packed >>> 3) & 1) === 1 ){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return ((this.packed >>> x) & 1) === 1;
|
return ((this.packed >>> x) & 1) === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
setBit(){
|
setBit(location, value){
|
||||||
//dummy function for now
|
|
||||||
|
if(value){
|
||||||
|
// allow that permission
|
||||||
|
|
||||||
|
}else{
|
||||||
|
// not allowed
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
toString(){
|
toString(){
|
||||||
|
|||||||
Reference in New Issue
Block a user