mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
began to work on update listening
This commit is contained in:
@@ -18,7 +18,6 @@ var ServerPermissions = (function () {
|
|||||||
this.name = data.name;
|
this.name = data.name;
|
||||||
this.id = data.id;
|
this.id = data.id;
|
||||||
|
|
||||||
this.createInstantInvite = getBit(0);
|
|
||||||
this.banMembers = getBit(1);
|
this.banMembers = getBit(1);
|
||||||
this.kickMembers = getBit(2);
|
this.kickMembers = getBit(2);
|
||||||
this.manageRoles = getBit(3);
|
this.manageRoles = getBit(3);
|
||||||
@@ -51,6 +50,14 @@ var ServerPermissions = (function () {
|
|||||||
value: function toString() {
|
value: function toString() {
|
||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
key: "createInstantInvite",
|
||||||
|
get: function get() {
|
||||||
|
return this.getBit(0);
|
||||||
|
},
|
||||||
|
set: function set(val) {
|
||||||
|
this.setBit(0, val);
|
||||||
|
}
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return ServerPermissions;
|
return ServerPermissions;
|
||||||
|
|||||||
@@ -122,7 +122,18 @@ var Server = (function () {
|
|||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: "updateRole",
|
key: "updateRole",
|
||||||
value: function updateRole() {}
|
value: function updateRole(data) {
|
||||||
|
|
||||||
|
var oldRole = this.getRole(data.id);
|
||||||
|
|
||||||
|
if (oldRole) {
|
||||||
|
|
||||||
|
oldRole.packed = data.permissions;
|
||||||
|
oldRole.name = data.name;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
key: "removeRole",
|
key: "removeRole",
|
||||||
value: function removeRole(id) {
|
value: function removeRole(id) {
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ class ServerPermissions {
|
|||||||
this.packed = data.permissions;
|
this.packed = data.permissions;
|
||||||
this.name = data.name;
|
this.name = data.name;
|
||||||
this.id = data.id;
|
this.id = data.id;
|
||||||
|
|
||||||
this.createInstantInvite = getBit(0);
|
|
||||||
this.banMembers = getBit(1);
|
this.banMembers = getBit(1);
|
||||||
this.kickMembers = getBit(2);
|
this.kickMembers = getBit(2);
|
||||||
this.manageRoles = getBit(3);
|
this.manageRoles = getBit(3);
|
||||||
@@ -35,6 +34,9 @@ class ServerPermissions {
|
|||||||
this.voiceUseVoiceActivation = getBit(25);
|
this.voiceUseVoiceActivation = getBit(25);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get createInstantInvite(){return this.getBit(0);}
|
||||||
|
set createInstantInvite(val){this.setBit(0, val);}
|
||||||
|
|
||||||
getBit(x) {
|
getBit(x) {
|
||||||
return ((this.packed >>> x) & 1) === 1;
|
return ((this.packed >>> x) & 1) === 1;
|
||||||
|
|||||||
@@ -83,7 +83,18 @@ class Server {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateRole(){
|
updateRole(data){
|
||||||
|
|
||||||
|
var oldRole = this.getRole(data.id);
|
||||||
|
|
||||||
|
if(oldRole){
|
||||||
|
|
||||||
|
oldRole.packed = data.permissions;
|
||||||
|
oldRole.name = data.name;
|
||||||
|
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user