mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
ServerRoleCreate listener
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user