Skip to content

Commit

Permalink
[Feature] Add MaxStageVideoChannelUsers property to IGuild (#2648)
Browse files Browse the repository at this point in the history
  • Loading branch information
Misha-133 committed Mar 31, 2023
1 parent 2112e1f commit bdd755b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Discord.Net.Core/Entities/Guilds/IGuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,13 @@ public interface IGuild : IDeletable, ISnowflakeEntity
/// </returns>
int? MaxVideoChannelUsers { get; }
/// <summary>
/// Gets the maximum amount of users in a stage video channel.
/// </summary>
/// <returns>
/// The maximum amount of users in a stage video channel.
/// </returns>
int? MaxStageVideoChannelUsers { get; }
/// <summary>
/// Gets the approximate number of members in this guild.
/// </summary>
/// <remarks>
Expand Down
3 changes: 3 additions & 0 deletions src/Discord.Net.Rest/API/Common/Guild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,8 @@ internal class Guild

[JsonProperty("welcome_screen")]
public Optional<WelcomeScreen> WelcomeScreen { get; set; }

[JsonProperty("max_stage_video_channel_users")]
public Optional<int> MaxStageVideoChannelUsers { get; set; }
}
}
4 changes: 4 additions & 0 deletions src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public class RestGuild : RestEntity<ulong>, IGuild, IUpdateable
/// <inheritdoc />
public int? MaxVideoChannelUsers { get; private set; }
/// <inheritdoc />
public int? MaxStageVideoChannelUsers { get; private set; }
/// <inheritdoc />
public int? ApproximateMemberCount { get; private set; }
/// <inheritdoc />
public int? ApproximatePresenceCount { get; private set; }
Expand Down Expand Up @@ -185,6 +187,8 @@ internal void Update(Model model)
MaxMembers = model.MaxMembers.Value;
if (model.MaxVideoChannelUsers.IsSpecified)
MaxVideoChannelUsers = model.MaxVideoChannelUsers.Value;
if (model.MaxStageVideoChannelUsers.IsSpecified)
MaxStageVideoChannelUsers = model.MaxStageVideoChannelUsers.Value;
PreferredLocale = model.PreferredLocale;
PreferredCulture = new CultureInfo(PreferredLocale);
if (model.ApproximateMemberCount.IsSpecified)
Expand Down
4 changes: 4 additions & 0 deletions src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ public class SocketGuild : SocketEntity<ulong>, IGuild, IDisposable
/// <inheritdoc />
public int? MaxVideoChannelUsers { get; private set; }
/// <inheritdoc />
public int? MaxStageVideoChannelUsers { get; private set; }
/// <inheritdoc />
public NsfwLevel NsfwLevel { get; private set; }
/// <inheritdoc />
public CultureInfo PreferredCulture { get; private set; }
Expand Down Expand Up @@ -547,6 +549,8 @@ internal void Update(ClientState state, Model model)
MaxMembers = model.MaxMembers.Value;
if (model.MaxVideoChannelUsers.IsSpecified)
MaxVideoChannelUsers = model.MaxVideoChannelUsers.Value;
if (model.MaxStageVideoChannelUsers.IsSpecified)
MaxStageVideoChannelUsers = model.MaxStageVideoChannelUsers.Value;
PreferredLocale = model.PreferredLocale;
PreferredCulture = PreferredLocale == null ? null : new CultureInfo(PreferredLocale);
if (model.IsBoostProgressBarEnabled.IsSpecified)
Expand Down

0 comments on commit bdd755b

Please sign in to comment.