diff --git a/src/structures/Guild.js b/src/structures/Guild.js index 9a8759e73003..5a6d06746819 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -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. diff --git a/typings/index.d.ts b/typings/index.d.ts index ab686cb62202..b6bca2a87404 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -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; public delete(): Promise; public discoverySplashURL(options?: StaticImageURLOptions): string | null;