mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 10:03:31 +01:00
Servers now manage server-wide permissions
Servers now create ServerPermissions objects for roles
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
class ServerPermissions {
|
||||
|
||||
constructor(packedPermissions) {
|
||||
constructor(data) {
|
||||
|
||||
var self = this;
|
||||
|
||||
function getBit(x) {
|
||||
return ((this.packed >>> x) & 1) === 1;
|
||||
return ((self.packed >>> x) & 1) === 1;
|
||||
}
|
||||
|
||||
this.packed = packedPermissions;
|
||||
this.packed = data.permissions;
|
||||
this.name = data.name;
|
||||
this.id = data.id;
|
||||
|
||||
|
||||
|
||||
this.createInstantInvite = getBit(0);
|
||||
this.banMembers = getBit(1);
|
||||
@@ -35,4 +41,6 @@ class ServerPermissions {
|
||||
getBit(x) {
|
||||
return ((this.packed >>> x) & 1) === 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ServerPermissions;
|
||||
Reference in New Issue
Block a user