Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add premiumSubscriptionCount to InviteGuild #7629

Merged
merged 5 commits into from Apr 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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;
Jiralite marked this conversation as resolved.
Show resolved Hide resolved
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