fix guild owner

This commit is contained in:
Amish Shah
2016-09-01 15:54:52 +01:00
parent 552d603782
commit 8d9a778320
2 changed files with 12 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@@ -195,7 +195,7 @@ class Guild {
this.large === data.large &&
this.icon === data.icon &&
arraysEqual(this.features, data.features) &&
this.owner.id === data.owner_id &&
this.ownerID === data.owner_id &&
this.verificationLevel === data.verification_level &&
this.embedEnabled === data.embed_enabled;
@@ -313,11 +313,7 @@ class Guild {
}
if (data.owner_id) {
/**
* The owner of the guild
* @type {GuildMember}
*/
this.owner = this.members.get(data.owner_id);
this.ownerID = data.owner_id;
}
if (data.channels) {
@@ -616,6 +612,15 @@ class Guild {
}
return Constants.Endpoints.guildIcon(this.id, this.icon);
}
/**
* The owner of the Guild
* @type {Member}
* @readonly
*/
get owner() {
return this.members.get(this.ownerID);
}
}
module.exports = Guild;