Browse Source

Fix: serialization error on thread creation timestamp. (#2188)

tags/3.5.0
Armano den Boef GitHub 3 years ago
parent
commit
d48a7bd348
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      src/Discord.Net.Rest/API/Common/ThreadMetadata.cs
  2. +1
    -1
      src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs

+ 1
- 1
src/Discord.Net.Rest/API/Common/ThreadMetadata.cs View File

@@ -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; }
}
}

+ 1
- 1
src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs View File

@@ -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;
}


Loading…
Cancel
Save