From 5ef35d539836f8bcd29bd836a23b9e853020acfa Mon Sep 17 00:00:00 2001 From: cole Date: Fri, 6 Sep 2024 13:16:53 -0700 Subject: [PATCH] adds MsgParamOriginId to GiftedSubscription model (#267) * GiftedSubscription: add MsgParamOriginId support for tracking messages related to bulk sub gifting --- TwitchLib.Client.Models/GiftedSubscription.cs | 10 ++++++++++ TwitchLib.Client.Models/Internal/Tags.cs | 1 + 2 files changed, 11 insertions(+) diff --git a/TwitchLib.Client.Models/GiftedSubscription.cs b/TwitchLib.Client.Models/GiftedSubscription.cs index 0dd6803..a55162e 100644 --- a/TwitchLib.Client.Models/GiftedSubscription.cs +++ b/TwitchLib.Client.Models/GiftedSubscription.cs @@ -17,6 +17,11 @@ public class GiftedSubscription : UserNoticeBase /// public string MsgParamMonths { get; protected set; } = default!; + /// + /// If this message sourced from an event, this is the ID of that event + /// + public string MsgParamOriginId { get; protected set; } + /// /// The display name of the subscription gift recipient. /// @@ -78,6 +83,7 @@ public GiftedSubscription( Dictionary? undocumentedTags, Goal? msgParamGoal, string msgParamMonths, + string msgParamOriginId, string msgParamRecipientDisplayName, string msgParamRecipientId, string msgParamRecipientUserName, @@ -104,6 +110,7 @@ public GiftedSubscription( MsgParamGoal = msgParamGoal; IsAnonymous = userId == AnonymousGifterUserId; MsgParamMonths = msgParamMonths; + MsgParamOriginId = msgParamOriginId; MsgParamRecipientDisplayName = msgParamRecipientDisplayName; MsgParamRecipientId = msgParamRecipientId; MsgParamRecipientUserName = msgParamRecipientUserName; @@ -121,6 +128,9 @@ protected override bool TrySet(KeyValuePair tag) case Tags.MsgParamMonths: MsgParamMonths = tag.Value; break; + case Tags.MsgParamOriginId: + MsgParamOriginId = tag.Value; + break; case Tags.MsgParamRecipientDisplayName: MsgParamRecipientDisplayName = tag.Value; break; diff --git a/TwitchLib.Client.Models/Internal/Tags.cs b/TwitchLib.Client.Models/Internal/Tags.cs index 9c10f4a..4bb8ba8 100644 --- a/TwitchLib.Client.Models/Internal/Tags.cs +++ b/TwitchLib.Client.Models/Internal/Tags.cs @@ -47,6 +47,7 @@ public static class Tags public const string MsgParamSubPlan = "msg-param-sub-plan"; // Sent only on sub, resub, subgift, anonsubgift public const string MsgParamSubPlanName = "msg-param-sub-plan-name"; // Sent only on sub, resub, subgift, anonsubgift public const string MsgParamViewerCount = "msg-param-viewerCount"; // Sent only on raid + public const string MsgParamOriginId = "msg-param-origin-id"; public const string MsgParamRecipientDisplayName = "msg-param-recipient-display-name"; // Sent only on subgift, anonsubgift public const string MsgParamRecipientId = "msg-param-recipient-id"; // Sent only on subgift, anonsubgift public const string MsgParamRecipientUsername = "msg-param-recipient-user-name"; // Sent only on subgift, anonsubgift