Skip to content

Commit

Permalink
feat: Add premiumSubscriptionCount to InviteGuild (#7629)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed Apr 9, 2022
1 parent b9c5676 commit 8e7d15e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
10 changes: 10 additions & 0 deletions src/structures/AnonymousGuild.js
Expand Up @@ -64,6 +64,16 @@ class AnonymousGuild extends BaseGuild {
*/
this.nsfwLevel = NSFWLevels[data.nsfw_level];
}

if ('premium_subscription_count' in data) {
/**
* The total number of boosts for this server
* @type {?number}
*/
this.premiumSubscriptionCount = data.premium_subscription_count;
} else {
this.premiumSubscriptionCount ??= null;
}
}

/**
Expand Down
8 changes: 0 additions & 8 deletions src/structures/Guild.js
Expand Up @@ -286,14 +286,6 @@ class Guild extends AnonymousGuild {
this.premiumTier = PremiumTiers[data.premium_tier];
}

if ('premium_subscription_count' in data) {
/**
* The total number of boosts for this server
* @type {?number}
*/
this.premiumSubscriptionCount = data.premium_subscription_count;
}

if ('widget_enabled' in data) {
/**
* Whether widget images are enabled on this guild
Expand Down
2 changes: 1 addition & 1 deletion typings/index.d.ts
Expand Up @@ -184,6 +184,7 @@ export abstract class AnonymousGuild extends BaseGuild {
public banner: string | null;
public description: string | null;
public nsfwLevel: NSFWLevel;
public premiumSubscriptionCount: number | null;
public splash: string | null;
public vanityURLCode: string | null;
public verificationLevel: VerificationLevel;
Expand Down Expand Up @@ -905,7 +906,6 @@ export class Guild extends AnonymousGuild {
public mfaLevel: MFALevel;
public ownerId: Snowflake;
public preferredLocale: string;
public premiumSubscriptionCount: number | null;
public premiumProgressBarEnabled: boolean;
public premiumTier: PremiumTier;
public presences: PresenceManager;
Expand Down

0 comments on commit 8e7d15e

Please sign in to comment.