* Implemented Pending property * Implemented changestags/2.3.0
| @@ -68,6 +68,11 @@ namespace Discord | |||||
| /// </returns> | /// </returns> | ||||
| IReadOnlyCollection<ulong> RoleIds { get; } | IReadOnlyCollection<ulong> RoleIds { get; } | ||||
| /// <summary> | |||||
| /// Whether the user has passed the guild's Membership Screening requirements. | |||||
| /// </summary> | |||||
| bool? IsPending { get; } | |||||
| /// <summary> | /// <summary> | ||||
| /// Gets the level permissions granted to this user to a given channel. | /// Gets the level permissions granted to this user to a given channel. | ||||
| /// </summary> | /// </summary> | ||||
| @@ -18,6 +18,8 @@ namespace Discord.API | |||||
| public Optional<bool> Deaf { get; set; } | public Optional<bool> Deaf { get; set; } | ||||
| [JsonProperty("mute")] | [JsonProperty("mute")] | ||||
| public Optional<bool> Mute { get; set; } | public Optional<bool> Mute { get; set; } | ||||
| [JsonProperty("pending")] | |||||
| public Optional<bool> Pending { get; set; } | |||||
| [JsonProperty("premium_since")] | [JsonProperty("premium_since")] | ||||
| public Optional<DateTimeOffset?> PremiumSince { get; set; } | public Optional<DateTimeOffset?> PremiumSince { get; set; } | ||||
| } | } | ||||
| @@ -29,6 +29,8 @@ namespace Discord.Rest | |||||
| public DateTimeOffset? PremiumSince => DateTimeUtils.FromTicks(_premiumSinceTicks); | public DateTimeOffset? PremiumSince => DateTimeUtils.FromTicks(_premiumSinceTicks); | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public ulong GuildId => Guild.Id; | public ulong GuildId => Guild.Id; | ||||
| /// <inheritdoc /> | |||||
| public bool? IsPending { get; private set; } | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| /// <exception cref="InvalidOperationException" accessor="get">Resolving permissions requires the parent guild to be downloaded.</exception> | /// <exception cref="InvalidOperationException" accessor="get">Resolving permissions requires the parent guild to be downloaded.</exception> | ||||
| @@ -73,6 +75,8 @@ namespace Discord.Rest | |||||
| UpdateRoles(model.Roles.Value); | UpdateRoles(model.Roles.Value); | ||||
| if (model.PremiumSince.IsSpecified) | if (model.PremiumSince.IsSpecified) | ||||
| _premiumSinceTicks = model.PremiumSince.Value?.UtcTicks; | _premiumSinceTicks = model.PremiumSince.Value?.UtcTicks; | ||||
| if (model.Pending.IsSpecified) | |||||
| IsPending = model.Pending.Value; | |||||
| } | } | ||||
| private void UpdateRoles(ulong[] roleIds) | private void UpdateRoles(ulong[] roleIds) | ||||
| { | { | ||||
| @@ -52,6 +52,8 @@ namespace Discord.Rest | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| string IGuildUser.Nickname => null; | string IGuildUser.Nickname => null; | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| bool? IGuildUser.IsPending => null; | |||||
| /// <inheritdoc /> | |||||
| GuildPermissions IGuildUser.GuildPermissions => GuildPermissions.Webhook; | GuildPermissions IGuildUser.GuildPermissions => GuildPermissions.Webhook; | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| @@ -57,6 +57,8 @@ namespace Discord.WebSocket | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public bool IsStreaming => VoiceState?.IsStreaming ?? false; | public bool IsStreaming => VoiceState?.IsStreaming ?? false; | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public bool? IsPending { get; private set; } | |||||
| /// <inheritdoc /> | |||||
| public DateTimeOffset? JoinedAt => DateTimeUtils.FromTicks(_joinedAtTicks); | public DateTimeOffset? JoinedAt => DateTimeUtils.FromTicks(_joinedAtTicks); | ||||
| /// <summary> | /// <summary> | ||||
| /// Returns a collection of roles that the user possesses. | /// Returns a collection of roles that the user possesses. | ||||
| @@ -142,6 +144,8 @@ namespace Discord.WebSocket | |||||
| UpdateRoles(model.Roles.Value); | UpdateRoles(model.Roles.Value); | ||||
| if (model.PremiumSince.IsSpecified) | if (model.PremiumSince.IsSpecified) | ||||
| _premiumSinceTicks = model.PremiumSince.Value?.UtcTicks; | _premiumSinceTicks = model.PremiumSince.Value?.UtcTicks; | ||||
| if (model.Pending.IsSpecified) | |||||
| IsPending = model.Pending.Value; | |||||
| } | } | ||||
| internal void Update(ClientState state, PresenceModel model, bool updatePresence) | internal void Update(ClientState state, PresenceModel model, bool updatePresence) | ||||
| { | { | ||||
| @@ -65,6 +65,8 @@ namespace Discord.WebSocket | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| DateTimeOffset? IGuildUser.PremiumSince => null; | DateTimeOffset? IGuildUser.PremiumSince => null; | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| bool? IGuildUser.IsPending => null; | |||||
| /// <inheritdoc /> | |||||
| GuildPermissions IGuildUser.GuildPermissions => GuildPermissions.Webhook; | GuildPermissions IGuildUser.GuildPermissions => GuildPermissions.Webhook; | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||