Servers now manage server-wide permissions

Servers now create ServerPermissions objects for roles
This commit is contained in:
hydrabolt
2015-10-03 19:44:08 +01:00
parent 6967f5e649
commit b264b61718
5 changed files with 159 additions and 57 deletions

View File

@@ -1,3 +1,5 @@
var ServerPermissions = require("./ServerPermissions.js");
class Server {
constructor(data, client) {
this.client = client;
@@ -12,6 +14,10 @@ class Server {
this.afkChannelId = data.afk_channel_id;
this.roles = [];
for(var permissionGroup of data.roles){
this.roles.push( new ServerPermissions(permissionGroup) );
}
if(!data.members){
data.members = [ client.user ];
@@ -30,6 +36,10 @@ class Server {
}
}
get permissionGroups(){
return this.roles;
}
get iconURL() {
if (!this.icon)