mirror of
https://github.com/danbulant/discord.js
synced 2026-06-07 08:41:29 +00:00
added toString to ServerPermissions
This commit is contained in:
parent
4e117b85d9
commit
3869f584b6
2 changed files with 9 additions and 2 deletions
|
|
@ -46,6 +46,11 @@ var ServerPermissions = (function () {
|
||||||
value: function getBit(x) {
|
value: function getBit(x) {
|
||||||
return (this.packed >>> x & 1) === 1;
|
return (this.packed >>> x & 1) === 1;
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
key: "toString",
|
||||||
|
value: function toString() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return ServerPermissions;
|
return ServerPermissions;
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,6 @@ class ServerPermissions {
|
||||||
this.name = data.name;
|
this.name = data.name;
|
||||||
this.id = data.id;
|
this.id = data.id;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.createInstantInvite = getBit(0);
|
this.createInstantInvite = getBit(0);
|
||||||
this.banMembers = getBit(1);
|
this.banMembers = getBit(1);
|
||||||
this.kickMembers = getBit(2);
|
this.kickMembers = getBit(2);
|
||||||
|
|
@ -41,6 +39,10 @@ class ServerPermissions {
|
||||||
getBit(x) {
|
getBit(x) {
|
||||||
return ((this.packed >>> x) & 1) === 1;
|
return ((this.packed >>> x) & 1) === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toString(){
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = ServerPermissions;
|
module.exports = ServerPermissions;
|
||||||
Loading…
Reference in a new issue