Skip to content

Commit d5879c8

Browse files
authored
[Fix] Entitlements starts_at is nullable (#3034)
* i wonder if it was just as simple as that * nope * nope x2 * nope x3
1 parent 93229f6 commit d5879c8

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

src/Discord.Net.Rest/API/Common/Entitlement.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ internal class Entitlement
2727
public Optional<bool> IsConsumed { get; set; }
2828

2929
[JsonProperty("starts_at")]
30-
public Optional<DateTimeOffset> StartsAt { get; set; }
30+
public DateTimeOffset? StartsAt { get; set; }
3131

3232
[JsonProperty("ends_at")]
3333
public Optional<DateTimeOffset?> EndsAt { get; set; }

src/Discord.Net.Rest/Entities/AppSubscriptions/RestEntitlement.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ internal void Update(Model model)
5656
ApplicationId = model.ApplicationId;
5757
Type = model.Type;
5858
IsConsumed = model.IsConsumed.GetValueOrDefault(false);
59-
StartsAt = model.StartsAt.IsSpecified
60-
? model.StartsAt.Value
61-
: null;
59+
StartsAt = model.StartsAt;
6260
EndsAt = model.EndsAt.IsSpecified
6361
? model.EndsAt.Value
6462
: null;

src/Discord.Net.WebSocket/Entities/AppSubscriptions/SocketEntitlement.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ internal void Update(Model model)
6868
ApplicationId = model.ApplicationId;
6969
Type = model.Type;
7070
IsConsumed = model.IsConsumed.GetValueOrDefault(false);
71-
StartsAt = model.StartsAt.IsSpecified
72-
? model.StartsAt.Value
73-
: null;
71+
StartsAt = model.StartsAt;
7472
EndsAt = model.EndsAt.IsSpecified
7573
? model.EndsAt.Value
7674
: null;

0 commit comments

Comments
 (0)