mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
feat: add support for premium guilds (#3316)
* add premiumTier and premiumSubscriptionCount * add premiumSinceTimestamp and premiumSince * add premium message types * typings * add GuildEmoji#available * fix doc description
This commit is contained in:
@@ -39,7 +39,6 @@ class GuildMember extends Base {
|
||||
/**
|
||||
* The timestamp the member joined the guild at
|
||||
* @type {?number}
|
||||
* @name GuildMember#joinedTimestamp
|
||||
*/
|
||||
this.joinedTimestamp = null;
|
||||
|
||||
@@ -55,6 +54,12 @@ class GuildMember extends Base {
|
||||
*/
|
||||
this.lastMessageChannelID = null;
|
||||
|
||||
/**
|
||||
* The timestamp of when the member used their Nitro boost on the guild, if it was used
|
||||
* @type {?number}
|
||||
*/
|
||||
this.premiumSinceTimestamp = null;
|
||||
|
||||
/**
|
||||
* Whether the member has been removed from the guild
|
||||
* @type {boolean}
|
||||
@@ -74,6 +79,7 @@ class GuildMember extends Base {
|
||||
if (typeof data.nick !== 'undefined') this.nickname = data.nick;
|
||||
|
||||
if (data.joined_at) this.joinedTimestamp = new Date(data.joined_at).getTime();
|
||||
if (data.premium_since) this.premiumSinceTimestamp = new Date(data.premium_since).getTime();
|
||||
|
||||
if (data.user) this.user = this.guild.client.users.add(data.user);
|
||||
if (data.roles) this._roles = data.roles;
|
||||
@@ -131,6 +137,15 @@ class GuildMember extends Base {
|
||||
return this.joinedTimestamp ? new Date(this.joinedTimestamp) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The time of when the member used their Nitro boost on the guild, if it was used
|
||||
* @type {?Date}
|
||||
* @readonly
|
||||
*/
|
||||
get premiumSince() {
|
||||
return this.premiumSinceTimestamp ? new Date(this.premiumSinceTimestamp) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The presence of this guild member
|
||||
* @type {Presence}
|
||||
|
||||
Reference in New Issue
Block a user