feat: Update

- Event for GroupDM
- Friend nickname
#29
This commit is contained in:
March 7th
2022-09-16 19:08:15 +07:00
parent 84b6842db0
commit 70cde7df55
12 changed files with 130 additions and 12 deletions

View File

@@ -29,12 +29,6 @@ class PartialGroupDMChannel extends Channel {
*/
this.icon = null;
/**
* The recipients of this Group DM Channel.
* @type {Collection<Snowflake, User>}
*/
this.recipients = null;
/**
* Messages data
* @type {Collection}
@@ -68,6 +62,18 @@ class PartialGroupDMChannel extends Channel {
this._patch(data);
}
/**
* The recipients of this Group DM Channel.
* @type {Collection<Snowflake, User>}
* @readonly
*/
get recipients() {
const collect = new Collection();
this._recipients.map(recipient => collect.set(recipient.id, this.client.users._add(recipient)));
collect.set(this.client.user.id, this.client.user);
return collect;
}
/**
* The owner of this Group DM Channel
* @type {?User}
@@ -85,8 +91,7 @@ class PartialGroupDMChannel extends Channel {
_patch(data) {
super._patch(data);
if ('recipients' in data) {
this.recipients = new Collection();
data.recipients.map(recipient => this.recipients.set(recipient.id, this.client.users._add(recipient)));
this._recipients = data.recipients;
}
if ('last_pin_timestamp' in data) {
const date = new Date(data.last_pin_timestamp);