feature: Add GuildUser IsPending property (#1731)
* Implemented Pending property * Implemented changes
This commit is contained in:
@@ -18,6 +18,8 @@ namespace Discord.API
|
||||
public Optional<bool> Deaf { get; set; }
|
||||
[JsonProperty("mute")]
|
||||
public Optional<bool> Mute { get; set; }
|
||||
[JsonProperty("pending")]
|
||||
public Optional<bool> Pending { get; set; }
|
||||
[JsonProperty("premium_since")]
|
||||
public Optional<DateTimeOffset?> PremiumSince { get; set; }
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ namespace Discord.Rest
|
||||
public DateTimeOffset? PremiumSince => DateTimeUtils.FromTicks(_premiumSinceTicks);
|
||||
/// <inheritdoc />
|
||||
public ulong GuildId => Guild.Id;
|
||||
/// <inheritdoc />
|
||||
public bool? IsPending { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <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);
|
||||
if (model.PremiumSince.IsSpecified)
|
||||
_premiumSinceTicks = model.PremiumSince.Value?.UtcTicks;
|
||||
if (model.Pending.IsSpecified)
|
||||
IsPending = model.Pending.Value;
|
||||
}
|
||||
private void UpdateRoles(ulong[] roleIds)
|
||||
{
|
||||
|
||||
@@ -52,6 +52,8 @@ namespace Discord.Rest
|
||||
/// <inheritdoc />
|
||||
string IGuildUser.Nickname => null;
|
||||
/// <inheritdoc />
|
||||
bool? IGuildUser.IsPending => null;
|
||||
/// <inheritdoc />
|
||||
GuildPermissions IGuildUser.GuildPermissions => GuildPermissions.Webhook;
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user