Browse Source

Add MaxBitrate to the interface (#1861)

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
tags/3.0.0
Paulo GitHub 3 years ago
parent
commit
e0dbe7c695
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 8 deletions
  1. +7
    -0
      src/Discord.Net.Core/Entities/Guilds/IGuild.cs
  2. +14
    -0
      src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs
  3. +2
    -8
      src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs

+ 7
- 0
src/Discord.Net.Core/Entities/Guilds/IGuild.cs View File

@@ -313,6 +313,13 @@ namespace Discord
/// The approximate number of non-offline members in this guild. /// The approximate number of non-offline members in this guild.
/// </returns> /// </returns>
int? ApproximatePresenceCount { get; } 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> /// <summary>
/// Gets the preferred locale of this guild in IETF BCP 47 /// Gets the preferred locale of this guild in IETF BCP 47


+ 14
- 0
src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs View File

@@ -85,6 +85,20 @@ namespace Discord.Rest
public int? ApproximateMemberCount { get; private set; } public int? ApproximateMemberCount { get; private set; }
/// <inheritdoc /> /// <inheritdoc />
public int? ApproximatePresenceCount { get; private set; } 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 /> /// <inheritdoc />
public NsfwLevel NsfwLevel { get; private set; } public NsfwLevel NsfwLevel { get; private set; }
/// <inheritdoc /> /// <inheritdoc />


+ 2
- 8
src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs View File

@@ -185,24 +185,18 @@ namespace Discord.WebSocket
return id.HasValue ? GetVoiceChannel(id.Value) : null; 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 public int MaxBitrate
{ {
get get
{ {
var maxBitrate = PremiumTier switch
return PremiumTier switch
{ {
PremiumTier.Tier1 => 128000, PremiumTier.Tier1 => 128000,
PremiumTier.Tier2 => 256000, PremiumTier.Tier2 => 256000,
PremiumTier.Tier3 => 384000, PremiumTier.Tier3 => 384000,
_ => 96000, _ => 96000,
}; };
return maxBitrate;
} }
} }
/// <summary> /// <summary>


Loading…
Cancel
Save