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(Guild): Add Guild#maximumBitrate getter. #6455

Merged
merged 12 commits into from Aug 23, 2021
24 changes: 24 additions & 0 deletions src/structures/Guild.js
Expand Up @@ -534,6 +534,30 @@ 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 0:
fasterplayer marked this conversation as resolved.
Show resolved Hide resolved
return 96000;
fasterplayer marked this conversation as resolved.
Show resolved Hide resolved
case 1:
return 128000;
case 2:
return 256000;
case 3:
fasterplayer marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -691,6 +691,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