mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
Servers now manage server-wide permissions
Servers now create ServerPermissions objects for roles
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user