@@ -1,4 +1,5 @@ | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Collections.Immutable; | |||||
namespace Discord; | namespace Discord; | ||||
@@ -18,7 +19,7 @@ public class WelcomeScreen | |||||
{ | { | ||||
Description = description; | Description = description; | ||||
Channels = channels; | |||||
Channels = channels.ToImmutableArray(); | |||||
} | } | ||||
} | } |
@@ -57,7 +57,7 @@ namespace Discord | |||||
/// Gets the guild this invite is linked to. | /// Gets the guild this invite is linked to. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Guild might have empty properties due to API not returning full guild object. | |||||
/// The guild may be partially populated. | |||||
/// </remarks> | /// </remarks> | ||||
/// <returns> | /// <returns> | ||||
/// A guild object representing the guild that the invite points to. | /// A guild object representing the guild that the invite points to. | ||||
@@ -66,7 +66,7 @@ namespace Discord.API | |||||
[JsonProperty("premium_subscription_count")] | [JsonProperty("premium_subscription_count")] | ||||
public int? PremiumSubscriptionCount { get; set; } | public int? PremiumSubscriptionCount { get; set; } | ||||
[JsonProperty("preferred_locale")] | [JsonProperty("preferred_locale")] | ||||
public Optional<string> PreferredLocale { get; set; } | |||||
public string PreferredLocale { get; set; } | |||||
[JsonProperty("public_updates_channel_id")] | [JsonProperty("public_updates_channel_id")] | ||||
public ulong? PublicUpdatesChannelId { get; set; } | public ulong? PublicUpdatesChannelId { get; set; } | ||||
[JsonProperty("max_video_channel_users")] | [JsonProperty("max_video_channel_users")] | ||||
@@ -2,7 +2,6 @@ using Newtonsoft.Json; | |||||
namespace Discord.API.Rest; | namespace Discord.API.Rest; | ||||
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] | [JsonObject(MemberSerialization = MemberSerialization.OptIn)] | ||||
internal class ModifyGuildWelcomeScreenParams | internal class ModifyGuildWelcomeScreenParams | ||||
{ | { | ||||
@@ -181,8 +181,8 @@ namespace Discord.Rest | |||||
MaxMembers = model.MaxMembers.Value; | MaxMembers = model.MaxMembers.Value; | ||||
if (model.MaxVideoChannelUsers.IsSpecified) | if (model.MaxVideoChannelUsers.IsSpecified) | ||||
MaxVideoChannelUsers = model.MaxVideoChannelUsers.Value; | MaxVideoChannelUsers = model.MaxVideoChannelUsers.Value; | ||||
PreferredLocale = model.PreferredLocale.IsSpecified ? model.PreferredLocale.Value : null; | |||||
PreferredCulture = model.PreferredLocale.IsSpecified ? new CultureInfo(PreferredLocale) : null; | |||||
PreferredLocale = model.PreferredLocale; | |||||
PreferredCulture = model.PreferredLocale is null ? null : new CultureInfo(PreferredLocale); | |||||
if (model.ApproximateMemberCount.IsSpecified) | if (model.ApproximateMemberCount.IsSpecified) | ||||
ApproximateMemberCount = model.ApproximateMemberCount.Value; | ApproximateMemberCount = model.ApproximateMemberCount.Value; | ||||
if (model.ApproximatePresenceCount.IsSpecified) | if (model.ApproximatePresenceCount.IsSpecified) | ||||
@@ -515,7 +515,7 @@ namespace Discord.WebSocket | |||||
MaxMembers = model.MaxMembers.Value; | MaxMembers = model.MaxMembers.Value; | ||||
if (model.MaxVideoChannelUsers.IsSpecified) | if (model.MaxVideoChannelUsers.IsSpecified) | ||||
MaxVideoChannelUsers = model.MaxVideoChannelUsers.Value; | MaxVideoChannelUsers = model.MaxVideoChannelUsers.Value; | ||||
PreferredLocale = model.PreferredLocale.IsSpecified ? model.PreferredLocale.Value : null; | |||||
PreferredLocale = model.PreferredLocale; | |||||
PreferredCulture = PreferredLocale == null ? null : new CultureInfo(PreferredLocale); | PreferredCulture = PreferredLocale == null ? null : new CultureInfo(PreferredLocale); | ||||
if (model.IsBoostProgressBarEnabled.IsSpecified) | if (model.IsBoostProgressBarEnabled.IsSpecified) | ||||
IsBoostProgressBarEnabled = model.IsBoostProgressBarEnabled.Value; | IsBoostProgressBarEnabled = model.IsBoostProgressBarEnabled.Value; | ||||