Skip to content

Commit

Permalink
fix(FollowAlertPlaying): make WotcCode optional
Browse files Browse the repository at this point in the history
  • Loading branch information
meenzen committed Apr 20, 2024
1 parent 5582545 commit 04bc1f1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.Json.Serialization;
using Streamlabs.SocketClient.Converters;
using Streamlabs.SocketClient.Messages.Abstractions;
using Streamlabs.SocketClient.Messages.DataTypes;

Expand All @@ -14,5 +13,5 @@ public sealed record FollowAlertPlayingMessage : AlertPlayingMessage, IHasPayloa
public required FollowAlertPayload Payload { get; init; }

[JsonPropertyName("wotcCode")]
public required string? WotcCode { get; init; }
public string? WotcCode { get; init; }
}
27 changes: 27 additions & 0 deletions test/Streamlabs.SocketClient.Tests/MessageJson/alertPlaying.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"type": "alertPlaying",
"message": {
"priority": 10,
"_id": "215d438bedcf3f5f19adae6103e7c014",
"from": "bram12334",
"to": "",
"message": "",
"payload": {
"_id": "215d438bedcf3f5f19adae6103e7c014",
"id": "974905413",
"name": "bram12334",
"priority": 10
},
"name": "bram12334",
"repeat": false,
"isTest": false,
"createdAt": "2024-04-20 11:09:51",
"createdAtTimestamp": 1713611391717,
"platform": "twitch_account",
"type": "follow",
"hash": "follow:bram12334:",
"read": false
}
}
]
1 change: 1 addition & 0 deletions test/Streamlabs.SocketClient.Tests/MessageTypeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public sealed record JsonFile(string FileName, Type ExpectedType, string? EventN
new("bits.json", typeof(BitsEvent)),
new("bits2.json", typeof(BitsEvent)),
new("donationDelete.json", typeof(DonationDeleteEvent)),
new("alertPlaying.json", typeof(AlertPlayingEvent), "FollowAlertPlaying"),
new("alertPlaying_subscription.json", typeof(AlertPlayingEvent), "SubscriptionAlertPlaying"),
new("alertPlaying_bits.json", typeof(AlertPlayingEvent), "BitsAlertPlaying"),
new("alertPlaying_subMysteryGift.json", typeof(AlertPlayingEvent), "SubMysteryGiftAlertPlaying"),
Expand Down

0 comments on commit 04bc1f1

Please sign in to comment.