ServerRoleCreate listener

This commit is contained in:
hydrabolt
2015-11-01 15:12:33 +00:00
parent 5b7a3dd3a1
commit 4d8cd20cf5
10 changed files with 37 additions and 26 deletions

View File

@@ -29,7 +29,7 @@ const DefaultRole = [
].reduce( (previous, current) => previous | current, 0 );
class Role{
constructor(data, serverID, client){
constructor(data, server, client){
this.position = data.position || -1;
this.permissions = data.permissions || DefaultRole;
this.name = data.name || "@everyone";
@@ -37,14 +37,10 @@ class Role{
this.id = data.id;
this.hoist = data.hoist || false;
this.color = data.color || 0;
this.serverID = serverID;
this.server = server;
this.client = client;
}
get server(){
return this.client.internal.servers.get("id", this.serverID);
}
serialise(explicit){
var hp = (perm) => this.hasPermission(perm, explicit);

View File

@@ -54,7 +54,7 @@ class Server extends Equality {
} );
data.roles.forEach( (dataRole) => {
this.roles.add( new Role(dataRole, this) );
this.roles.add( new Role(dataRole, this, client) );
} );
}