Made GroupDMChannel.owner a getter and add ownerID

This commit is contained in:
Schuyler Cebulskie
2016-09-19 01:36:01 -04:00
parent b8e3094b14
commit 3fcc5183dc

View File

@@ -54,10 +54,10 @@ class GroupDMChannel extends Channel {
this.icon = data.icon;
/**
* The owner of this Group DM.
* @type {User}
* The owner of this Group DM's user ID.
* @type {string}
*/
this.owner = this.client.users.get(data.owner_id);
this.ownerID = data.owner_id;
if (!this.recipients) {
/**
@@ -77,6 +77,14 @@ class GroupDMChannel extends Channel {
this.lastMessageID = data.last_message_id;
}
/**
* The owner of this Group DM.
* @type {User}
*/
get owner() {
return this.client.users.get(this.ownerID);
}
/**
* Whether this channel equals another channel. It compares all properties, so for most operations
* it is advisable to just compare `channel.id === channel2.id` as it is much faster and is often