feat(GuildMember): #pending (#5121)

* Add GuildMember#isPending

* Rename is_pending to pending

* Improve jsdoc wording

* pending isn't nullable

* ??
This commit is contained in:
Adrian Paschkowski
2021-01-02 23:55:37 +01:00
committed by GitHub
parent e37160f4e3
commit c4c817116f
2 changed files with 8 additions and 0 deletions

View File

@@ -64,6 +64,12 @@ class GuildMember extends Base {
*/
this.nickname = null;
/**
* Whether this member has yet to pass the guild's membership gate
* @type {boolean}
*/
this.pending = false;
this._roles = [];
if (data) this._patch(data);
}
@@ -81,6 +87,7 @@ class GuildMember extends Base {
if ('joined_at' in data) this.joinedTimestamp = new Date(data.joined_at).getTime();
if ('premium_since' in data) this.premiumSinceTimestamp = new Date(data.premium_since).getTime();
if ('roles' in data) this._roles = data.roles;
this.pending = data.pending ?? false;
}
_clone() {

1
typings/index.d.ts vendored
View File

@@ -803,6 +803,7 @@ declare module 'discord.js' {
public readonly displayName: string;
public guild: Guild;
public readonly id: Snowflake;
public pending: boolean;
public readonly joinedAt: Date | null;
public joinedTimestamp: number | null;
public readonly kickable: boolean;