From d48a7bd3483bb9ba414feb70740633877e77334c Mon Sep 17 00:00:00 2001 From: Armano den Boef <68127614+Rozen4334@users.noreply.github.com> Date: Sat, 26 Mar 2022 13:45:54 +0100 Subject: [PATCH] Fix: serialization error on thread creation timestamp. (#2188) --- src/Discord.Net.Rest/API/Common/ThreadMetadata.cs | 2 +- .../Entities/Channels/SocketThreadChannel.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Discord.Net.Rest/API/Common/ThreadMetadata.cs b/src/Discord.Net.Rest/API/Common/ThreadMetadata.cs index 15854fab4..6735504c8 100644 --- a/src/Discord.Net.Rest/API/Common/ThreadMetadata.cs +++ b/src/Discord.Net.Rest/API/Common/ThreadMetadata.cs @@ -21,6 +21,6 @@ namespace Discord.API public Optional Invitable { get; set; } [JsonProperty("create_timestamp")] - public Optional CreatedAt { get; set; } + public Optional CreatedAt { get; set; } } } diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs index 2e77e62e3..78462b062 100644 --- a/src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs +++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs @@ -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; }