mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
Fix various Guild properties getting unset
This commit is contained in:
@@ -92,13 +92,13 @@ class Guild {
|
|||||||
* The full amount of members in this Guild as of `READY`
|
* The full amount of members in this Guild as of `READY`
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.memberCount = data.member_count;
|
this.memberCount = data.member_count || this.memberCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the guild is "large" (has more than 250 members)
|
* Whether the guild is "large" (has more than 250 members)
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
*/
|
*/
|
||||||
this.large = data.large;
|
this.large = data.large || this.large;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An array of guild features.
|
* An array of guild features.
|
||||||
@@ -139,8 +139,8 @@ class Guild {
|
|||||||
|
|
||||||
this.id = data.id;
|
this.id = data.id;
|
||||||
this.available = !data.unavailable;
|
this.available = !data.unavailable;
|
||||||
this.features = data.features || [];
|
this.features = data.features || this.features || [];
|
||||||
this._joinDate = new Date(data.joined_at).getTime();
|
this._joinedTimestamp = data.joined_at ? new Date(data.joined_at).getTime() : this._joinedTimestamp;
|
||||||
|
|
||||||
if (data.members) {
|
if (data.members) {
|
||||||
this.members.clear();
|
this.members.clear();
|
||||||
@@ -210,7 +210,7 @@ class Guild {
|
|||||||
* @type {Date}
|
* @type {Date}
|
||||||
*/
|
*/
|
||||||
get joinDate() {
|
get joinDate() {
|
||||||
return new Date(this._joinDate);
|
return new Date(this._joinedTimestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user