Add MaxBitrate to the interface (#1861)
Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
This commit is contained in:
@@ -313,6 +313,13 @@ namespace Discord
|
||||
/// The approximate number of non-offline members in this guild.
|
||||
/// </returns>
|
||||
int? ApproximatePresenceCount { get; }
|
||||
/// <summary>
|
||||
/// Gets the max bitrate for voice channels in this guild.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A <see cref="int"/> representing the maximum bitrate value allowed by Discord in this guild.
|
||||
/// </returns>
|
||||
int MaxBitrate { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the preferred locale of this guild in IETF BCP 47
|
||||
|
||||
@@ -85,6 +85,20 @@ namespace Discord.Rest
|
||||
public int? ApproximateMemberCount { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public int? ApproximatePresenceCount { get; private set; }
|
||||
/// <inheritdoc/>
|
||||
public int MaxBitrate
|
||||
{
|
||||
get
|
||||
{
|
||||
return PremiumTier switch
|
||||
{
|
||||
PremiumTier.Tier1 => 128000,
|
||||
PremiumTier.Tier2 => 256000,
|
||||
PremiumTier.Tier3 => 384000,
|
||||
_ => 96000,
|
||||
};
|
||||
}
|
||||
}
|
||||
/// <inheritdoc />
|
||||
public NsfwLevel NsfwLevel { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -185,24 +185,18 @@ namespace Discord.WebSocket
|
||||
return id.HasValue ? GetVoiceChannel(id.Value) : null;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets the max bitrate for voice channels in this guild.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A <see cref="int"/> representing the maximum bitrate value allowed by Discord in this guild.
|
||||
/// </returns>
|
||||
/// <inheritdoc/>
|
||||
public int MaxBitrate
|
||||
{
|
||||
get
|
||||
{
|
||||
var maxBitrate = PremiumTier switch
|
||||
return PremiumTier switch
|
||||
{
|
||||
PremiumTier.Tier1 => 128000,
|
||||
PremiumTier.Tier2 => 256000,
|
||||
PremiumTier.Tier3 => 384000,
|
||||
_ => 96000,
|
||||
};
|
||||
return maxBitrate;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user