diff --git a/src/Discord.Net.Rest/API/Common/Guild.cs b/src/Discord.Net.Rest/API/Common/Guild.cs index 414929a7b1..46075ce4d1 100644 --- a/src/Discord.Net.Rest/API/Common/Guild.cs +++ b/src/Discord.Net.Rest/API/Common/Guild.cs @@ -69,7 +69,7 @@ internal class Guild [JsonProperty("max_members")] public Optional MaxMembers { get; set; } [JsonProperty("premium_subscription_count")] - public Optional PremiumSubscriptionCount { get; set; } + public int? PremiumSubscriptionCount { get; set; } [JsonProperty("preferred_locale")] public string PreferredLocale { get; set; } [JsonProperty("public_updates_channel_id")] diff --git a/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs b/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs index c1dd39afea..c74e128a85 100644 --- a/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs +++ b/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs @@ -161,8 +161,7 @@ internal void Update(Model model) BannerId = model.Banner; SystemChannelFlags = model.SystemChannelFlags; Description = model.Description; - if (model.PremiumSubscriptionCount.IsSpecified) - PremiumSubscriptionCount = model.PremiumSubscriptionCount.Value; + PremiumSubscriptionCount = model.PremiumSubscriptionCount.GetValueOrDefault(); if (model.MaxPresences.IsSpecified) MaxPresences = model.MaxPresences.Value ?? 25000; if (model.MaxMembers.IsSpecified) diff --git a/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs b/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs index 2365ec6a60..ad58a735ea 100644 --- a/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs +++ b/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs @@ -448,8 +448,7 @@ internal void Update(ClientState state, Model model) BannerId = model.Banner; SystemChannelFlags = model.SystemChannelFlags; Description = model.Description; - if (model.PremiumSubscriptionCount.IsSpecified) - PremiumSubscriptionCount = model.PremiumSubscriptionCount.Value; + PremiumSubscriptionCount = model.PremiumSubscriptionCount.GetValueOrDefault(); if (model.MaxPresences.IsSpecified) MaxPresences = model.MaxPresences.Value ?? 25000; if (model.MaxMembers.IsSpecified)