@@ -13,7 +13,7 @@ namespace Discord.API | |||||
[JsonProperty("roles")] | [JsonProperty("roles")] | ||||
public ulong[] Roles { get; set; } | public ulong[] Roles { get; set; } | ||||
[JsonProperty("joined_at")] | [JsonProperty("joined_at")] | ||||
public DateTimeOffset JoinedAt { get; set; } | |||||
public Optional<DateTimeOffset> JoinedAt { get; set; } | |||||
[JsonProperty("deaf")] | [JsonProperty("deaf")] | ||||
public bool Deaf { get; set; } | public bool Deaf { get; set; } | ||||
[JsonProperty("mute")] | [JsonProperty("mute")] | ||||
@@ -47,7 +47,8 @@ namespace Discord.Rest | |||||
} | } | ||||
internal void Update(Model model) | internal void Update(Model model) | ||||
{ | { | ||||
_joinedAtTicks = model.JoinedAt.UtcTicks; | |||||
if (model.JoinedAt.IsSpecified) | |||||
_joinedAtTicks = model.JoinedAt.Value.UtcTicks; | |||||
if (model.Nick.IsSpecified) | if (model.Nick.IsSpecified) | ||||
Nickname = model.Nick.Value; | Nickname = model.Nick.Value; | ||||
IsDeafened = model.Deaf; | IsDeafened = model.Deaf; | ||||
@@ -80,7 +80,8 @@ namespace Discord.WebSocket | |||||
internal void Update(ClientState state, Model model) | internal void Update(ClientState state, Model model) | ||||
{ | { | ||||
base.Update(state, model.User); | base.Update(state, model.User); | ||||
_joinedAtTicks = model.JoinedAt.UtcTicks; | |||||
if (model.JoinedAt.IsSpecified) | |||||
_joinedAtTicks = model.JoinedAt.Value.UtcTicks; | |||||
if (model.Nick.IsSpecified) | if (model.Nick.IsSpecified) | ||||
Nickname = model.Nick.Value; | Nickname = model.Nick.Value; | ||||
UpdateRoles(model.Roles); | UpdateRoles(model.Roles); | ||||