Fix: serialization error on thread creation timestamp. (#2188)
This commit is contained in:
@@ -21,6 +21,6 @@ namespace Discord.API
|
||||
public Optional<bool> Invitable { get; set; }
|
||||
|
||||
[JsonProperty("create_timestamp")]
|
||||
public Optional<DateTimeOffset> CreatedAt { get; set; }
|
||||
public Optional<DateTimeOffset?> CreatedAt { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace Discord.WebSocket
|
||||
internal new static SocketThreadChannel Create(SocketGuild guild, ClientState state, Model model)
|
||||
{
|
||||
var parent = guild.GetChannel(model.CategoryId.Value);
|
||||
var entity = new SocketThreadChannel(guild.Discord, guild, model.Id, parent, model.ThreadMetadata.GetValueOrDefault()?.CreatedAt.ToNullable());
|
||||
var entity = new SocketThreadChannel(guild.Discord, guild, model.Id, parent, model.ThreadMetadata.GetValueOrDefault()?.CreatedAt.GetValueOrDefault(null));
|
||||
entity.Update(state, model);
|
||||
return entity;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user