Skip to content

Commit

Permalink
[Fix] Entitlements starts_at is nullable (#3034)
Browse files Browse the repository at this point in the history
* i wonder if it was just as simple as that

* nope

* nope x2

* nope x3
  • Loading branch information
Misha-133 authored Dec 1, 2024
1 parent 93229f6 commit d5879c8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Discord.Net.Rest/API/Common/Entitlement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal class Entitlement
public Optional<bool> IsConsumed { get; set; }

[JsonProperty("starts_at")]
public Optional<DateTimeOffset> StartsAt { get; set; }
public DateTimeOffset? StartsAt { get; set; }

[JsonProperty("ends_at")]
public Optional<DateTimeOffset?> EndsAt { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ internal void Update(Model model)
ApplicationId = model.ApplicationId;
Type = model.Type;
IsConsumed = model.IsConsumed.GetValueOrDefault(false);
StartsAt = model.StartsAt.IsSpecified
? model.StartsAt.Value
: null;
StartsAt = model.StartsAt;
EndsAt = model.EndsAt.IsSpecified
? model.EndsAt.Value
: null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ internal void Update(Model model)
ApplicationId = model.ApplicationId;
Type = model.Type;
IsConsumed = model.IsConsumed.GetValueOrDefault(false);
StartsAt = model.StartsAt.IsSpecified
? model.StartsAt.Value
: null;
StartsAt = model.StartsAt;
EndsAt = model.EndsAt.IsSpecified
? model.EndsAt.Value
: null;
Expand Down

0 comments on commit d5879c8

Please sign in to comment.