Skip to content

Commit

Permalink
feat(Guild): Add Guild#maximumBitrate getter. (#6455)
Browse files Browse the repository at this point in the history
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
  • Loading branch information
5 people committed Aug 23, 2021
1 parent f39b597 commit 21983de
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/structures/Guild.js
Expand Up @@ -534,6 +534,28 @@ class Guild extends AnonymousGuild {
);
}

/**
* The maximum bitrate available for this guild
* @type {number}
* @readonly
*/
get maximumBitrate() {
if (this.features.includes('VIP_REGIONS')) {
return 384000;
}

switch (PremiumTiers[this.premiumTier]) {
case PremiumTiers.TIER_1:
return 128000;
case PremiumTiers.TIER_2:
return 256000;
case PremiumTiers.TIER_3:
return 384000;
default:
return 96000;
}
}

/**
* Fetches a collection of integrations to this guild.
* Resolves with a collection mapping integrations by their ids.
Expand Down
1 change: 1 addition & 0 deletions typings/index.d.ts
Expand Up @@ -701,6 +701,7 @@ export class Guild extends AnonymousGuild {
public readonly widgetChannel: TextChannel | null;
public widgetChannelId: Snowflake | null;
public widgetEnabled: boolean | null;
public readonly maximumBitrate: number;
public createTemplate(name: string, description?: string): Promise<GuildTemplate>;
public delete(): Promise<Guild>;
public discoverySplashURL(options?: StaticImageURLOptions): string | null;
Expand Down

0 comments on commit 21983de

Please sign in to comment.